diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-11-21 20:20:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-11-21 20:20:04 +0100 |
| commit | 38643ec631074ae628a4c414a1e7a3462aba19ed (patch) | |
| tree | 664856d54be34a25ee6ccd113eb8fc30b2c754c9 | |
| parent | b1eda03eac8661d8b3b1e8db7a0cf7c793e8f46c (diff) | |
Fix Centos 7 build.
| -rw-r--r-- | src/lib/zipper.cc | 4 | ||||
| -rw-r--r-- | wscript | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/zipper.cc b/src/lib/zipper.cc index db84cdf71..625f3049a 100644 --- a/src/lib/zipper.cc +++ b/src/lib/zipper.cc @@ -57,7 +57,11 @@ Zipper::add (string name, string content) throw runtime_error ("could not create ZIP source"); } +#ifdef DCPOMATIC_HAVE_ZIP_FILE_ADD if (zip_file_add(_zip, name.c_str(), source, ZIP_FL_ENC_GUESS) == -1) { +#else + if (zip_add(_zip, name.c_str(), source) == -1) { +#endif throw runtime_error(String::compose("failed to add data to ZIP archive (%1)", zip_strerror(_zip))); } } @@ -256,6 +256,15 @@ def configure(conf): uselib="ZIP", define_name='DCPOMATIC_HAVE_ZIP_SOURCE_T' ) + conf.check_cxx(fragment=""" + #include <zip.h> + int main() { struct zip* zip; zip_source_t* source; 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=""" |
