backport to 2.0.2 fix for ubuntu compile error with boost 1.42 - refs #950 and #1001

This commit is contained in:
Dane Springmeyer 2012-01-17 00:23:41 -05:00
parent babe1b6fd0
commit 496b393623
2 changed files with 19 additions and 4 deletions

View file

@ -450,6 +450,7 @@ pickle_store = [# Scons internal variables
'CAIROMM_LIBPATHS', 'CAIROMM_LIBPATHS',
'CAIROMM_LINKFLAGS', 'CAIROMM_LINKFLAGS',
'CAIROMM_CPPPATHS', 'CAIROMM_CPPPATHS',
'BOOST_LIB_VERSION_FROM_HEADER'
] ]
# Add all other user configurable options to pickle pickle_store # 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 # boost system is used in boost 1.35 and greater
env['HAS_BOOST_SYSTEM'] = False env['HAS_BOOST_SYSTEM'] = False
boost_lib_version_from_header = conf.GetBoostLibVersion() env['BOOST_LIB_VERSION_FROM_HEADER'] = conf.GetBoostLibVersion()
if boost_lib_version_from_header: if env['BOOST_LIB_VERSION_FROM_HEADER']:
boost_version_from_header = int(boost_lib_version_from_header.split('_')[1]) boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])
if boost_version_from_header >= 35: if boost_version_from_header >= 35:
env['HAS_BOOST_SYSTEM'] = True env['HAS_BOOST_SYSTEM'] = True
@ -1168,7 +1169,7 @@ if not preconfigured:
if not env['BOOST_VERSION']: if not env['BOOST_VERSION']:
env['MISSING_DEPS'].append('boost version >=%s' % BOOST_MIN_VERSION) env['MISSING_DEPS'].append('boost version >=%s' % BOOST_MIN_VERSION)
else: 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): for count, libinfo in enumerate(BOOST_LIBSHEADERS):
if not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0],env['BOOST_APPEND']), libinfo[1], 'C++'): if not conf.CheckLibWithHeader('boost_%s%s' % (libinfo[0],env['BOOST_APPEND']), libinfo[1], 'C++'):

View file

@ -204,6 +204,20 @@ if env['LIBTOOL_SUPPORTS_ADVISE']:
else: else:
source.insert(0,'datasource_cache.cpp') 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']: if env['JPEG']:
source += Split( source += Split(
""" """