From fedbc4054166207dd6b3260711b3430deb1001e5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 21 Feb 2010 00:33:41 +0000 Subject: [PATCH] ensure shapeindex links against boost system if available (boost >=1.35) to avoid potential problems in indirect linking on linux (essentially directly dynamically linking like we previously only did on os x) - closes #517 --- SConstruct | 27 +++++++++++++++++---------- plugins/input/ogr/SConscript | 2 +- src/SConscript | 2 +- utils/ogrindex/SConscript | 2 +- utils/shapeindex/SConscript | 5 +---- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/SConstruct b/SConstruct index e7bf8fd93..ddbac460c 100644 --- a/SConstruct +++ b/SConstruct @@ -248,7 +248,7 @@ pickle_store = [# Scons internal variables 'PYTHON_INSTALL_LOCATION', 'PYTHON_SYS_PREFIX', 'COLOR_PRINT', - 'BOOST_SYSTEM_REQUIRED', + 'HAS_BOOST_SYSTEM', ] # Add all other user configurable options to pickle pickle_store @@ -301,6 +301,14 @@ if not force_configure: else: preconfigured = False +# check for missing keys in pickled settings +# which can occur when keys are added or changed between +# rebuilds, e.g. for folks following trunk +for opt in pickle_store: + if not opt in env: + preconfigured = False + print opt + # if custom arguments are supplied make sure to accept them if opts.args: # since we have custom arguments update environment with all opts to @@ -728,22 +736,21 @@ if not preconfigured: conf.FindBoost(BOOST_SEARCH_PREFIXES,thread_flag) - # get boost version from boost headers rather than previous approach - # of fetching from the user provided INCLUDE path - boost_system_required = False + # boost system is used in boost 1.35 and greater + has_boost_system = False boost_lib_version_from_header = conf.GetBoostLibVersion() if boost_lib_version_from_header: boost_version_from_header = int(boost_lib_version_from_header.split('_')[1]) - if boost_version_from_header >= 35 and env['PLATFORM'] == 'Darwin': - boost_system_required = True - env['BOOST_SYSTEM_REQUIRED'] = True + if boost_version_from_header >= 35: + has_boost_system = True + env['HAS_BOOST_SYSTEM'] = True else: - boost_system_required = False - env['BOOST_SYSTEM_REQUIRED'] = False + has_boost_system = False + env['HAS_BOOST_SYSTEM'] = False # The other required boost headers. BOOST_LIBSHEADERS = [ - ['system', 'boost/system/system_error.hpp', boost_system_required], + ['system', 'boost/system/system_error.hpp', has_boost_system], ['filesystem', 'boost/filesystem/operations.hpp', True], ['regex', 'boost/regex.hpp', True], ['iostreams','boost/iostreams/device/mapped_file.hpp',True], diff --git a/plugins/input/ogr/SConscript b/plugins/input/ogr/SConscript index c73277b12..8eddd9907 100644 --- a/plugins/input/ogr/SConscript +++ b/plugins/input/ogr/SConscript @@ -36,7 +36,7 @@ ogr_src = Split( libraries = [env['PLUGINS']['ogr']['lib']] if env['PLATFORM'] == 'Darwin': - if env['BOOST_SYSTEM_REQUIRED']: + if env['HAS_BOOST_SYSTEM']: boost_system = 'boost_system%s' % env['BOOST_APPEND'] libraries.append(boost_system) libraries.append('mapnik') diff --git a/src/SConscript b/src/SConscript index a1b01a10d..ff6282b93 100644 --- a/src/SConscript +++ b/src/SConscript @@ -49,7 +49,7 @@ if env['THREADING'] == 'multi': libraries.append('boost_thread%s' % env['BOOST_APPEND']) if env['PLATFORM'] == 'Darwin': - if env['BOOST_SYSTEM_REQUIRED']: + if env['HAS_BOOST_SYSTEM']: libraries.append('boost_system%s' % env['BOOST_APPEND']) if env['INTERNAL_LIBAGG']: diff --git a/utils/ogrindex/SConscript b/utils/ogrindex/SConscript index 5118ac0d0..c209f7994 100644 --- a/utils/ogrindex/SConscript +++ b/utils/ogrindex/SConscript @@ -40,7 +40,7 @@ boost_filesystem = 'boost_filesystem%s' % env['BOOST_APPEND'] libraries = [boost_program_options,boost_iostreams,boost_filesystem,env['PLUGINS']['ogr']['lib'],'mapnik'] if env['PLATFORM'] == 'Darwin': - if env['BOOST_SYSTEM_REQUIRED']: + if env['HAS_BOOST_SYSTEM']: boost_system = 'boost_system%s' % env['BOOST_APPEND'] libraries.append(boost_system) libraries.append(env['ICU_LIB_NAME']) diff --git a/utils/shapeindex/SConscript b/utils/shapeindex/SConscript index e34f38e06..eab0f22d5 100644 --- a/utils/shapeindex/SConscript +++ b/utils/shapeindex/SConscript @@ -43,10 +43,7 @@ libraries = [boost_program_options,boost_iostreams,boost_filesystem] boost_system = 'boost_system%s' % env['BOOST_APPEND'] -if env['SUNCC']: - libraries.append(boost_system) - -if env['PLATFORM'] == 'Darwin' and env['BOOST_SYSTEM_REQUIRED']: +if env['HAS_BOOST_SYSTEM']: libraries.append(boost_system)