Hide macOS OpenGL deprecation.
[dcpomatic.git] / wscript
diff --git a/wscript b/wscript
index f958b49fa003912255e95b6d9f35d4d55a615ccf..ad1e137f22d24f23bc59f621b8615089dfa33ba6 100644 (file)
--- a/wscript
+++ b/wscript
@@ -72,7 +72,6 @@ def options(opt):
     opt.add_option('--static-curl',       action='store_true', default=False, help='link statically to libcurl')
     opt.add_option('--workaround-gssapi', action='store_true', default=False, help='link to gssapi_krb5')
     opt.add_option('--force-cpp11',       action='store_true', default=False, help='force use of C++11')
-    opt.add_option('--variant',           help='build variant (swaroop-studio, swaroop-theater)', choices=['swaroop-studio', 'swaroop-theater'])
     opt.add_option('--use-lld',           action='store_true', default=False, help='use lld linker')
     opt.add_option('--enable-disk',       action='store_true', default=False, help='build dcpomatic2_disk tool; requires Boost process, lwext4 and nanomsg libraries')
     opt.add_option('--warnings-are-errors', action='store_true', default=False, help='build with -Werror')
@@ -122,12 +121,9 @@ def configure(conf):
         if int(gcc[0]) >= 8:
             # I tried and failed to ignore these with _Pragma
             conf.env.append_value('CXXFLAGS', ['-Wno-cast-function-type'])
-        elif int(gcc[0]) >= 5 and int(gcc[0]) <= 8
-            # There appears to be a GCC bug which lingered from major versions 5--8 and which
-            # flags up these warnings all over the place in boost::optional.
-            # This seems to be the only practical way to hide it.
-            conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])
         have_c11 = int(gcc[0]) >= 4 and int(gcc[1]) >= 8 and int(gcc[2]) >= 1
+        # Most gccs still give these warnings from boost::optional
+        conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])
     else:
         have_c11 = False
 
@@ -136,11 +132,6 @@ def configure(conf):
     else:
         conf.env.append_value('CXXFLAGS', '-O2')
 
-    if conf.options.variant is not None:
-        conf.env.VARIANT = conf.options.variant
-        if conf.options.variant.startswith('swaroop-'):
-            conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_VARIANT_SWAROOP')
-
     if conf.options.enable_disk:
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_DISK')
 
@@ -201,14 +192,14 @@ def configure(conf):
     if conf.env.TARGET_LINUX:
         conf.env.append_value('CXXFLAGS', '-mfpmath=sse')
         conf.env.append_value('CXXFLAGS', '-DLINUX_LOCALE_PREFIX="%s/share/locale"' % conf.env['INSTALL_PREFIX'])
-        conf.env.append_value('CXXFLAGS', '-DLINUX_SHARE_PREFIX="%s/share/dcpomatic2"' % conf.env['INSTALL_PREFIX'])
+        conf.env.append_value('CXXFLAGS', '-DLINUX_SHARE_PREFIX="%s/share"' % conf.env['INSTALL_PREFIX'])
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_LINUX')
         conf.env.append_value('CXXFLAGS', ['-Wlogical-op', '-Wcast-align'])
         conf.check(lib='dl', uselib_store='DL', msg='Checking for library dl')
 
     # OSX
     if conf.env.TARGET_OSX:
-        conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX'])
+        conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX', '-DGL_SILENCE_DEPRECATION'])
         conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names')
 
     #
@@ -262,6 +253,18 @@ def configure(conf):
                    define_name='DCPOMATIC_HAVE_ZIP_SOURCE_T'
                    )
 
+    # libbz2; must be explicitly linked on macOS for some reason
+    conf.check_cxx(fragment="""
+                            #include <bzlib.h>
+                            int main() { BZ2_bzCompressInit(0, 0, 0, 0); }
+                            """,
+                   mandatory=True,
+                   msg="Checking for libbz2",
+                   okmsg='yes',
+                   lib='bz2',
+                   uselib_store="BZ2"
+                   )
+
     # fontconfig
     conf.check_cfg(package='fontconfig', args='--cflags --libs', uselib_store='FONTCONFIG', mandatory=True)