From 496b39362387f3642f6708f951679a486223608a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 17 Jan 2012 00:23:41 -0500 Subject: [PATCH] backport to 2.0.2 fix for ubuntu compile error with boost 1.42 - refs #950 and #1001 --- SConstruct | 9 +++++---- src/build.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index a87cb993b..8004c7bc4 100644 --- a/SConstruct +++ b/SConstruct @@ -450,6 +450,7 @@ pickle_store = [# Scons internal variables 'CAIROMM_LIBPATHS', 'CAIROMM_LINKFLAGS', 'CAIROMM_CPPPATHS', + 'BOOST_LIB_VERSION_FROM_HEADER' ] # Add all other user configurable options to pickle pickle_store @@ -1133,9 +1134,9 @@ if not preconfigured: # boost system is used in boost 1.35 and greater env['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]) + env['BOOST_LIB_VERSION_FROM_HEADER'] = conf.GetBoostLibVersion() + if env['BOOST_LIB_VERSION_FROM_HEADER']: + boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1]) if boost_version_from_header >= 35: env['HAS_BOOST_SYSTEM'] = True @@ -1168,7 +1169,7 @@ if not preconfigured: if not env['BOOST_VERSION']: env['MISSING_DEPS'].append('boost version >=%s' % BOOST_MIN_VERSION) else: - color_print(4,'Found boost lib version... %s' % boost_lib_version_from_header ) + color_print(4,'Found boost lib version... %s' % env['BOOST_LIB_VERSION_FROM_HEADER'] ) for count, libinfo in enumerate(BOOST_LIBSHEADERS): if not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0],env['BOOST_APPEND']), libinfo[1], 'C++'): diff --git a/src/build.py b/src/build.py index b5e0bd834..d6b08f72d 100644 --- a/src/build.py +++ b/src/build.py @@ -204,6 +204,20 @@ if env['LIBTOOL_SUPPORTS_ADVISE']: else: source.insert(0,'datasource_cache.cpp') +if env.get('BOOST_LIB_VERSION_FROM_HEADER'): + boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1]) + if boost_version_from_header < 46: + # avoid ubuntu issue with boost interprocess: + # https://github.com/mapnik/mapnik/issues/1001 + env4 = lib_env.Clone() + env4.Append(CXXFLAGS = '-fpermissive') + cpp ='mapped_memory_cache.cpp' + source.remove(cpp) + if env['LINKING'] == 'static': + source.insert(0,env4.StaticObject(cpp)) + else: + source.insert(0,env4.SharedObject(cpp)) + if env['JPEG']: source += Split( """