From 7baa918b3f946a27f39fd1d99c2e6a4499c4a20c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 14 Nov 2019 15:10:01 +0000 Subject: Remove Python 2 support Python 2 is going to reach EOL in January 2020, and most platforms have already moved to Python 3. --- configure.ac | 2 +- include/epoxy/meson.build | 1 - meson.build | 6 ------ src/gen_dispatch.py | 1 + src/meson.build | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index b0bb452..63ad8ee 100644 --- a/configure.ac +++ b/configure.ac @@ -41,7 +41,7 @@ m4_ifndef([XORG_MACROS_VERSION], XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS -AC_CHECK_PROGS([PYTHON], [python3 python2 python]) +AC_CHECK_PROGS([PYTHON], [python3]) # Initialize libtool AC_DISABLE_STATIC diff --git a/include/epoxy/meson.build b/include/epoxy/meson.build index 65f83be..c679efe 100644 --- a/include/epoxy/meson.build +++ b/include/epoxy/meson.build @@ -25,7 +25,6 @@ foreach g: generated_headers input: registry, output: [ gen_header ], command: [ - python, gen_dispatch_py, '--header', '--no-source', diff --git a/meson.build b/meson.build index 91d9792..b7bf8aa 100644 --- a/meson.build +++ b/meson.build @@ -196,12 +196,6 @@ if host_system == 'windows' gdi32_dep = cc.find_library('gdi32', required: true) endif -# Python -python = import('python3').find_python() -if not python.found() - python = find_program('python', required: true) -endif - # Generates the dispatch tables gen_dispatch_py = files('src/gen_dispatch.py') diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index f4d0f31..d33f128 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2013 Intel Corporation diff --git a/src/meson.build b/src/meson.build index fe092d1..371fd4b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -33,7 +33,6 @@ foreach g: generated_sources input: registry, output: [ gen_source ], command: [ - python, gen_dispatch_py, '--source', '--no-header', -- cgit v1.2.3 From 9b50dc4d844405aff21fafd8f6c2948319e42283 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 25 Nov 2019 22:47:41 +0000 Subject: Post-release version bump to 1.5.5 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 91d9792..80655ea 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.4', +project('libepoxy', 'c', version: '1.5.5', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', -- cgit v1.2.3 From 3ff32faa18340e9e06351209603550f556dd125d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 5 Nov 2019 15:12:29 -0800 Subject: Remove the autotools build system. Meson has been out for a long time, is faster, and is simpler. --- .editorconfig | 8 -- .gitignore | 15 --- Makefile.am | 68 ------------ autogen.sh | 16 --- configure.ac | 275 ---------------------------------------------- epoxy.pc.in | 16 --- include/epoxy/Makefile.am | 42 ------- src/Makefile.am | 184 ------------------------------- test/.gitignore | 24 ---- test/Makefile.am | 192 -------------------------------- 10 files changed, 840 deletions(-) delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 configure.ac delete mode 100644 epoxy.pc.in delete mode 100644 include/epoxy/Makefile.am delete mode 100644 src/Makefile.am delete mode 100644 test/.gitignore delete mode 100644 test/Makefile.am diff --git a/.editorconfig b/.editorconfig index ce6000d..3473806 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,14 +10,6 @@ end_of_line = lf trim_trailing_whitespace = true insert_final_newline = true -[configure.ac] -indent_style = tab -indent_size = 8 - -[Makefile.am] -indent_style = tab -indent_size = 8 - [.travis.yml] indent_style = space indent_size = 2 diff --git a/.gitignore b/.gitignore index 75d444d..fb054cb 100644 --- a/.gitignore +++ b/.gitignore @@ -77,18 +77,3 @@ core # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' # -configure.lineno -.dirstamp -test-driver - -gl_generated_dispatch.c -gl_generated.h - -glx_generated_dispatch.c -glx_generated.h - -egl_generated_dispatch.c -egl_generated.h - -wgl_generated_dispatch.c -wgl_generated.h diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 8fead48..0000000 --- a/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ - -# Copyright © 2013 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = include/epoxy src - -SUBDIRS += test - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = epoxy.pc - -registry_files = \ - registry/egl.xml \ - registry/gl.xml \ - registry/glx.xml \ - registry/wgl.xml \ - $() - -meson_build_files = \ - meson_options.txt \ - meson.build \ - include/epoxy/meson.build \ - src/meson.build \ - test/meson.build \ - doc/meson.build \ - doc/Doxyfile.in \ - cross/fedora-mingw64.txt \ - $() - -EXTRA_DIST = \ - .dir-locals.el \ - README.md \ - autogen.sh \ - epoxy.pc.in \ - $(registry_files) \ - $(meson_build_files) \ - $() - -dist-hook: - @if test -d "$(top_srcdir)/.git"; then \ - echo Generating ChangeLog... ; \ - ( $(top_srcdir)/missing --run git log --stat ) > "$(top_srcdir)/ChangeLog.tmp" \ - && mv -f "$(top_srcdir)/ChangeLog.tmp" "$(top_distdir)/ChangeLog" \ - || ( rm -f "$(top_srcdir)/ChangeLog.tmp"; \ - echo Failed to generate ChangeLog >&2 ); \ - else \ - echo A git checkout is required to generate a ChangeLog >&2; \ - fi diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 02b81ef..0000000 --- a/autogen.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -ORIGDIR=`pwd` -cd "$srcdir" - -mkdir m4 || exit 1 - -autoreconf -v --install || exit $? -cd "$ORIGDIR" || exit $? - -if test -z "$NOCONFIGURE"; then - exec "$srcdir/configure" "$@" -fi diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 63ad8ee..0000000 --- a/configure.ac +++ /dev/null @@ -1,275 +0,0 @@ -# Copyright © 2013 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -# Initialize Autoconf -AC_PREREQ([2.60]) -AC_INIT([libepoxy], - [1.5.4], - [https://github.com/anholt/libepoxy], - [libepoxy]) -AC_CONFIG_SRCDIR([Makefile.am]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# Initialize Automake -AM_INIT_AUTOMAKE([foreign -Wno-portability dist-xz no-dist-gzip tar-ustar subdir-objects]) - -# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS -m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen. - Hint: either install from source, git://anongit.freedesktop.org/xorg/util/macros or, - depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])]) - -XORG_MACROS_VERSION(1.8) -XORG_DEFAULT_OPTIONS - -AC_CHECK_PROGS([PYTHON], [python3]) - -# Initialize libtool -AC_DISABLE_STATIC -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL -AC_SYS_LARGEFILE - -AC_CHECK_HEADER([KHR/khrplatform.h], - [AC_DEFINE([HAVE_KHRPLATFORM_H], [1], - [Define to 1 if you have (used for tests)] - )] - ) - -# OS X defaults to having -Wint-conversion ("warn when passing -# uintptr_t to a void *") by default. Kill that. -XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion]) - -AC_ARG_ENABLE([x11], - [AC_HELP_STRING([--enable-x11=@<:@yes,no@:>@], [Enable X11 support @<:@default=yes@:>@])], - [enable_x11=$enableval], - [enable_x11=yes]) - -AC_ARG_ENABLE([glx], - [AC_HELP_STRING([--enable-glx=@<:@auto,yes,no@:>@], [Enable GLX support @<:@default=auto@:>@])], - [enable_glx=$enableval], - [enable_glx=auto]) - -# GLX can be used on different platforms, so we expose a -# configure time switch to enable or disable it; in case -# the "auto" default value is set, we only enable GLX -# support on Linux and Unix -AS_CASE([$enable_glx], - [auto], [ - AS_CASE([$host_os], - [mingw*], [build_glx=no], - [darwin*], [build_glx=no], - [android*], [build_glx=no], - [build_glx=yes]) - ], - - [yes], [ - build_glx=yes - ], - - [no], [ - build_glx=no - ], - - [AC_MSG_ERROR([Invalid value "$enable_glx" for option "--enable-glx"])] -]) - -AC_ARG_ENABLE([egl], - [AC_HELP_STRING([--enable-egl=@<:@auto,yes,no@:>@], [Enable EGL support @<:@default=auto@:>@])], - [enable_egl=$enableval], - [enable_egl=auto]) - -AS_CASE([$enable_egl], - [auto], [ - AS_CASE([$host_os], - [mingw*], [build_egl=no], - [darwin*], [build_egl=no], - [build_egl=yes]) - ], - - [yes], [ - build_egl=yes - ], - - [no], [ - build_egl=no - ], - - [AC_MSG_ERROR([Invalid value "$enable_egl" for option "--enable-egl"])] -]) - -# The remaining platform specific API are enabled depending on the -# platform we're building for -AS_CASE([$host_os], - [mingw*], [ - build_wgl=yes - has_znow=yes - # On windows, the DLL has to have all of its functions - # resolved at link time, so we have to link directly against - # opengl32.dll. But that's the only GL provider, anyway. - EPOXY_LINK_LIBS="-lopengl32" - - # Testing our built windows binaries requires that they be run - # under wine. Yeah, we should be nice and autodetect, but - # there's lots of missing autodetection for the testsuite - # (like checking for EGL and GLX libs in non-windows.). - AC_SUBST([LOG_COMPILER], [wine]) - ], - - [darwin*], [ - build_wgl=no - has_znow=no - EPOXY_LINK_LIBS="" - ], - - [ - build_wgl=no - has_znow=yes - # On platforms with dlopen, we load everything dynamically and - # don't link against a specific window system or GL implementation. - EPOXY_LINK_LIBS="" - ] -) - -AC_SUBST(EPOXY_LINK_LIBS) - -if test x$enable_x11 = xno; then - if test x$enable_glx = xyes; then - AC_MSG_ERROR([GLX support is explicitly enabled, but X11 was disabled]) - fi - build_glx=no -else - AC_DEFINE([ENABLE_X11], [1], [Whether X11 support is enabled]) -fi - -AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes) -if test x$build_egl = xyes; then - PKG_CHECK_MODULES(EGL, [egl]) - AC_DEFINE([BUILD_EGL], [1], [build EGL tests]) - AC_DEFINE(ENABLE_EGL, [1], [Whether EGL support is enabled]) -fi - -AM_CONDITIONAL(BUILD_GLX, test x$build_glx = xyes) -if test x$build_glx = xyes; then - AC_DEFINE([BUILD_GLX], [1], [build GLX tests]) -fi - -AM_CONDITIONAL(BUILD_WGL, test x$build_wgl = xyes) -if test x$build_wgl = xyes; then - AC_DEFINE([BUILD_WGL], [1], [build WGL tests]) -fi - -AM_CONDITIONAL(HAS_ZNOW, test x$has_znow = xyes) - -AC_CHECK_LIB([GLESv1_CM], [glFlush], [has_gles1=yes], [has_gles1=no]) -AM_CONDITIONAL(HAS_GLES1, test x$has_gles1 = xyes) - -AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"]) -AC_SUBST([DLOPEN_LIBS]) - -savelibs=$LIBS -LIBS=$DLOPEN_LIBS -AC_CHECK_FUNCS([dlvsym], [have_dlvsym=1], [have_dlvsym=0]) -AM_CONDITIONAL(HAVE_DLVSYM, test $have_dlvsym = 1) -LIBS=$savelibs - -VISIBILITY_CFLAGS="" -AS_CASE(["$host"], - - [*-*-mingw*], [ - dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport) - AC_DEFINE([EPOXY_PUBLIC], - [__attribute__((visibility("default"))) __declspec(dllexport) extern], - [defines how to decorate public symbols while building]) - VISIBILITY_CFLAGS="-fvisibility=hidden" - ], - - [ - dnl on other compilers, check if we can do -fvisibility=hidden - SAVED_CFLAGS="${CFLAGS}" - CFLAGS="-fvisibility=hidden" - AC_MSG_CHECKING([for -fvisibility=hidden compiler flag]) - AC_TRY_COMPILE([], [int main (void) { return 0; }], [ - AC_MSG_RESULT(yes) - enable_fvisibility_hidden=yes - ], [ - AC_MSG_RESULT(no) - enable_fvisibility_hidden=no - ]) - CFLAGS="${SAVED_CFLAGS}" - - AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [ - AC_DEFINE([EPOXY_PUBLIC], - [__attribute__((visibility("default"))) extern], - [defines how to decorate public symbols while building]) - VISIBILITY_CFLAGS="-fvisibility=hidden" - ]) - ] -) - -AC_SUBST([VISIBILITY_CFLAGS]) - -if test x$enable_x11 = xyes; then - PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no]) - if test x$x11 = xno -a x$build_glx = xyes; then - AC_MSG_ERROR([libX11 headers (libx11-dev) are required to build with GLX support]) - fi -else - x11=no -fi - -if test x$build_glx = xyes; then - AC_DEFINE(ENABLE_GLX, [1], [Whether GLX support is enabled]) -fi - -AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes) - -PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no]) -PKG_CHECK_MODULES(EGL, [egl], [egl=yes], [egl=no]) - -GL_REQS="" -AS_IF([test x$gl = xyes], [GL_REQS="$GL_REQS gl"]) -AS_IF([test x$build_egl = xyes && test x$egl = xyes], [GL_REQS="$GL_REQS egl"]) -AC_SUBST(GL_REQS) - -# Variables for the pkg-config file; AC_SUBST does not do `test` substitutions, -# so we need to specify the boolean values here -AS_IF([test x$build_glx = xyes], [epoxy_has_glx=1], [epoxy_has_glx=0]) -AS_IF([test x$build_egl = xyes], [epoxy_has_egl=1], [epoxy_has_egl=0]) -AS_IF([test x$build_wgl = xyes], [epoxy_has_wgl=1], [epoxy_has_wgl=0]) -AC_SUBST(epoxy_has_glx) -AC_SUBST(epoxy_has_egl) -AC_SUBST(epoxy_has_wgl) - -AC_CONFIG_FILES([ - epoxy.pc - Makefile - include/epoxy/Makefile - src/Makefile - test/Makefile -]) -AC_OUTPUT - -echo " EGL: $build_egl" -echo " GLX: $build_glx" -echo " WGL: $build_wgl" -echo " PYTHON: $PYTHON" diff --git a/epoxy.pc.in b/epoxy.pc.in deleted file mode 100644 index cdda8d9..0000000 --- a/epoxy.pc.in +++ /dev/null @@ -1,16 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -epoxy_has_glx=@epoxy_has_glx@ -epoxy_has_egl=@epoxy_has_egl@ -epoxy_has_wgl=@epoxy_has_wgl@ - -Name: epoxy -Description: epoxy GL dispatch Library -Version: @PACKAGE_VERSION@ -Cflags: -I${includedir} -Libs: -L${libdir} -lepoxy -Libs.private: @DLOPEN_LIBS@ -Requires.private: @GL_REQS@ diff --git a/include/epoxy/Makefile.am b/include/epoxy/Makefile.am deleted file mode 100644 index 494c96e..0000000 --- a/include/epoxy/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright © 2013 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -epoxyincludedir = $(includedir)/epoxy - -epoxyinclude_HEADERS = \ - common.h \ - gl.h \ - $(EGL_INCLUDES) \ - $(GLX_INCLUDES) \ - $(WGL_INCLUDES) \ - $() - -if BUILD_EGL -EGL_INCLUDES = egl.h -endif - -if BUILD_GLX -GLX_INCLUDES = glx.h -endif - -if BUILD_WGL -WGL_INCLUDES = wgl.h -endif diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 73f7435..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,184 +0,0 @@ -# Copyright © 2013 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - $() - -AM_CFLAGS = \ - $(CWARNFLAGS) \ - $(VISIBILITY_CFLAGS) \ - $(X11_CFLAGS) \ - $(EGL_CFLAGS) \ - $() - -epoxyincludedir = $(includedir)/epoxy -lib_LTLIBRARIES = libepoxy.la - -epoxyinclude_DATA = \ - $(GENERATED_GL_INCLUDES) \ - $(INSTALL_GLX_INCLUDES) \ - $(INSTALL_EGL_INCLUDES) \ - $(INSTALL_WGL_INCLUDES) \ - $() - -if BUILD_EGL -INSTALL_EGL_INCLUDES = $(GENERATED_EGL_INCLUDES) -endif - -if BUILD_GLX -INSTALL_GLX_INCLUDES = $(GENERATED_GLX_INCLUDES) -endif - -if BUILD_WGL -INSTALL_WGL_INCLUDES = $(GENERATED_WGL_INCLUDES) -endif - -GENERATED_GL_INCLUDES = \ - $(builddir)/../include/epoxy/gl_generated.h \ - $() - -GENERATED_GLX_INCLUDES = \ - $(builddir)/../include/epoxy/glx_generated.h \ - $() - -GENERATED_EGL_INCLUDES = \ - $(builddir)/../include/epoxy/egl_generated.h \ - $() - -GENERATED_WGL_INCLUDES = \ - $(builddir)/../include/epoxy/wgl_generated.h \ - $() - -GENERATED_GL_SOURCE = gl_generated_dispatch.c - -GENERATED_GL = \ - $(GENERATED_GL_SOURCE) \ - $(GENERATED_GL_INCLUDES) \ - $() - -GENERATED_GLX_SOURCE = glx_generated_dispatch.c - -GENERATED_GLX = \ - $(GENERATED_GLX_SOURCE) \ - $(GENERATED_GLX_INCLUDES) \ - $() - -GENERATED_EGL_SOURCE = egl_generated_dispatch.c - -GENERATED_EGL = \ - $(GENERATED_EGL_SOURCE) \ - $(GENERATED_EGL_INCLUDES) \ - $() - -GENERATED_WGL_SOURCE = wgl_generated_dispatch.c - -GENERATED_WGL = \ - $(GENERATED_WGL_SOURCE) \ - $(GENERATED_WGL_INCLUDES) \ - $() - -BUILT_SOURCES = \ - $(GENERATED_GL) \ - $(GENERATED_GLX) \ - $(GENERATED_EGL) \ - $(GENERATED_WGL) \ - $() -CLEANFILES = $(BUILT_SOURCES) - -libepoxy_la_SOURCES = \ - dispatch_common.c \ - dispatch_common.h \ - $(GENERATED_GL) \ - $(BUILD_EGL_CODE) \ - $(BUILD_GLX_CODE) \ - $(BUILD_WGL_CODE) \ - $() - -libepoxy_la_LDFLAGS = \ - -no-undefined \ - -Bsymbolic-functions \ - $() - -libepoxy_la_LIBADD = \ - $(EPOXY_LINK_LIBS) \ - $(DLOPEN_LIBS) \ - $() - -if BUILD_EGL -BUILD_EGL_CODE = \ - $(GENERATED_EGL) \ - dispatch_egl.c \ - $() -endif - -if BUILD_GLX -BUILD_GLX_CODE = \ - $(GENERATED_GLX) \ - dispatch_glx.c \ - $() -endif - -if BUILD_WGL -BUILD_WGL_CODE = \ - $(GENERATED_WGL) \ - dispatch_wgl.c \ - $() -endif - -# These are generated alongside the .c file. -$(GENERATED_GL_INCLUDES): $(GENERATED_GL_SOURCE) -$(GENERATED_GLX_INCLUDES): $(GENERATED_GLX_SOURCE) -$(GENERATED_EGL_INCLUDES): $(GENERATED_EGL_SOURCE) -$(GENERATED_WGL_INCLUDES): $(GENERATED_WGL_SOURCE) - -$(GENERATED_GL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/gl.xml - @$(MKDIR_P) $(top_builddir)/include/epoxy - $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \ - --srcdir $(top_builddir)/src \ - --includedir $(top_builddir)/include/epoxy \ - $(top_srcdir)/registry/gl.xml - -$(GENERATED_GLX_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/glx.xml - @$(MKDIR_P) $(top_builddir)/include/epoxy - $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \ - --srcdir $(top_builddir)/src \ - --includedir $(top_builddir)/include/epoxy \ - $(top_srcdir)/registry/glx.xml - -$(GENERATED_EGL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/egl.xml - @$(MKDIR_P) $(top_builddir)/include/epoxy - $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \ - --srcdir $(top_builddir)/src \ - --includedir $(top_builddir)/include/epoxy \ - $(top_srcdir)/registry/egl.xml - -$(GENERATED_WGL_SOURCE): $(srcdir)/gen_dispatch.py $(top_srcdir)/registry/wgl.xml - @$(MKDIR_P) $(top_builddir)/include/epoxy - $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_dispatch.py \ - --srcdir $(top_builddir)/src \ - --includedir $(top_builddir)/include/epoxy \ - $(top_srcdir)/registry/wgl.xml - -EXTRA_DIST = \ - gen_dispatch.py \ - $() diff --git a/test/.gitignore b/test/.gitignore deleted file mode 100644 index 78919f3..0000000 --- a/test/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -egl_and_glx_different_pointers_egl -egl_and_glx_different_pointers_egl_glx -egl_and_glx_different_pointers_glx -egl_has_extension_nocontext -egl_gl -egl_gles1_without_glx -egl_gles2_without_glx -glx_alias_prefer_same_name -glx_beginend -glx_gles2 -glx_glxgetprocaddress_nocontext -glx_has_extension_nocontext -glx_public_api -glx_public_api_core -glx_shared_znow -glx_static -headerguards -khronos_typedefs -miscdefines -wgl_core_and_exts -wgl_usefontbitmaps -wgl_usefontbitmaps_unicode -*.log -*.trs diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index fc3ffcd..0000000 --- a/test/Makefile.am +++ /dev/null @@ -1,192 +0,0 @@ -# Copyright © 2013 Intel Corporation -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -EPOXY = $(builddir)/../src/libepoxy.la - -check_LTLIBRARIES = \ - $(EGL_UTIL_LIB) \ - $(GLX_UTIL_LIB) \ - $(WGL_UTIL_LIB) \ - $() - -libegl_common_la_SOURCES = \ - egl_common.c \ - egl_common.h - $() - -libglx_common_la_SOURCES = \ - glx_common.c \ - glx_common.h - $() - -libwgl_common_la_SOURCES = \ - wgl_common.c \ - wgl_common.h - $() -libwgl_common_la_LIBADD = $(EPOXY) - -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - $(X11_CFLAGS) \ - $(EGL_CFLAGS) \ - $() - -AM_CFLAGS = $(CWARNFLAGS) - -TESTS = \ - $(EGL_TESTS) \ - $(GLX_TESTS) \ - $(EGL_AND_GLX_TESTS) \ - $(WGL_TESTS) \ - gl_version$(EXEEXT) \ - headerguards$(EXEEXT) \ - miscdefines$(EXEEXT) \ - khronos_typedefs$(EXEEXT) \ - $() - -check_BINARIES = $(EGL_AND_GLX_BIN) - -XFAIL_TESTS = \ - $() - -check_PROGRAMS = $(TESTS) - -if BUILD_EGL -EGL_TESTS = \ - $() - -if HAVE_X11 -EGL_TESTS += \ - egl_has_extension_nocontext \ - egl_epoxy_api \ - egl_gles2_without_glx \ - $() - -if HAS_GLES1 -EGL_TESTS += egl_gles1_without_glx -endif - -EGL_UTIL_LIB = libegl_common.la -endif -endif - -if BUILD_GLX -if HAS_ZNOW -GLX_SHARED_ZNOW = glx_shared_znow -endif - -if BUILD_EGL -if BUILD_GLX -if HAVE_DLVSYM -EGL_AND_GLX_TESTS = \ - egl_gl \ - $() -endif -endif -endif - -if HAVE_DLVSYM -GLX_DLVSYM_TESTS = \ - glx_alias_prefer_same_name \ - glx_gles2 \ - $() -endif - -GLX_TESTS = \ - glx_beginend \ - glx_public_api \ - glx_public_api_core \ - glx_glxgetprocaddress_nocontext \ - glx_has_extension_nocontext \ - glx_static \ - $(GLX_SHARED_ZNOW) \ - $(GLX_DLVSYM_TESTS) \ - $() - -GLX_UTIL_LIB = libglx_common.la -endif - -if BUILD_WGL -WGL_TESTS = \ - wgl_core_and_exts$(EXEEXT) \ - wgl_per_context_funcptrs$(EXEEXT) \ - wgl_usefontbitmaps$(EXEEXT) \ - wgl_usefontbitmaps_unicode$(EXEEXT) \ - $() - -WGL_UTIL_LIB = libwgl_common.la -endif - -egl_has_extension_nocontext_LDADD = $(EPOXY) libegl_common.la $(X11_LIBS) - -egl_epoxy_api_LDADD = $(EPOXY) libegl_common.la $(X11_LIBS) - -egl_gl_LDADD = $(EPOXY) $(DLOPEN_LIBS) libegl_common.la $(X11_LIBS) - -egl_gles1_without_glx_CPPFLAGS = $(AM_CPPFLAGS) -DGLES_VERSION=1 -egl_gles1_without_glx_SOURCES = egl_without_glx.c -egl_gles1_without_glx_LDADD = $(EPOXY) $(DLOPEN_LIBS) libegl_common.la $(X11_LIBS) - -egl_gles2_without_glx_CPPFLAGS = $(AM_CPPFLAGS) -DGLES_VERSION=2 -egl_gles2_without_glx_SOURCES = egl_without_glx.c -egl_gles2_without_glx_LDADD = $(EPOXY) $(DLOPEN_LIBS) libegl_common.la $(X11_LIBS) - -glx_alias_prefer_same_name_SOURCES = glx_alias_prefer_same_name.c dlwrap.c dlwrap.h -glx_alias_prefer_same_name_LDFLAGS = -rdynamic -glx_alias_prefer_same_name_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) $(DLOPEN_LIBS) - -glx_beginend_LDADD = $(EPOXY) libglx_common.la $(GL_LIBS) $(X11_LIBS) - -glx_gles2_SOURCES = glx_gles2.c dlwrap.c dlwrap.h -glx_gles2_LDFLAGS = -rdynamic -glx_gles2_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) $(DLOPEN_LIBS) - -glx_public_api_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) - -glx_public_api_core_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) - -glx_glxgetprocaddress_nocontext_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) - -glx_has_extension_nocontext_LDADD = $(EPOXY) libglx_common.la $(X11_LIBS) - -glx_static_CFLAGS = -DNEEDS_TO_BE_STATIC -glx_static_LDADD = $(DLOPEN_LIBS) $(EPOXY) libglx_common.la $(X11_LIBS) -glx_static_LDFLAGS = -static - -glx_shared_znow_SOURCES = glx_static.c -glx_shared_znow_LDADD = $(DLOPEN_LIBS) $(EPOXY) libglx_common.la $(X11_LIBS) -glx_shared_znow_LDFLAGS = -Wl,-z,now - -khronos_typedefs_SOURCES = \ - khronos_typedefs.c \ - khronos_typedefs.h \ - khronos_typedefs_nonepoxy.c \ - $() - -wgl_core_and_exts_LDADD = $(EPOXY) libwgl_common.la -lgdi32 - -wgl_per_context_funcptrs_LDADD = $(EPOXY) libwgl_common.la -lgdi32 - -wgl_usefontbitmaps_LDADD = $(EPOXY) libwgl_common.la -lgdi32 -wgl_usefontbitmaps_unicode_SOURCES = wgl_usefontbitmaps.c -wgl_usefontbitmaps_unicode_LDADD = $(EPOXY) libwgl_common.la -lgdi32 -wgl_usefontbitmaps_unicode_CPPFLAGS = $(AM_CPPFLAGS) -DUNICODE -- cgit v1.2.3 From 5c0dff60907983b0e764006053637febcc3e48ec Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 26 Nov 2019 15:08:23 +0000 Subject: Lower the minimum required version of Meson Makes it easier to build Epoxy on older operating systems. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fe632c5..029798c 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('libepoxy', 'c', version: '1.5.5', 'warning_level=1', ], license: 'MIT', - meson_version: '>= 0.47.0') + meson_version: '>= 0.46.0') epoxy_version = meson.project_version().split('.') epoxy_major_version = epoxy_version[0].to_int() -- cgit v1.2.3 From 01ebe27a8277d9f1acd88462d0643683608ca9e9 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 14 Jan 2020 11:09:45 +0000 Subject: build: Use find_program() Do not rely on the shebang line and the executable bit; we should use find_program(), instead, which lets Meson run a script in the appropriate environment, portably. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 029798c..47d3997 100644 --- a/meson.build +++ b/meson.build @@ -197,7 +197,7 @@ if host_system == 'windows' endif # Generates the dispatch tables -gen_dispatch_py = files('src/gen_dispatch.py') +gen_dispatch_py = find_program('src/gen_dispatch.py') gl_registry = files('registry/gl.xml') egl_registry = files('registry/egl.xml') -- cgit v1.2.3 From 1c650934169a9663f76576d7430da0599e365e3e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 14 Jan 2020 11:17:51 +0000 Subject: ci: Unlink python2 on macOS Otherwise installing Python3 will break horribly. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 52c043e..0fe6610 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ before_install: - | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update + brew unlink python@2 brew install python@3 meson # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219 mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja -- cgit v1.2.3 From 6b09a8bc48bd06314c6716426ea73f38402e6e64 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 2 Jan 2020 21:59:15 +0000 Subject: Use EGL_NO_X11 to disable X11 headers MESA_EGL_NO_X11_HEADERS has been deprecated, and libglvnd only supports EGL_NO_X11. Fixes: #214 --- src/dispatch_common.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dispatch_common.h b/src/dispatch_common.h index a361ccc..a136943 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -47,9 +47,12 @@ #endif #if PLATFORM_HAS_EGL # if !ENABLE_X11 -/* Mesa uses this symbol to avoid including X11 headers when including - * EGL.h; since X11 was explicitly disabled at configuration time, we - * should do the same +/* Disable including X11 headers if the X11 support was disabled at + * configuration time + */ +# define EGL_NO_X11 1 +/* Older versions of Mesa use this symbol to achieve the same result + * as EGL_NO_X11 */ # define MESA_EGL_NO_X11_HEADERS 1 # endif -- cgit v1.2.3 From 81d758d025089d6b3b5309205ff4cb75789e6205 Mon Sep 17 00:00:00 2001 From: crziter Date: Tue, 25 Feb 2020 11:33:56 +0700 Subject: Add call convention to mock function --- test/gl_version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gl_version.c b/test/gl_version.c index 9ab0080..9fe1bba 100644 --- a/test/gl_version.c +++ b/test/gl_version.c @@ -29,7 +29,7 @@ GLenum mock_enum; const char *mock_gl_version; const char *mock_glsl_version; -static const GLubyte *override_glGetString(GLenum name) +static const GLubyte * EPOXY_CALLSPEC override_glGetString(GLenum name) { switch (name) { case GL_VERSION: -- cgit v1.2.3 From 1e0b063dbd8b9f5f0ba950a6b3946f05dff92e97 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 20 Apr 2020 12:58:00 -0700 Subject: Fix return value of shading language for GLES2. Throughout the mesa project we've been using 100 for GLES2's shading language. It was pretty clearly the intent here, but the clever inline detection of "am I parsing a GLSL version or a GL version string" forgot about GLSL 1.0.x, and thus returned 10. --- src/dispatch_common.c | 15 +++++---------- test/gl_version.c | 2 ++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index b3e4f5f..9977a02 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -392,10 +392,10 @@ epoxy_is_desktop_gl(void) } static int -epoxy_internal_gl_version(GLenum version_string, int error_version) +epoxy_internal_gl_version(GLenum version_string, int error_version, int factor) { const char *version = (const char *)glGetString(version_string); - GLint major, minor, factor; + GLint major, minor; int scanf_count; if (!version) @@ -413,11 +413,6 @@ epoxy_internal_gl_version(GLenum version_string, int error_version) abort(); } - if (minor >= 10) - factor = 100; - else - factor = 10; - return factor * major + minor; } @@ -439,7 +434,7 @@ epoxy_internal_gl_version(GLenum version_string, int error_version) int epoxy_gl_version(void) { - return epoxy_internal_gl_version(GL_VERSION, 0); + return epoxy_internal_gl_version(GL_VERSION, 0, 10); } int @@ -448,7 +443,7 @@ epoxy_conservative_gl_version(void) if (api.begin_count) return 100; - return epoxy_internal_gl_version(GL_VERSION, 100); + return epoxy_internal_gl_version(GL_VERSION, 100, 10); } /** @@ -471,7 +466,7 @@ epoxy_glsl_version(void) { if (epoxy_gl_version() >= 20 || epoxy_has_gl_extension ("GL_ARB_shading_language_100")) - return epoxy_internal_gl_version(GL_SHADING_LANGUAGE_VERSION, 0); + return epoxy_internal_gl_version(GL_SHADING_LANGUAGE_VERSION, 0, 100); return 0; } diff --git a/test/gl_version.c b/test/gl_version.c index 9fe1bba..8873ef7 100644 --- a/test/gl_version.c +++ b/test/gl_version.c @@ -80,6 +80,8 @@ main(int argc, char **argv) pass = pass && test_version("3.0 Mesa 13.0.6", 30, "1.30", 130); + pass = pass && test_version("OpenGL ES 2.0 Mesa 20.1.0-devel (git-4bb19a330e)", 20, + "OpenGL ES GLSL ES 1.0.16", 100); pass = pass && test_version("OpenGL ES 3.2 Mesa 18.3.0-devel", 32, "OpenGL ES GLSL ES 3.20", 320); pass = pass && test_version("4.5.0 NVIDIA 384.130", 45, -- cgit v1.2.3 From d9dd5e7fd9aae0adce5aff4a7287107802999fd7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Jul 2020 19:36:19 +0100 Subject: Require Meson >= 0.48 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 47d3997..c5474e0 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('libepoxy', 'c', version: '1.5.5', 'warning_level=1', ], license: 'MIT', - meson_version: '>= 0.46.0') + meson_version: '>= 0.48.0') epoxy_version = meson.project_version().split('.') epoxy_major_version = epoxy_version[0].to_int() -- cgit v1.2.3 From f91fb0a0b6c05ea43070201892372d225e5c8f50 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Jul 2020 19:36:38 +0100 Subject: Use Meson's darwin_versions argument Instead of tweaking the linker flags ourselves. This allows Meson to do the right thing, and pass the arguments only where needed. --- src/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/meson.build b/src/meson.build index 371fd4b..881e087 100644 --- a/src/meson.build +++ b/src/meson.build @@ -53,9 +53,7 @@ if host_system == 'linux' and cc.get_id() == 'gcc' endif # Maintain compatibility with autotools; see: https://github.com/anholt/libepoxy/issues/108 -if host_system == 'darwin' - common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ] -endif +darwin_versions = [1, '1.0'] epoxy_deps = [ dl_dep, ] if host_system == 'windows' @@ -66,6 +64,7 @@ libepoxy = library( 'epoxy', sources: epoxy_sources + epoxy_headers, version: '0.0.0', + darwin_versions: darwin_versions, install: true, dependencies: epoxy_deps, include_directories: libepoxy_inc, -- cgit v1.2.3 From 1a2784a9c5f9ac173917555afddc9a9e31a84883 Mon Sep 17 00:00:00 2001 From: Elias Aebi Date: Tue, 21 Jul 2020 22:07:01 +0200 Subject: GitHub CI --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..edd6c5b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: Build +on: + push: + branches-ignore: + - debian + - khronos-registry +jobs: + build: + strategy: + matrix: + os: + - ubuntu-18.04 + - macos-10.15 + compiler: + - gcc + - clang + build-opts: + - '' + - '-Dglx=no' + - '-Degl=no' + - '-Dx11=false' + exclude: + - os: macos-10.15 + compiler: gcc + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - if: runner.os == 'macOS' + run: brew install ninja + - if: runner.os == 'Linux' + run: > + sudo apt-get update && + sudo apt-get install --no-install-recommends + libgl1-mesa-dev + libegl1-mesa-dev + libgles2-mesa-dev + libgl1-mesa-dri + ninja-build + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - run: | + python -m pip install --upgrade pip + pip3 install meson + - if: runner.os == 'macOS' + run: /bin/sh -c "CC=${{ matrix.compiler }} .travis/epoxy-ci-osx.sh ${{ matrix.build-opts }}" + - if: runner.os == 'Linux' + run: /bin/sh -c "CC=${{ matrix.compiler }} .travis/epoxy-ci-linux.sh ${{ matrix.build-opts }}" -- cgit v1.2.3 From ef4dbfa7403b0086581d8317aae4c959ff5b825f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 22 Dec 2020 14:49:08 +0000 Subject: Post-release version bump to 1.5.6 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c5474e0..f42791c 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.5', +project('libepoxy', 'c', version: '1.5.6', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', -- cgit v1.2.3 From 4822fc167df90eed5d69a2456045ce16dad81f92 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 13:07:19 +0000 Subject: ci: Add MSYS2 workflow on GitHub Actions --- .github/workflows/msys2.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/msys2.yml diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 0000000..3286e71 --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,28 @@ +name: MSYS2 Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + env: + PYTHONIOENCODING: "utf-8" + steps: + - uses: actions/checkout@master + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: base-devel git mingw-w64-x86_64-meson mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-toolchain + - name: Build + run: | + meson setup _build + meson compile -C _build + meson test -C _build -- cgit v1.2.3 From c4520d0a7238cdf6ff2b49a37f28b446a5550024 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 13:08:10 +0000 Subject: ci: Add MSVC workflow on GitHub Actions --- .github/workflows/msvc-env.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/msvc-env.yml diff --git a/.github/workflows/msvc-env.yml b/.github/workflows/msvc-env.yml new file mode 100644 index 0000000..a4e69c8 --- /dev/null +++ b/.github/workflows/msvc-env.yml @@ -0,0 +1,23 @@ +name: MSVC Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + env: + PYTHONIOENCODING: "utf-8" + steps: + - uses: actions/checkout@master + - uses: actions/setup-python@v1 + - uses: seanmiddleditch/gha-setup-vsdevenv@master + - uses: BSFishy/meson-build@v1.0.1 + with: + action: test + directory: _build + options: --verbose --fatal-meson-warnings + meson-version: 0.54.3 -- cgit v1.2.3 From 14ab6c6bb8532e3b2c5c248fe77ac61b0b0e5ecd Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 13:11:20 +0000 Subject: ci: Use scripts for GitHub Actions Do not share them with the Travis pipelines. --- .github/scripts/epoxy-ci-linux.sh | 32 ++++++++++++++++++++++++++++++++ .github/scripts/epoxy-ci-osx.sh | 27 +++++++++++++++++++++++++++ .github/workflows/ci.yml | 4 ++-- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100755 .github/scripts/epoxy-ci-linux.sh create mode 100755 .github/scripts/epoxy-ci-osx.sh diff --git a/.github/scripts/epoxy-ci-linux.sh b/.github/scripts/epoxy-ci-linux.sh new file mode 100755 index 0000000..e95584f --- /dev/null +++ b/.github/scripts/epoxy-ci-linux.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +dump_log_and_quit() { + local exitcode=$1 + + cat meson-logs/testlog.txt + + exit $exitcode +} + +# Start Xvfb +XVFB_WHD=${XVFB_WHD:-1280x720x16} + +Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp & +xvfb=$! + +export DISPLAY=:99 + +srcdir=$( pwd ) +builddir=$( mktemp -d build_XXXXXX ) + +meson --prefix /usr "$@" $builddir $srcdir || exit $? + +cd $builddir + +ninja || exit $? +meson test || dump_log_and_quit $? + +cd .. + +# Stop Xvfb +kill -9 ${xvfb} diff --git a/.github/scripts/epoxy-ci-osx.sh b/.github/scripts/epoxy-ci-osx.sh new file mode 100755 index 0000000..1a062a1 --- /dev/null +++ b/.github/scripts/epoxy-ci-osx.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +dump_log_and_quit() { + local exitcode=$1 + + cat meson-logs/testlog.txt + + exit $exitcode +} + +export SDKROOT=$( xcodebuild -version -sdk macosx Path ) +export CPPFLAGS=-I/usr/local/include +export LDFLAGS=-L/usr/local/lib +export OBJC=$CC +export PATH=$HOME/tools:$PATH + +srcdir=$( pwd ) +builddir=$( mktemp -d build_XXXXXX ) + +meson ${BUILDOPTS} $builddir $srcdir || exit $? + +cd $builddir + +ninja || exit $? +meson test || dump_log_and_quit $? + +cd .. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edd6c5b..4086757 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,6 @@ jobs: python -m pip install --upgrade pip pip3 install meson - if: runner.os == 'macOS' - run: /bin/sh -c "CC=${{ matrix.compiler }} .travis/epoxy-ci-osx.sh ${{ matrix.build-opts }}" + run: /bin/sh -c "CC=${{ matrix.compiler }} .github/scripts/epoxy-ci-osx.sh ${{ matrix.build-opts }}" - if: runner.os == 'Linux' - run: /bin/sh -c "CC=${{ matrix.compiler }} .travis/epoxy-ci-linux.sh ${{ matrix.build-opts }}" + run: /bin/sh -c "CC=${{ matrix.compiler }} .github/scripts/epoxy-ci-linux.sh ${{ matrix.build-opts }}" -- cgit v1.2.3 From 599847dfd6dab1c68d0dadc9729fc64126aaad1a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 13:17:06 +0000 Subject: ci: Remove Travis The GitHub Actions pipeline replaces Travis in any way it matters. --- .travis.yml | 55 ----------------------------------------------- .travis/Dockerfile | 29 ------------------------- .travis/epoxy-ci-linux.sh | 32 --------------------------- .travis/epoxy-ci-osx.sh | 27 ----------------------- .travis/run-docker.sh | 12 ----------- 5 files changed, 155 deletions(-) delete mode 100644 .travis.yml delete mode 100644 .travis/Dockerfile delete mode 100755 .travis/epoxy-ci-linux.sh delete mode 100755 .travis/epoxy-ci-osx.sh delete mode 100755 .travis/run-docker.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0fe6610..0000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false - -branches: - except: - - debian - - khronos-registry - -os: - - linux - - osx - -compiler: - - gcc - - clang - -language: - - c - -services: - - docker - -matrix: - exclude: - - os: osx - compiler: gcc - -before_install: - - | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew update - brew unlink python@2 - brew install python@3 meson - # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219 - mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja - fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull ebassi/epoxyci ; fi - -before_script: - - | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - echo FROM ebassi/epoxyci > Dockerfile - echo ADD . /root >> Dockerfile - echo WORKDIR /root >> Dockerfile - docker build -t withgit . - fi - -env: - - BUILD_OPTS="" - - BUILD_OPTS="-Dglx=no" - - BUILD_OPTS="-Degl=no" - - BUILD_OPTS="-Dx11=false" - -script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "CC=$CC .travis/epoxy-ci-linux.sh $BUILD_OPTS" ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /bin/sh -c "CC=$CC .travis/epoxy-ci-osx.sh $BUILD_OPTS" ; fi diff --git a/.travis/Dockerfile b/.travis/Dockerfile deleted file mode 100644 index bd9b40a..0000000 --- a/.travis/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM debian:stretch-slim -MAINTAINER Emmanuele Bassi - -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -qq -y \ - ca-certificates \ - clang \ - gcc \ - libgl1-mesa-dev \ - libegl1-mesa-dev \ - libgles1-mesa-dev \ - libgles2-mesa-dev \ - libgl1-mesa-dri \ - locales \ - ninja-build \ - pkg-config \ - python3 \ - python3-pip \ - python3-setuptools \ - python3-wheel \ - xvfb && \ - rm -rf /usr/share/doc/* /usr/share/man/* - -RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8 -ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 - -RUN pip3 install meson - -WORKDIR /root diff --git a/.travis/epoxy-ci-linux.sh b/.travis/epoxy-ci-linux.sh deleted file mode 100755 index e95584f..0000000 --- a/.travis/epoxy-ci-linux.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -dump_log_and_quit() { - local exitcode=$1 - - cat meson-logs/testlog.txt - - exit $exitcode -} - -# Start Xvfb -XVFB_WHD=${XVFB_WHD:-1280x720x16} - -Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp & -xvfb=$! - -export DISPLAY=:99 - -srcdir=$( pwd ) -builddir=$( mktemp -d build_XXXXXX ) - -meson --prefix /usr "$@" $builddir $srcdir || exit $? - -cd $builddir - -ninja || exit $? -meson test || dump_log_and_quit $? - -cd .. - -# Stop Xvfb -kill -9 ${xvfb} diff --git a/.travis/epoxy-ci-osx.sh b/.travis/epoxy-ci-osx.sh deleted file mode 100755 index 1a062a1..0000000 --- a/.travis/epoxy-ci-osx.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -dump_log_and_quit() { - local exitcode=$1 - - cat meson-logs/testlog.txt - - exit $exitcode -} - -export SDKROOT=$( xcodebuild -version -sdk macosx Path ) -export CPPFLAGS=-I/usr/local/include -export LDFLAGS=-L/usr/local/lib -export OBJC=$CC -export PATH=$HOME/tools:$PATH - -srcdir=$( pwd ) -builddir=$( mktemp -d build_XXXXXX ) - -meson ${BUILDOPTS} $builddir $srcdir || exit $? - -cd $builddir - -ninja || exit $? -meson test || dump_log_and_quit $? - -cd .. diff --git a/.travis/run-docker.sh b/.travis/run-docker.sh deleted file mode 100755 index 4b3ecc7..0000000 --- a/.travis/run-docker.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -xe - -srcdir="$(pwd)/.." - -sudo docker build \ - --tag "epoxyci" \ - --file "Dockerfile" . -sudo docker run --rm \ - --volume "${srcdir}:/root/epoxy" \ - --tty --interactive "epoxyci" bash -- cgit v1.2.3 From 3e35bb868833a1f54deef6819eb457db9f551081 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 13:17:44 +0000 Subject: ci: Remove AppVeyor pipeline We have MSYS2 and MSVC pipelines on GitHub Actions. --- .appveyor.yml | 67 ----------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 8e0cae2..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: 1.0.{build} - -image: Visual Studio 2015 - -configuration: Release - -# Configure both 32-bit and 64-bit builds -environment: - matrix: - - platform: x86 - config: Win32 - pout: x86 - - platform: x64 - config: x64 - pout: x64 - -shallow_clone: true - -# Download Meson and Ninja, create install directory -before_build: -- mkdir build -- mkdir libepoxy-shared-%pout% -- cd build -- curl -LsSO https://github.com/mesonbuild/meson/releases/download/0.47.1/meson-0.47.1.tar.gz -- 7z x meson-0.47.1.tar.gz -- move dist\meson-0.47.1.tar . -- 7z x meson-0.47.1.tar -- rmdir dist -- del meson-0.47.1.tar meson-0.47.1.tar.gz -- curl -LsSO https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip -- 7z x ninja-win.zip -- del ninja-win.zip -- cd .. - -# Build and install -build_script: -- cd build -- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% -- C:\Python36\python.exe meson-0.47.1\meson.py .. . --backend=ninja --prefix=%APPVEYOR_BUILD_FOLDER%\libepoxy-shared-%pout% -- ninja -- ninja install -- cd .. - -# Copy license into install directory and create .zip file -after_build: -- copy COPYING libepoxy-shared-%pout% -- dir libepoxy-shared-%pout% /s /b -- 7z a -tzip libepoxy-shared-%pout%.zip libepoxy-shared-%pout% - -artifacts: - - path: libepoxy-shared-%pout%.zip - name: libepoxy-shared-%pout% - -test: off - -# Upload .zip file to GitHub release -deploy: - release: $(APPVEYOR_REPO_TAG_NAME) - description: "Epoxy $(APPVEYOR_REPO_TAG_NAME)" - provider: GitHub - auth_token: - secure: X7Ro8Y2RWYo/M1AAn93f9X0dEQFvu7gPb6li2eKRtzPYLGj/JKm7MNWRw2cCcjm6 - artifact: libepoxy-shared-$(pout) - draft: false - prerelease: false - on: - appveyor_repo_tag: true # deploy on tag push only -- cgit v1.2.3 From 4c686ff5e34552db0a121adf3054b33b6f708aae Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 14:06:12 +0000 Subject: ci: Drop tests from MSYS2 pipeline The WGL tests are failing, likely because of some set up issue; for the time being, we care more about building Epoxy, rather than testing it. --- .github/workflows/msys2.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml index 3286e71..0f90a2b 100644 --- a/.github/workflows/msys2.yml +++ b/.github/workflows/msys2.yml @@ -25,4 +25,3 @@ jobs: run: | meson setup _build meson compile -C _build - meson test -C _build -- cgit v1.2.3 From 642330e86fa6c763d92e4118749df2ddb61cd5cc Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 19:42:27 +0000 Subject: ci: Split Linux and macOS pipelines Don't use a single pipeline for everything. --- .github/workflows/ci.yml | 48 --------------------------------------------- .github/workflows/linux.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/macos.yml | 26 ++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4086757..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build -on: - push: - branches-ignore: - - debian - - khronos-registry -jobs: - build: - strategy: - matrix: - os: - - ubuntu-18.04 - - macos-10.15 - compiler: - - gcc - - clang - build-opts: - - '' - - '-Dglx=no' - - '-Degl=no' - - '-Dx11=false' - exclude: - - os: macos-10.15 - compiler: gcc - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - if: runner.os == 'macOS' - run: brew install ninja - - if: runner.os == 'Linux' - run: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libgl1-mesa-dev - libegl1-mesa-dev - libgles2-mesa-dev - libgl1-mesa-dri - ninja-build - - uses: actions/setup-python@v2 - with: - python-version: 3.x - - run: | - python -m pip install --upgrade pip - pip3 install meson - - if: runner.os == 'macOS' - run: /bin/sh -c "CC=${{ matrix.compiler }} .github/scripts/epoxy-ci-osx.sh ${{ matrix.build-opts }}" - - if: runner.os == 'Linux' - run: /bin/sh -c "CC=${{ matrix.compiler }} .github/scripts/epoxy-ci-linux.sh ${{ matrix.build-opts }}" diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..3d71e7f --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,38 @@ +name: Ubuntu +on: + push: + branches-ignore: + - debian + - khronos-registry +jobs: + build: + strategy: + matrix: + os: + - ubuntu-18.04 + compiler: + - gcc + - clang + build-opts: + - '' + - '-Dglx=no' + - '-Degl=no' + - '-Dx11=false' + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - run: > + sudo apt-get update && + sudo apt-get install --no-install-recommends + libgl1-mesa-dev + libegl1-mesa-dev + libgles2-mesa-dev + libgl1-mesa-dri + ninja-build + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - run: | + python -m pip install --upgrade pip + pip3 install meson + /bin/sh -c "CC=${{ matrix.compiler }} .github/scripts/epoxy-ci-linux.sh ${{ matrix.build-opts }}" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..c725ef1 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,26 @@ +name: macOS +on: + push: + branches-ignore: + - debian + - khronos-registry +jobs: + build: + strategy: + matrix: + build-opts: + - '' + - '-Dglx=no' + - '-Degl=no' + - '-Dx11=false' + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - run: | + brew install ninja + python -m pip install --upgrade pip + pip3 install meson + /bin/sh -c "CC=clang .github/scripts/epoxy-ci-osx.sh ${{ matrix.build-opts }}" -- cgit v1.2.3 From c37b42432be45f2484be975890e446029b29b5b9 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 19:47:42 +0000 Subject: Update the CI status badges Use the badges from GitHub Actions. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 56b6a65..b64d355 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -[![Build Status](https://travis-ci.org/anholt/libepoxy.svg?branch=master)](https://travis-ci.org/anholt/libepoxy) -[![Build status](https://ci.appveyor.com/api/projects/status/xv6y5jurt5v5ngjx/branch/master?svg=true)](https://ci.appveyor.com/project/ebassi/libepoxy/branch/master) +![Ubuntu](https://github.com/anholt/libepoxy/workflows/Ubuntu/badge.svg) +![macOS](https://github.com/anholt/libepoxy/workflows/macOS/badge.svg) +![MSVC Build](https://github.com/anholt/libepoxy/workflows/MSVC%20Build/badge.svg) +![MSYS2 Build](https://github.com/anholt/libepoxy/workflows/MSYS2%20Build/badge.svg) Epoxy is a library for handling OpenGL function pointer management for you. -- cgit v1.2.3 From 1878042c03643f0107f977bdd400de1448a45a02 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 23 Dec 2020 19:48:37 +0000 Subject: Add a badge for the project license --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b64d355..9d83ed9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![macOS](https://github.com/anholt/libepoxy/workflows/macOS/badge.svg) ![MSVC Build](https://github.com/anholt/libepoxy/workflows/MSVC%20Build/badge.svg) ![MSYS2 Build](https://github.com/anholt/libepoxy/workflows/MSYS2%20Build/badge.svg) +[![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) Epoxy is a library for handling OpenGL function pointer management for you. -- cgit v1.2.3 From dbfa4b209c0712b67dfeb8366c2ebe8503063b52 Mon Sep 17 00:00:00 2001 From: Yaroslav Isakov Date: Wed, 29 Jul 2020 16:40:01 +0200 Subject: If glvnd library found, do not use libGL.so in epoxy_load_gl Without additional check, even if libOpenGL was loaded, libGL.so will be loaded as well, and used both in gl_handle and glx_handle, so libglvnd libraries will not be used. Reviewed-by: Adam Jackson Signed-off-by: Emmanuele Bassi --- src/dispatch_common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 9977a02..cfc9dcc 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -674,9 +674,12 @@ epoxy_load_gl(void) if (!api.gl_handle) get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); #endif - - get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true); - api.gl_handle = api.glx_handle; + if (!api.gl_handle) { + get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); +#if PLATFORM_HAS_GLX + api.glx_handle = api.gl_handle; +#endif + } #endif } -- cgit v1.2.3 From 4994c48172e94ca81c000597e0abc0ea0e682b3c Mon Sep 17 00:00:00 2001 From: Yaroslav Isakov Date: Wed, 29 Jul 2020 22:29:50 +0200 Subject: Do not overwrite glx_handle in epoxy_load_gl if GLX library is loaded already Reviewed-by: Adam Jackson Signed-off-by: Emmanuele Bassi --- src/dispatch_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index cfc9dcc..62b7134 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -677,7 +677,8 @@ epoxy_load_gl(void) if (!api.gl_handle) { get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); #if PLATFORM_HAS_GLX - api.glx_handle = api.gl_handle; + if (!api.glx_handle) + api.glx_handle = api.gl_handle; #endif } #endif -- cgit v1.2.3 From 950b9f5b25843d95c4667ef60038e8d7b476fbb8 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 14 Oct 2020 17:21:50 -0400 Subject: meson: Set same variables in declare_dependency() as in pkgconfig GTK currently fails to detect if epoxy has been built with EGL on Windows when epoxy is a subproject. To fix that it needs to get that information from the dependency variables. This requires Meson >=0.54.0 for setting variables in declare_dependency(). --- meson.build | 2 +- src/meson.build | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index f42791c..ca37e80 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('libepoxy', 'c', version: '1.5.6', 'warning_level=1', ], license: 'MIT', - meson_version: '>= 0.48.0') + meson_version: '>= 0.54.0') epoxy_version = meson.project_version().split('.') epoxy_major_version = epoxy_version[0].to_int() diff --git a/src/meson.build b/src/meson.build index 881e087..37e28f0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -72,17 +72,22 @@ libepoxy = library( link_args: common_ldflags, ) +epoxy_has_glx = build_glx ? '1' : '0' +epoxy_has_egl = build_egl ? '1' : '0' +epoxy_has_wgl = build_wgl ? '1' : '0' + libepoxy_dep = declare_dependency( link_with: libepoxy, include_directories: libepoxy_inc, dependencies: epoxy_deps, sources: epoxy_headers, + variables: { + 'epoxy_has_glx': epoxy_has_glx, + 'epoxy_has_egl': epoxy_has_egl, + 'epoxy_has_wgl': epoxy_has_wgl, + }, ) -epoxy_has_glx = build_glx ? '1' : '0' -epoxy_has_egl = build_egl ? '1' : '0' -epoxy_has_wgl = build_wgl ? '1' : '0' - # We don't want to add these dependencies to the library, as they are # not needed when building Epoxy; we do want to add them to the generated # pkg-config file, for consumers of Epoxy -- cgit v1.2.3 From d0b319e27b874a13f6b41f4759c272b08d74cb8a Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Sat, 6 Mar 2021 09:11:44 +0600 Subject: gen_dispatch.py: close output files Fixes https://github.com/anholt/libepoxy/issues/242 --- src/gen_dispatch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index d33f128..faa55da 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -467,6 +467,7 @@ class Generator(object): func.args_decl)) def write_header_header(self, out_file): + self.close() self.out_file = open(out_file, 'w') self.outln('/* GL dispatch header.') @@ -757,6 +758,7 @@ class Generator(object): self.outln('') def write_source(self, f): + self.close() self.out_file = open(f, 'w') self.outln('/* GL dispatch code.') @@ -849,6 +851,12 @@ class Generator(object): for func in self.sorted_functions: self.write_function_pointer(func) + def close(self): + if self.out_file: + self.out_file.close() + self.out_file = None + + argparser = argparse.ArgumentParser(description='Generate GL dispatch wrappers.') argparser.add_argument('files', metavar='file.xml', nargs='+', help='GL API XML files to be parsed') argparser.add_argument('--outputdir', metavar='dir', required=False, help='Destination directory for files (default to current dir)') @@ -913,3 +921,5 @@ for f in args.files: generator.write_header(os.path.join(includedir, name + '_generated.h')) if build_source: generator.write_source(os.path.join(srcdir, name + '_generated_dispatch.c')) + + generator.close() -- cgit v1.2.3 From 144cbc9325250081f2eb584ca5deb13aaf1c2433 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 21 Mar 2021 19:02:58 +0000 Subject: Support Win64 pointer-sized types Since we're generating stub types from khrplatform.h because we can't include it reliably, we'll have to deal with some of the fallout of the Win64 types. Fixes: #246 --- src/gen_dispatch.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index d33f128..5115bf0 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -515,9 +515,17 @@ class Generator(object): self.outln('typedef uint32_t khronos_uint32_t;') self.outln('typedef uint64_t khronos_uint64_t;') self.outln('typedef float khronos_float_t;') - self.outln('typedef long khronos_intptr_t;') - self.outln('typedef long khronos_ssize_t;') - self.outln('typedef unsigned long khronos_usize_t;') + self.outln('#ifdef _WIN64') + self.outln('typedef signed long long int khronos_intptr_t;') + self.outln('typedef unsigned long long int khronos_uintptr_t;') + self.outln('typedef signed long long int khronos_ssize_t;') + self.outln('typedef unsigned long long int khronos_usize_t;') + self.outln('#else') + self.outln('typedef signed long int khronos_intptr_t;') + self.outln('typedef unsigned long int khronos_uintptr_t;') + self.outln('typedef signed long int khronos_ssize_t;') + self.outln('typedef unsigned long int khronos_usize_t;') + self.outln('#endif') self.outln('typedef uint64_t khronos_utime_nanoseconds_t;') self.outln('typedef int64_t khronos_stime_nanoseconds_t;') self.outln('#define KHRONOS_MAX_ENUM 0x7FFFFFFF') -- cgit v1.2.3 From e271edbc3be0cbdee6cbac69bbb9c6bf7eecaad3 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 30 Apr 2021 10:45:15 +0100 Subject: Post-release version bump to 1.5.7 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ca37e80..bb283ed 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.6', +project('libepoxy', 'c', version: '1.5.7', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', -- cgit v1.2.3 From 1403303e77ce0c5a4d4c52d6a3b2a820f47241ee Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 30 Apr 2021 12:15:25 +0100 Subject: Remove redeclaration of khronos_uintptr_t The type is being redeclared because I didn't see the original declaration when I wrote 144cbc9325250081f2eb584ca5deb13aaf1c2433. Fixes: #249 --- src/gen_dispatch.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index b686824..3daad84 100755 --- a/src/gen_dispatch.py +++ b/src/gen_dispatch.py @@ -535,7 +535,6 @@ class Generator(object): self.outln(' KHRONOS_TRUE = 1,') self.outln(' KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM') self.outln('} khronos_boolean_enum_t;') - self.outln('typedef uintptr_t khronos_uintptr_t;') if self.target == "glx": self.outln('#include ') -- cgit v1.2.3 From 0dd0e0a27290a110979fd47a2c517caa7fec4a0f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 30 Apr 2021 13:17:59 +0100 Subject: Post-release version bump to 1.5.8 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bb283ed..e7642e5 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.7', +project('libepoxy', 'c', version: '1.5.8', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', -- cgit v1.2.3 From c2148eb0192305a6900ebf475674ec7a9f2b9b31 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 21 May 2021 15:35:35 +0100 Subject: Revert "Do not overwrite glx_handle in epoxy_load_gl if GLX library is loaded already" This reverts commit 4994c48172e94ca81c000597e0abc0ea0e682b3c. --- src/dispatch_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 62b7134..cfc9dcc 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -677,8 +677,7 @@ epoxy_load_gl(void) if (!api.gl_handle) { get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); #if PLATFORM_HAS_GLX - if (!api.glx_handle) - api.glx_handle = api.gl_handle; + api.glx_handle = api.gl_handle; #endif } #endif -- cgit v1.2.3 From 622ca393c38a92e2fac9f877bbcf65f97782d206 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 21 May 2021 15:35:41 +0100 Subject: Revert "If glvnd library found, do not use libGL.so in epoxy_load_gl" Commit dbfa4b20 has introduced a string of regressions in the X server and KWin. This reverts commit dbfa4b209c0712b67dfeb8366c2ebe8503063b52. See: #252 --- src/dispatch_common.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index cfc9dcc..9977a02 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -674,12 +674,9 @@ epoxy_load_gl(void) if (!api.gl_handle) get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); #endif - if (!api.gl_handle) { - get_dlopen_handle(&api.gl_handle, GLX_LIB, true, true); -#if PLATFORM_HAS_GLX - api.glx_handle = api.gl_handle; -#endif - } + + get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true); + api.gl_handle = api.glx_handle; #endif } -- cgit v1.2.3 From ad723a7a75ee387bcc07430090677c58882763ff Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 21 May 2021 16:56:51 +0100 Subject: Post-release version bump to 1.5.9 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e7642e5..93b9c1a 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.8', +project('libepoxy', 'c', version: '1.5.9', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', -- cgit v1.2.3 From 7975061f6b47217df8309536f5dad697cadd5251 Mon Sep 17 00:00:00 2001 From: John Bates Date: Thu, 17 Jun 2021 11:02:56 -0700 Subject: Allow libopengl.so to be used when GLX_LIB is missing This maintains compatibility with previous behavior of always using GLX_LIB if it is found. The only change is when there is no GLX_LIB. Previous behavior when no GLX_LIB: - abort. New behavior when no GLX_LIB: - Try to load libOpenGL.so as gl_handle (glx_handle remains NULL). - Else, abort. Reviewed-by: Emil Velikov --- src/dispatch_common.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 9977a02..592df38 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -670,13 +670,23 @@ epoxy_load_gl(void) get_dlopen_handle(&api.gl_handle, OPENGL_LIB, true, true); #else + // Prefer GLX_LIB over OPENGL_LIB to maintain existing behavior. + // Using the inverse ordering OPENGL_LIB -> GLX_LIB, causes issues such as: + // https://github.com/anholt/libepoxy/issues/240 (apitrace missing calls) + // https://github.com/anholt/libepoxy/issues/252 (Xorg boot crash) + get_dlopen_handle(&api.glx_handle, GLX_LIB, false, true); + api.gl_handle = api.glx_handle; + #if defined(OPENGL_LIB) if (!api.gl_handle) - get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); + get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false, true); #endif - get_dlopen_handle(&api.glx_handle, GLX_LIB, true, true); - api.gl_handle = api.glx_handle; + if (!api.gl_handle) { + fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB); + abort(); + } + #endif } -- cgit v1.2.3 From 71dcab0cc9accb322771fa8587241ee63fb76dd0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 14 Aug 2021 14:56:42 +0100 Subject: Post-release version bump to 1.5.10 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 93b9c1a..e0228d1 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('libepoxy', 'c', version: '1.5.9', +project('libepoxy', 'c', version: '1.5.10', default_options: [ 'buildtype=debugoptimized', 'c_std=gnu99', -- cgit v1.2.3 From a07b9b33832df2261ace6b84e6a041d14e390a75 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 12 Oct 2021 02:41:41 +0900 Subject: meson: Fix for building on non-English locale Specify utf-8 encoding to fix building on non-English locale --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index e0228d1..182a3c9 100644 --- a/meson.build +++ b/meson.build @@ -95,6 +95,7 @@ if cc.get_id() == 'msvc' '-we4053', # an expression of type void was used as an operand '-we4071', # no function prototype given '-we4819', # the file contains a character that cannot be represented in the current code page + '/utf-8', # Set the input and exec encoding to utf-8, like is the default with GCC ] elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' test_cflags = [ -- cgit v1.2.3 From 063c1df27974f58b0f3c0a57417732da068923cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 20 Oct 2021 10:59:09 +0100 Subject: fix error: use of undeclared identifier 'OPENGL_LIB' at epoxy/src/dispatch_common.c:690 in LibreOffice android build with libepoxy-1.5.9 --- src/dispatch_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 592df38..153eb7c 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -683,7 +683,11 @@ epoxy_load_gl(void) #endif if (!api.gl_handle) { +#if defined(OPENGL_LIB) fprintf(stderr, "Couldn't open %s or %s\n", GLX_LIB, OPENGL_LIB); +#else + fprintf(stderr, "Couldn't open %s\n", GLX_LIB); +#endif abort(); } -- cgit v1.2.3 From 9bf47884554b4f7e93c7c8fe4f51058a2efbb846 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 6 Oct 2021 09:44:12 +0100 Subject: Add the right include paths for EGL and X11 headers Libepoxy currently depends on all headers living under the same prefix. This is not necessarily true: X11 headers can live in a separate prefix, for instance under /opt/X11. This is also the case when cross-compiling to a platform that sets up the build environment in non-standard ways. We could add `x11_dep` and `egl_dep` to the libepoxy target dependencies, but that could potentially add spurious linker flags and cause libepoxy to depend on libraries it will dlopen() during normal operations. To avoid that case, we use a partial_dep() object from Meson, and we limit the dependency to compiler flags and inclusion paths. --- meson.build | 2 ++ src/meson.build | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/meson.build b/meson.build index e0228d1..f3ae23f 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,11 @@ endif dl_dep = cc.find_library('dl', required: false) gl_dep = dependency('gl', required: false) egl_dep = dependency('egl', required: false) +elg_headers_dep = egl_dep.partial_dependency(compile_args: true, includes: true) # Optional dependencies for tests x11_dep = dependency('x11', required: false) +x11_headers_dep = x11_dep.partial_dependency(compile_args: true, includes: true) # GLES v2 and v1 may have pkg-config files, courtesy of downstream # packagers; let's check those first, and fall back to find_library() diff --git a/src/meson.build b/src/meson.build index 37e28f0..e19a918 100644 --- a/src/meson.build +++ b/src/meson.build @@ -59,6 +59,12 @@ epoxy_deps = [ dl_dep, ] if host_system == 'windows' epoxy_deps += [ opengl32_dep, gdi32_dep ] endif +if enable_x11 + epoxy_deps += [ x11_headers_dep, ] +endif +if build_egl + epoxy_deps += [ elg_headers_dep, ] +endif libepoxy = library( 'epoxy', -- cgit v1.2.3