From 2b6575bc67f349c396e283097ab0001382427fe0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 25 Oct 2025 15:48:23 +0200 Subject: Fix build on Arch with boost 1.89. --- cscript | 4 ++-- src/lib/dcpomatic_socket.h | 1 + wscript | 26 ++++++++++++++++---------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/cscript b/cscript index a478df570..b3be15a58 100644 --- a/cscript +++ b/cscript @@ -502,8 +502,8 @@ def build_with_cpp17(target): def dependencies(target, options): - deps = [('libdcp', 'v1.10.34', {'c++17': build_with_cpp17(target)})] - deps.append(('libsub', 'v1.6.53')) + deps = [('libdcp', 'v1.10.35', {'c++17': build_with_cpp17(target)})] + deps.append(('libsub', 'v1.6.55')) deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23')) deps.append(('rtaudio', 'f619b76')) # We get our OpenSSL libraries from the environment, but we diff --git a/src/lib/dcpomatic_socket.h b/src/lib/dcpomatic_socket.h index 1bc3aead9..7accf737a 100644 --- a/src/lib/dcpomatic_socket.h +++ b/src/lib/dcpomatic_socket.h @@ -22,6 +22,7 @@ #include "digester.h" #include "io_context.h" #include +#include #include diff --git a/wscript b/wscript index d4e817230..bcfe22b44 100644 --- a/wscript +++ b/wscript @@ -197,6 +197,14 @@ def configure(conf): # Windows/Linux/macOS specific # + boost_lib_suffix = '-mt-x32' if conf.options.target_windows_32 else '-mt-x64' if conf.options.target_windows_64 else '' + + boost_system = conf.check_cxx(lib='boost_system%s' % boost_lib_suffix, mandatory=False) + def boost_libs(name): + libs = ['boost_system%s' % boost_lib_suffix] if boost_system else [] + libs.append('boost_%s%s' % (name, boost_lib_suffix)) + return libs + # Windows if conf.env.TARGET_WINDOWS_64 or conf.env.TARGET_WINDOWS_32: conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_WINDOWS') @@ -219,21 +227,17 @@ def configure(conf): conf.check(lib='ksuser', uselib_store='KSUSER', msg="Checking for library ksuser") conf.check(lib='setupapi', uselib_store='SETUPAPI', msg="Checking for library setupapi") conf.check(lib='uuid', uselib_store='UUID', msg="Checking for library uuid") - boost_lib_suffix = '-mt-x32' if conf.options.target_windows_32 else '-mt-x64' - boost_thread = 'boost_thread' + boost_lib_suffix conf.check_cxx(fragment=""" #include \n int main() { std::locale::global (boost::locale::generator().generate ("")); }\n """, msg='Checking for boost locale library', - lib=['boost_locale%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], + lib=boost_libs('locale'), uselib_store='BOOST_LOCALE') # POSIX if conf.env.TARGET_LINUX or conf.env.TARGET_OSX: conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_POSIX') - boost_lib_suffix = '' - boost_thread = 'boost_thread' conf.env.append_value('LINKFLAGS', '-pthread') # Linux @@ -574,7 +578,7 @@ def configure(conf): if conf.options.static_boost: conf.env.STLIB_BOOST_THREAD = ['boost_thread'] conf.env.STLIB_BOOST_FILESYSTEM = ['boost_filesystem%s' % boost_lib_suffix] - conf.env.STLIB_BOOST_DATETIME = ['boost_date_time%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix] + conf.env.STLIB_BOOST_DATETIME = boost_libs('date_time') conf.env.STLIB_BOOST_SIGNALS2 = ['boost_signals2'] conf.env.STLIB_BOOST_SYSTEM = ['boost_system'] conf.env.STLIB_BOOST_REGEX = ['boost_regex'] @@ -596,7 +600,7 @@ def configure(conf): int main() { boost::thread t; }\n """, msg='Checking for boost threading library', - lib=[boost_thread, 'boost_system%s' % boost_lib_suffix], + lib=boost_libs('thread'), uselib_store='BOOST_THREAD') conf.check_cxx(fragment=""" @@ -604,7 +608,7 @@ def configure(conf): int main() { boost::filesystem::copy_file ("a", "b"); }\n """, msg='Checking for boost filesystem library', - lib=['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], + lib=boost_libs('filesystem'), uselib_store='BOOST_FILESYSTEM') conf.check_cxx(fragment=""" @@ -612,7 +616,7 @@ def configure(conf): int main() { boost::gregorian::day_clock::local_day(); }\n """, msg='Checking for boost datetime library', - lib=['boost_date_time%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix], + lib=boost_libs('date_time'), uselib_store='BOOST_DATETIME') conf.check_cxx(fragment=""" @@ -631,7 +635,9 @@ def configure(conf): uselib_store='BOOST_REGEX') if conf.options.enable_disk or not conf.options.disable_tests: - deps = ['boost_system%s' % boost_lib_suffix] + deps = [] + if boost_system: + deps.append('boost_system%s' % boost_lib_suffix) if conf.env.TARGET_WINDOWS_64 or conf.env.TARGET_WINDOWS_32: deps.append('ws2_32') deps.append('boost_filesystem%s' % boost_lib_suffix) -- cgit v1.2.3