scons: collect and propogate the libs used to link libmapnik
This commit is contained in:
parent
82ac99611e
commit
af62ad9c27
6 changed files with 43 additions and 60 deletions
|
@ -942,6 +942,7 @@ if not preconfigured:
|
||||||
env['HAS_PYCAIRO'] = False
|
env['HAS_PYCAIRO'] = False
|
||||||
env['HAS_LIBXML2'] = False
|
env['HAS_LIBXML2'] = False
|
||||||
env['SVN_REVISION'] = None
|
env['SVN_REVISION'] = None
|
||||||
|
env['LIBMAPNIK_LIBS'] = []
|
||||||
if env['LINKING'] == 'static':
|
if env['LINKING'] == 'static':
|
||||||
env['MAPNIK_LIB_NAME'] = '${LIBPREFIX}mapnik2${LIBSUFFIX}'
|
env['MAPNIK_LIB_NAME'] = '${LIBPREFIX}mapnik2${LIBSUFFIX}'
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -34,21 +34,9 @@ demo_env = env.Clone()
|
||||||
|
|
||||||
headers = env['CPPPATH']
|
headers = env['CPPPATH']
|
||||||
|
|
||||||
boost_regex = 'boost_regex%s' % env['BOOST_APPEND']
|
libraries = env['LIBMAPNIK_LIBS']
|
||||||
|
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||||
libraries = ['mapnik2']
|
libraries.extend([boost_program_options,'mapnik2'])
|
||||||
|
|
||||||
if env['THREADING'] == 'multi':
|
|
||||||
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
|
|
||||||
|
|
||||||
if env['HAS_CAIRO'] in env['CXXFLAGS']:
|
|
||||||
# add cairo and cairomm-1.0 to libs
|
|
||||||
libraries.append('cairomm-1.0')
|
|
||||||
libraries.append('cairo')
|
|
||||||
|
|
||||||
if env['PLATFORM'] in ('Darwin','SunOS'):
|
|
||||||
libraries.append(boost_regex)
|
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
|
||||||
|
|
||||||
rundemo = demo_env.Program('rundemo', source, CPPPATH=headers, LIBS=libraries, LINKFLAGS=env["CUSTOM_LDFLAGS"])
|
rundemo = demo_env.Program('rundemo', source, CPPPATH=headers, LIBS=libraries, LINKFLAGS=env["CUSTOM_LDFLAGS"])
|
||||||
|
|
||||||
|
|
|
@ -52,27 +52,28 @@ install_prefix = env['DESTDIR'] + '/' + prefix
|
||||||
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
|
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
|
||||||
regex = 'boost_regex%s' % env['BOOST_APPEND']
|
regex = 'boost_regex%s' % env['BOOST_APPEND']
|
||||||
|
|
||||||
libraries = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME'],filesystem,regex]
|
# clear out and re-set libs for this env
|
||||||
|
lib_env['LIBS'] = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME'],filesystem,regex]
|
||||||
|
|
||||||
if env['HAS_CAIRO']:
|
if env['HAS_CAIRO']:
|
||||||
# add cairo and cairomm-1.0 to libs
|
# add cairo and cairomm-1.0 to libs
|
||||||
libraries.append('cairomm-1.0')
|
lib_env['LIBS'].append('cairomm-1.0')
|
||||||
libraries.append('cairo')
|
lib_env['LIBS'].append('cairo')
|
||||||
|
|
||||||
if env['XMLPARSER'] == 'libxml2':
|
if env['XMLPARSER'] == 'libxml2':
|
||||||
libraries.append('xml2')
|
lib_env['LIBS'].append('xml2')
|
||||||
|
|
||||||
if env['THREADING'] == 'multi':
|
if env['THREADING'] == 'multi':
|
||||||
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
|
lib_env['LIBS'].append('boost_thread%s' % env['BOOST_APPEND'])
|
||||||
|
|
||||||
if env['PLATFORM'] in ('Darwin','SunOS'):
|
if env['PLATFORM'] in ('Darwin','SunOS'):
|
||||||
if env['HAS_BOOST_SYSTEM']:
|
if env['HAS_BOOST_SYSTEM']:
|
||||||
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
lib_env['LIBS'].append('boost_system%s' % env['BOOST_APPEND'])
|
||||||
|
|
||||||
if env['INTERNAL_LIBAGG']:
|
if env['INTERNAL_LIBAGG']:
|
||||||
libraries.insert(0, 'agg')
|
lib_env['LIBS'].insert(0, 'agg')
|
||||||
else:
|
else:
|
||||||
libraries.append([lib for lib in env['LIBS'] if lib.startswith('agg')])
|
lib_env['LIBS'].append([lib for lib in env['LIBS'] if lib.startswith('agg')])
|
||||||
|
|
||||||
|
|
||||||
if env['PLATFORM'] == 'Darwin':
|
if env['PLATFORM'] == 'Darwin':
|
||||||
|
@ -155,7 +156,11 @@ source = Split(
|
||||||
if env['LIBTOOL_SUPPORTS_ADVISE']:
|
if env['LIBTOOL_SUPPORTS_ADVISE']:
|
||||||
env3 = lib_env.Clone()
|
env3 = lib_env.Clone()
|
||||||
env3.Append(CXXFLAGS='-DLIBTOOL_SUPPORTS_ADVISE')
|
env3.Append(CXXFLAGS='-DLIBTOOL_SUPPORTS_ADVISE')
|
||||||
source.insert(0,env3.SharedObject('datasource_cache.cpp'))
|
cpp = 'datasource_cache.cpp'
|
||||||
|
if env['LINKING'] == 'static':
|
||||||
|
source.insert(0,env3.StaticObject(cpp))
|
||||||
|
else:
|
||||||
|
source.insert(0,env3.SharedObject(cpp))
|
||||||
else:
|
else:
|
||||||
source.insert(0,'datasource_cache.cpp')
|
source.insert(0,'datasource_cache.cpp')
|
||||||
|
|
||||||
|
@ -236,6 +241,9 @@ if env['HAS_CAIRO']:
|
||||||
for cpp in fixup:
|
for cpp in fixup:
|
||||||
if cpp in source:
|
if cpp in source:
|
||||||
source.remove(cpp)
|
source.remove(cpp)
|
||||||
|
if env['LINKING'] == 'static':
|
||||||
|
source.insert(0,env2.StaticObject(cpp))
|
||||||
|
else:
|
||||||
source.insert(0,env2.SharedObject(cpp))
|
source.insert(0,env2.SharedObject(cpp))
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
print '\nFailed to detect cairo/cairomm configuration, please re-run "python scons/scons.py configure"'
|
print '\nFailed to detect cairo/cairomm configuration, please re-run "python scons/scons.py configure"'
|
||||||
|
@ -260,6 +268,9 @@ elif env['XMLPARSER'] == 'libxml2' and env['HAS_LIBXML2']:
|
||||||
for cpp in fixup:
|
for cpp in fixup:
|
||||||
if cpp in source:
|
if cpp in source:
|
||||||
source.remove(cpp)
|
source.remove(cpp)
|
||||||
|
if env['LINKING'] == 'static':
|
||||||
|
source.insert(0,env2.StaticObject(cpp))
|
||||||
|
else:
|
||||||
source.insert(0,env2.SharedObject(cpp))
|
source.insert(0,env2.SharedObject(cpp))
|
||||||
|
|
||||||
if env['CUSTOM_LDFLAGS']:
|
if env['CUSTOM_LDFLAGS']:
|
||||||
|
@ -267,13 +278,13 @@ if env['CUSTOM_LDFLAGS']:
|
||||||
else:
|
else:
|
||||||
linkflags = mapnik_lib_link_flag
|
linkflags = mapnik_lib_link_flag
|
||||||
|
|
||||||
if env['LIBMAPNIK_LINKFLAGS']:
|
|
||||||
linkflags = '%s %s' % (env['LIBMAPNIK_LINKFLAGS'],linkflags)
|
|
||||||
|
|
||||||
if env['LINKING'] == 'static':
|
if env['LINKING'] == 'static':
|
||||||
mapnik = lib_env.StaticLibrary('mapnik2', source, LIBS=libraries, LINKFLAGS=linkflags)
|
mapnik = lib_env.StaticLibrary('mapnik2', source, LINKFLAGS=linkflags)
|
||||||
else:
|
else:
|
||||||
mapnik = lib_env.SharedLibrary('mapnik2', source, LIBS=libraries, LINKFLAGS=linkflags)
|
mapnik = lib_env.SharedLibrary('mapnik2', source, LINKFLAGS=linkflags)
|
||||||
|
|
||||||
|
# cache libraries value for other builds to use
|
||||||
|
env['LIBMAPNIK_LIBS'] = lib_env['LIBS']
|
||||||
|
|
||||||
if env['PLATFORM'] != 'Darwin':
|
if env['PLATFORM'] != 'Darwin':
|
||||||
# Symlink command, only works if both files are in same directory
|
# Symlink command, only works if both files are in same directory
|
||||||
|
|
|
@ -5,17 +5,9 @@ Import ('env')
|
||||||
|
|
||||||
headers = env['CPPPATH']
|
headers = env['CPPPATH']
|
||||||
|
|
||||||
boost_filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
|
libraries = env['LIBMAPNIK_LIBS']
|
||||||
boost_system = 'boost_system%s' % env['BOOST_APPEND']
|
libraries.append('mapnik2')
|
||||||
boost_regex = 'boost_regex%s' % env['BOOST_APPEND']
|
|
||||||
|
|
||||||
libraries = [boost_filesystem, boost_regex, 'mapnik2']
|
|
||||||
|
|
||||||
if env['PLATFORM'] == 'Darwin':
|
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
|
||||||
|
|
||||||
if env['HAS_BOOST_SYSTEM']:
|
|
||||||
libraries.append(boost_system)
|
|
||||||
|
|
||||||
for cpp_test in glob.glob('*_test.cpp'):
|
for cpp_test in glob.glob('*_test.cpp'):
|
||||||
env.Program(cpp_test.replace('.cpp',''), [cpp_test], CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
test_program = env.Program(cpp_test.replace('.cpp',''), [cpp_test], CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
||||||
|
Depends(test_program, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
||||||
|
|
|
@ -35,15 +35,14 @@ source = Split(
|
||||||
|
|
||||||
headers = ['#plugins/input/postgis'] + env['CPPPATH']
|
headers = ['#plugins/input/postgis'] + env['CPPPATH']
|
||||||
|
|
||||||
|
|
||||||
|
libraries = env['LIBMAPNIK_LIBS']
|
||||||
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||||
|
libraries.extend([boost_program_options,'sqlite3','pq','mapnik2'])
|
||||||
libraries = [boost_program_options,'sqlite3','pq','mapnik2']
|
|
||||||
|
|
||||||
if env['PLATFORM'] == 'Darwin':
|
|
||||||
libraries.append(env['ICU_LIB_NAME'])
|
|
||||||
|
|
||||||
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
||||||
pgsql2sqlite = program_env.Program('pgsql2sqlite', source, CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
pgsql2sqlite = program_env.Program('pgsql2sqlite', source, CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
||||||
|
Depends(pgsql2sqlite, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
||||||
env.Install(install_prefix + '/bin', pgsql2sqlite)
|
env.Install(install_prefix + '/bin', pgsql2sqlite)
|
||||||
env.Alias('install', install_prefix + '/bin')
|
env.Alias('install', install_prefix + '/bin')
|
||||||
|
|
||||||
|
|
|
@ -36,22 +36,14 @@ source = Split(
|
||||||
|
|
||||||
headers = env['CPPPATH']
|
headers = env['CPPPATH']
|
||||||
|
|
||||||
|
libraries = env['LIBMAPNIK_LIBS']
|
||||||
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||||
boost_filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
|
libraries.extend([boost_program_options,'mapnik2'])
|
||||||
libraries = [boost_program_options,boost_filesystem,'mapnik2']
|
|
||||||
|
|
||||||
boost_system = 'boost_system%s' % env['BOOST_APPEND']
|
|
||||||
|
|
||||||
if env['HAS_BOOST_SYSTEM']:
|
|
||||||
libraries.append(boost_system)
|
|
||||||
|
|
||||||
if env['INTERNAL_LIBAGG']:
|
|
||||||
libraries.insert(0, 'agg')
|
|
||||||
else:
|
|
||||||
libraries.append([lib for lib in env['LIBS'] if lib.startswith('agg')])
|
|
||||||
|
|
||||||
svg2png = program_env.Program('svg2png', source, CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
svg2png = program_env.Program('svg2png', source, CPPPATH=headers, LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
|
||||||
|
|
||||||
|
Depends(svg2png, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
||||||
|
|
||||||
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
if 'uninstall' not in COMMAND_LINE_TARGETS:
|
||||||
env.Install(install_prefix + '/bin', svg2png)
|
env.Install(install_prefix + '/bin', svg2png)
|
||||||
env.Alias('install', install_prefix + '/bin')
|
env.Alias('install', install_prefix + '/bin')
|
||||||
|
|
Loading…
Reference in a new issue