From 591d3e1f92a5eb6fb52049e987c8273eb468e527 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 25 Oct 2025 15:07:57 +0200 Subject: Fix build on Arch with boost 1.89. --- wscript | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index b7eeb443..4734bfab 100644 --- a/wscript +++ b/wscript @@ -220,13 +220,19 @@ def configure(conf): okmsg='yes', errmsg='too old\nPlease install boost version %s or higher.' % boost_version[0]) + conf.env.HAVE_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 conf.env.HAVE_BOOST_SYSTEM else [] + libs.append('boost_%s%s' % (name, boost_lib_suffix)) + return libs + conf.check_cxx(fragment=""" #include \n int main() { boost::filesystem::copy_file ("a", "b"); }\n """, msg='Checking for boost filesystem library', libpath='/usr/local/lib', - 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=""" @@ -262,7 +268,7 @@ def configure(conf): """, msg='Checking for boost datetime library', libpath='/usr/local/lib', - 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_cfg(package='libavcodec', args='--cflags --libs', uselib_store='AVCODEC', mandatory=True) @@ -305,7 +311,9 @@ def build(bld): else: boost_lib_suffix = '' - libs="-L${libdir} -ldcp%s -lcxml -lboost_system%s" % (bld.env.API_VERSION, boost_lib_suffix) + libs="-L${libdir} -ldcp%s -lcxml " % bld.env.API_VERSION + if bld.env.HAVE_BOOST_SYSTEM: + libs += " -lboost_system%s" % boost_lib_suffix if bld.env.HAVE_HARU: libs += " -lhpdf" if bld.env.TARGET_LINUX: -- cgit v1.2.3