aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-11-21 09:37:30 +0100
committerDavid Robillard <d@drobilla.net>2019-11-21 09:37:30 +0100
commitce90f7ccfbbf4a8a272eb1426bf8f9a0958a412d (patch)
treeb63d5d6fee9eeab1ec5ef9e486b88ce997846d6e /wscript
parent92288da76e879149179292f90dd2760f587c9132 (diff)
downloadpugl-ce90f7ccfbbf4a8a272eb1426bf8f9a0958a412d.tar.gz
pugl-ce90f7ccfbbf4a8a272eb1426bf8f9a0958a412d.tar.bz2
pugl-ce90f7ccfbbf4a8a272eb1426bf8f9a0958a412d.zip
Check explicitly for GLX and only link against the necessary library
It turns out that on some systems GLX is implemented in libGLX (which brings in only libGLdispatch), while on others it is implemented in libGL.
Diffstat (limited to 'wscript')
-rw-r--r--wscript12
1 files changed, 10 insertions, 2 deletions
diff --git a/wscript b/wscript
index a1a317f..0bc939c 100644
--- a/wscript
+++ b/wscript
@@ -84,7 +84,14 @@ def configure(conf):
if not Options.options.no_gl:
conf.check_cc(lib='GLX', uselib_store='GLX', mandatory=False)
conf.check_cc(lib='GL', uselib_store='GL', mandatory=False)
- conf.env.HAVE_GL = conf.env.LIB_GLX and conf.env.LIB_GL
+ conf.check_cc(
+ fragment="""#include <GL/glx.h>
+ int main(void) { glXSwapBuffers(0, 0); return 0; }""",
+ lib='GLX' if conf.env.LIB_GLX else 'GL',
+ mandatory=False,
+ msg='Checking for GLX')
+ conf.env.HAVE_GL = conf.env.LIB_GL or conf.env.LIB_GLX
+
# Check for Cairo via pkg-config
if not Options.options.no_cairo:
@@ -239,8 +246,9 @@ def build(bld):
source=lib_source + ['pugl/detail/x11.c'])
if bld.env.HAVE_GL:
+ glx_lib = 'GLX' if bld.env.LIB_GLX else 'GL'
build_backend('x11', 'gl',
- uselib=['GLX', 'X11'],
+ uselib=[glx_lib, 'X11'],
source=['pugl/detail/x11_gl.c'])
if bld.env.HAVE_CAIRO: