Explicitly link zlib to keep new macOS environment happy.
[dcpomatic.git] / wscript
diff --git a/wscript b/wscript
index ca5ca85d7213a803be6354b595018d53d1795e8b..7395679fb93853733b5baeb4d357edd7e13c2cb9 100644 (file)
--- a/wscript
+++ b/wscript
@@ -35,7 +35,7 @@ except ImportError:
 from waflib import Logs, Context
 
 APPNAME = 'dcpomatic'
-libdcp_version = '1.8.72'
+libdcp_version = '1.8.73'
 libsub_version = '1.6.42'
 
 this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
@@ -249,13 +249,22 @@ def configure(conf):
     conf.check_cfg(package='libzip', args='--cflags --libs', uselib_store='ZIP', mandatory=True)
     conf.check_cxx(fragment="""
                             #include <zip.h>
-                            int main() { zip_source_t* foo; }
+                            int main() { zip_source_t* foo; (void)foo; }
                             """,
                    mandatory=False,
                    msg="Checking for zip_source_t",
                    uselib="ZIP",
                    define_name='DCPOMATIC_HAVE_ZIP_SOURCE_T'
                    )
+    conf.check_cxx(fragment="""
+                            #include <zip.h>
+                            int main() { struct zip* zip = nullptr; zip_source_t* source = nullptr; zip_file_add(zip, "foo", source, ZIP_FL_ENC_GUESS); }
+                            """,
+                   mandatory=False,
+                   msg="Checking for zip_file_add",
+                   uselib="ZIP",
+                   define_name='DCPOMATIC_HAVE_ZIP_FILE_ADD'
+                   )
 
     # libbz2; must be explicitly linked on macOS for some reason
     conf.check_cxx(fragment="""
@@ -269,6 +278,18 @@ def configure(conf):
                    uselib_store="BZ2"
                    )
 
+    # libz; must be explicitly linked on macOS for some reason
+    conf.check_cxx(fragment="""
+                            #include <zlib.h>
+                            int main() { zlibVersion(); }
+                            """,
+                   mandatory=True,
+                   msg="Checking for libz",
+                   okmsg='yes',
+                   lib='z',
+                   uselib_store="LIBZ"
+                   )
+
     # fontconfig
     conf.check_cfg(package='fontconfig', args='--cflags --libs', uselib_store='FONTCONFIG', mandatory=True)