More GL build fixes.
[dcpomatic.git] / src / wx / wscript
index 8430b58441708ceae68dbc4c249dfb5d7901ad5c..323a19a2b4afb2c297e19fc84e60dedc87e4fa56 100644 (file)
@@ -180,6 +180,9 @@ def configure(conf):
                            uselib_store='WXWIDGETS',
                            mandatory=True)
 
+    if conf.env.TARGET_LINUX:
+        conf.env.append_value('CXXFLAGS', ['-DGLX_GLXEXT_PROTOTYPES'])
+
     if conf.options.static_wxwidgets:
        # wx-config returns its static libraries as full paths, without -l prefixes, which confuses
         # check_cfg().  It puts the static libraries into LINKFLAGS_WXWIDGETS, so fish them out.
@@ -254,6 +257,22 @@ def configure(conf):
         conf.env.STLIB_GL = 'gl'
         conf.env.STLIB_GLU = 'glu'
 
+    if conf.env.TARGET_LINUX:
+        conf.check_cxx(fragment="""
+                                #include <wx/glcanvas.h>
+                                #include <GL/glu.h>
+                                #include <GL/glext.h>
+                                #include <GL/glxext.h>
+                                int main() {
+                                    glXSwapIntervalEXT (0, 0, 1);
+                                    return 0;
+                                }
+                                """,
+                       msg='Checking for glXSwapIntervalEXT',
+                       okmsg='yes',
+                       uselib='GL WXWIDGETS',
+                       define_name='DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT',
+                       mandatory=False)
 
 
 def build(bld):