scons: support MAPNIK_NAME option to customize libmapnik name for custom packaging

This commit is contained in:
Dane Springmeyer 2014-06-09 13:32:48 -07:00
parent 49feda9b13
commit a7e6f3a24b
25 changed files with 30 additions and 29 deletions

View file

@ -312,6 +312,7 @@ opts.AddVariables(
('PATH', 'A custom path (or multiple paths divided by ":") to append to the $PATH env to prioritize usage of command line programs (if multiple are present on the system)', ''),
('PATH_REMOVE', 'A path prefix to exclude from all known command and compile paths (create multiple excludes separated by :)', ''),
('PATH_REPLACE', 'Two path prefixes (divided with a :) to search/replace from all known command and compile paths', ''),
('MAPNIK_NAME', 'Name of library', 'mapnik'),
# Boost variables
# default is '/usr/include', see FindBoost method below
@ -1121,9 +1122,9 @@ if not preconfigured:
env['MAPNIK_FONTS_DEST'] = os.path.join(env['MAPNIK_LIB_DIR_DEST'],'fonts')
if env['LINKING'] == 'static':
env['MAPNIK_LIB_NAME'] = '${LIBPREFIX}mapnik${LIBSUFFIX}'
env['MAPNIK_LIB_NAME'] = '${LIBPREFIX}${MAPNIK_NAME}${LIBSUFFIX}'
else:
env['MAPNIK_LIB_NAME'] = '${SHLIBPREFIX}mapnik${SHLIBSUFFIX}'
env['MAPNIK_LIB_NAME'] = '${SHLIBPREFIX}${MAPNIK_NAME}${SHLIBSUFFIX}'
if env['PKG_CONFIG_PATH']:
env['ENV']['PKG_CONFIG_PATH'] = os.path.realpath(env['PKG_CONFIG_PATH'])

View file

@ -7,7 +7,7 @@ Import ('env')
test_env = env.Clone()
test_env['LIBS'] = copy(env['LIBMAPNIK_LIBS'])
test_env.AppendUnique(LIBS='mapnik')
test_env.AppendUnique(LIBS=env['MAPNIK_NAME'])
test_env.AppendUnique(CXXFLAGS='-g')
if 'g++' in env['CXX']:
test_env.Append(CXXFLAGS='-fPIC')

View file

@ -48,7 +48,7 @@ py_env.Append(CPPPATH = env['PYTHON_INCLUDES'])
py_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
py_env['LIBS'] = ['mapnik',env['BOOST_PYTHON_LIB']]
py_env['LIBS'] = [env['MAPNIK_NAME'],env['BOOST_PYTHON_LIB']]
link_all_libs = env['LINKING'] == 'static' or env['RUNTIME_LINK'] == 'static' or (env['PLATFORM'] == 'Darwin' and not env['PYTHON_DYNAMIC_LOOKUP'])

View file

@ -40,7 +40,7 @@ if env['HAS_CAIRO']:
demo_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
libraries = ['mapnik']
libraries = [env['MAPNIK_NAME']]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
rundemo = demo_env.Program('rundemo', source, LIBS=libraries, LINKFLAGS=env["CUSTOM_LDFLAGS"])

View file

@ -48,7 +48,7 @@ else:
libraries.append(env['ICU_LIB_NAME'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -45,7 +45,7 @@ if env['RUNTIME_LINK'] == 'static':
libraries = copy(plugin_env['LIBS'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.insert(0,'mapnik')
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])

View file

@ -51,7 +51,7 @@ else:
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -41,7 +41,7 @@ libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append(env['ICU_LIB_NAME'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -58,7 +58,7 @@ if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
plugin_env.Append(CXXFLAGS=cxxflags)
if env['PLUGIN_LINKING'] == 'shared':
libraries.insert(0,'mapnik')
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])

View file

@ -60,7 +60,7 @@ libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -54,7 +54,7 @@ if env['THREADING'] == 'multi':
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.insert(0,'mapnik')
libraries.insert(0,env['MAPNIK_NAME'])
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])

View file

@ -72,7 +72,7 @@ else:
linkflags = python_link_flag
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',
SHLIBSUFFIX='.input',

View file

@ -40,7 +40,7 @@ libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -39,7 +39,7 @@ libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -56,7 +56,7 @@ plugin_env.Append(CXXFLAGS=cxxflags)
plugin_env.Append(CPPDEFINES=cppdefines)
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary('../shape',
SHLIBSUFFIX='.input',

View file

@ -43,7 +43,7 @@ if env['SQLITE_LINKFLAGS']:
linkflags.append(env['SQLITE_LINKFLAGS'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
linkflags.append(env['CUSTOM_LDFLAGS'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,

View file

@ -51,7 +51,7 @@ if env['PLUGIN_LINKING'] == 'shared':
install_dest = env['MAPNIK_INPUT_PLUGINS_DEST']
# only link mapnik if we are build an external shared object
libraries.append('mapnik')
libraries.append(env['MAPNIK_NAME'])
TARGET = plugin_env.SharedLibrary(
# the name of the target to build, eg 'sqlite.input'

View file

@ -413,9 +413,9 @@ if env['PLATFORM'] == 'Darwin' or not env['ENABLE_SONAME']:
target_path = env['MAPNIK_LIB_BASE_DEST']
if 'uninstall' not in COMMAND_LINE_TARGETS:
if env['LINKING'] == 'static':
mapnik = lib_env_final.StaticLibrary('mapnik', source)
mapnik = lib_env_final.StaticLibrary(env['MAPNIK_NAME'], source)
else:
mapnik = lib_env_final.SharedLibrary('mapnik', source)
mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
result = env.Install(target_path, mapnik)
env.Alias(target='install', source=result)
@ -437,9 +437,9 @@ else:
if 'uninstall' not in COMMAND_LINE_TARGETS:
if env['LINKING'] == 'static':
mapnik = lib_env_final.StaticLibrary('mapnik', source)
mapnik = lib_env_final.StaticLibrary(env['MAPNIK_NAME'], source)
else:
mapnik = lib_env_final.SharedLibrary('mapnik', source)
mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
result = env.InstallAs(target=target, source=mapnik)
env.Alias(target='install', source=result)
if result:

View file

@ -10,7 +10,7 @@ if not env['CPP_TESTS']:
for cpp_test_bin in glob.glob('*-bin'):
os.unlink(cpp_test_bin)
else:
test_env['LIBS'] = ['mapnik']
test_env['LIBS'] = [env['MAPNIK_NAME']]
test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS']))
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
test_env.AppendUnique(LIBS='dl')

View file

@ -4,7 +4,7 @@ from copy import copy
Import ('env')
libraries = ['mapnik']
libraries = [env['MAPNIK_NAME']]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
for cpp_test in glob.glob('*_test.cpp'):

View file

@ -119,7 +119,7 @@ configuration = {
"git_describe": git_describe,
"version_string": config_env['MAPNIK_VERSION_STRING'],
"version": config_env['MAPNIK_VERSION'],
"mapnik_libname": 'mapnik',
"mapnik_libname": env['MAPNIK_NAME'],
"mapnik_libpath": lib_path,
"ldflags": ldflags,
"dep_libs": dep_libs,

View file

@ -37,7 +37,7 @@ headers = ['#plugins/input/ogr'] + env['CPPPATH']
program_env['LIBS'] = [env['PLUGINS']['ogr']['lib']]
# Link Library to Dependencies
program_env['LIBS'].append('mapnik')
program_env['LIBS'].append(env['MAPNIK_NAME'])
program_env['LIBS'].append(env['ICU_LIB_NAME'])
program_env['LIBS'].append('boost_system%s' % env['BOOST_APPEND'])
program_env['LIBS'].append('boost_program_options%s' % env['BOOST_APPEND'])

View file

@ -47,7 +47,7 @@ program_env.PrependUnique(CPPPATH=['#plugins/input/postgis'])
libraries = []
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
libraries.extend([boost_program_options,'sqlite3','pq','mapnik','icuuc'])
libraries.extend([boost_program_options,'sqlite3','pq',env['MAPNIK_NAME'],'icuuc'])
if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])

View file

@ -39,7 +39,7 @@ headers = ['#plugins/input/shape'] + env['CPPPATH']
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
boost_system = 'boost_system%s' % env['BOOST_APPEND']
libraries = ['mapnik', boost_program_options, boost_system]
libraries = [env['MAPNIK_NAME'], boost_program_options, boost_system]
if env['RUNTIME_LINK'] == 'static':
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
if env['PLATFORM'] == 'Linux':

View file

@ -41,7 +41,7 @@ if env['HAS_CAIRO']:
program_env.Append(CPPDEFINES = '-DHAVE_CAIRO')
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
libraries = ['mapnik',boost_program_options]
libraries = [env['MAPNIK_NAME'],boost_program_options]
libraries.extend(copy(env['LIBMAPNIK_LIBS']))
if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux':
libraries.append('dl')