From 1242df28ee14cfc993b68cd534e226ea29f4c878 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 14 Mar 2018 15:46:25 +0100 Subject: [PATCH] cleanup+update build scripts --- demo/c++/build.py | 7 ++----- plugins/input/csv/build.py | 2 -- plugins/input/postgis/build.py | 1 - plugins/input/shape/build.py | 1 - plugins/input/sqlite/build.py | 2 +- test/build.py | 12 ++++-------- utils/mapnik-index/build.py | 2 +- 7 files changed, 8 insertions(+), 19 deletions(-) diff --git a/demo/c++/build.py b/demo/c++/build.py index 64b6d962e..8ed0de109 100644 --- a/demo/c++/build.py +++ b/demo/c++/build.py @@ -36,18 +36,15 @@ demo_env = env.Clone() demo_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS']) demo_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) -demo_env['LINKFLAGS'] = '-lmapnik -lmapnik-json' + demo_env['LINKFLAGS'] -print demo_env['LINKFLAGS'] +demo_env['LINKFLAGS'] = '-l%s -lmapnik-json ' % env['MAPNIK_NAME'] + demo_env['LINKFLAGS'] if env['HAS_CAIRO']: demo_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS']) demo_env.Append(CPPDEFINES = '-DHAVE_CAIRO') -libraries = []#env['MAPNIK_NAME']] +libraries = [] libraries.extend(copy(env['LIBMAPNIK_LIBS'])) -print libraries rundemo = demo_env.Program('rundemo', source, LIBS=libraries) - Depends(rundemo, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) # build locally if installing diff --git a/plugins/input/csv/build.py b/plugins/input/csv/build.py index 0b7bcda10..626b0bd41 100644 --- a/plugins/input/csv/build.py +++ b/plugins/input/csv/build.py @@ -54,9 +54,7 @@ else: if env['PLUGIN_LINKING'] == 'shared': libraries.append('boost_system%s' % env['BOOST_APPEND']) - #libraries.insert(0,env['MAPNIK_NAME']) libraries.append(env['ICU_LIB_NAME']) - TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME, SHLIBPREFIX='', SHLIBSUFFIX='.input', diff --git a/plugins/input/postgis/build.py b/plugins/input/postgis/build.py index 3abb88e2e..d11d88436 100644 --- a/plugins/input/postgis/build.py +++ b/plugins/input/postgis/build.py @@ -52,7 +52,6 @@ libraries = copy(plugin_env['LIBS']) if env['PLUGIN_LINKING'] == 'shared': libraries.append('boost_system%s' % env['BOOST_APPEND']) - libraries.insert(0,env['MAPNIK_NAME']) libraries.append(env['ICU_LIB_NAME']) TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME, SHLIBPREFIX='', diff --git a/plugins/input/shape/build.py b/plugins/input/shape/build.py index 3f397d02e..abb4e9cdb 100644 --- a/plugins/input/shape/build.py +++ b/plugins/input/shape/build.py @@ -48,7 +48,6 @@ plugin_env.Append(CPPDEFINES=cppdefines) if env['PLUGIN_LINKING'] == 'shared': libraries.append('boost_system%s' % env['BOOST_APPEND']) - libraries.insert(0,env['MAPNIK_NAME']) libraries.append(env['ICU_LIB_NAME']) TARGET = plugin_env.SharedLibrary('../shape', diff --git a/plugins/input/sqlite/build.py b/plugins/input/sqlite/build.py index 3fa7fb600..6c7c7f54c 100644 --- a/plugins/input/sqlite/build.py +++ b/plugins/input/sqlite/build.py @@ -37,7 +37,7 @@ plugin_sources = Split( libraries = [ 'sqlite3' ] linkflags = [] -plugin_env.Append(LINKFLAGS='-lmapnik') + if env['SQLITE_LINKFLAGS']: linkflags.append(env['SQLITE_LINKFLAGS']) plugin_env.Append(LINKFLAGS=linkflags) diff --git a/test/build.py b/test/build.py index 58b816608..9765f4dfa 100644 --- a/test/build.py +++ b/test/build.py @@ -5,10 +5,8 @@ from copy import copy Import ('env') test_env = env.Clone() -test_env.Prepend(LINKFLAGS='-lmapnik')# + test_env['LINKFLAGS'] -test_env.Append(LIBS='/home/artem/projects/mason/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++.a') -#test_env.Append(LIBS='/home/artem/projects/mason/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++abi.a') -#test_env.Append(LIBS='/home/artem/projects/mason/mason_packages/linux-x86_64/llvm/7.0.0/lib/libunwind.a') +test_env['LINKCOM'] = '$LINK -o $TARGET $SOURCES $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS' +test_env['LINKFLAGS'] = '-l%s' % env['MAPNIK_NAME'] + test_env['LINKFLAGS'] if not env['CPP_TESTS']: for cpp_test_bin in glob.glob('./*/*-bin'): @@ -16,7 +14,7 @@ if not env['CPP_TESTS']: if os.path.exists('./unit/run'): os.unlink('./unit/run') if os.path.exists('./visual/run'): os.unlink('./visual/run') else: - test_env['LIBS'] = [env['MAPNIK_NAME']] + test_env['LIBS'] = [] test_env.AppendUnique(LIBS='mapnik-wkt') test_env.AppendUnique(LIBS='mapnik-json') test_env.AppendUnique(LIBS=copy(env['LIBMAPNIK_LIBS'])) @@ -33,11 +31,10 @@ else: test_env['LINKFLAGS'].append('-pthread') test_env.AppendUnique(LIBS='boost_program_options%s' % env['BOOST_APPEND']) test_env_local = test_env.Clone() - + test_env_local['LINKCOM'] = '$LINK -o $TARGET $SOURCES $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS' # unit tests sources = glob.glob('./unit/*/*.cpp') sources.extend(glob.glob('./unit/*.cpp')) - sources.append('/home/artem/projects/mason/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++.a') test_program = test_env_local.Program("./unit/run", source=sources) Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) Depends(test_program, env.subst('../src/json/libmapnik-json${LIBSUFFIX}')) @@ -61,7 +58,6 @@ else: visual/parse_map_sizes.cpp """ ) - source.append('/home/artem/projects/mason/mason_packages/linux-x86_64/llvm/7.0.0/lib/libc++.a') test_program3 = test_env_local.Program('visual/run', source=source) Depends(test_program, env.subst('../src/%s' % env['MAPNIK_LIB_NAME'])) diff --git a/utils/mapnik-index/build.py b/utils/mapnik-index/build.py index 92d2edf7e..052adf1c4 100644 --- a/utils/mapnik-index/build.py +++ b/utils/mapnik-index/build.py @@ -27,7 +27,7 @@ Import ('env') Import ('plugin_base') program_env = plugin_base.Clone() -program_env['LINKFLAGS'] = '-lmapnik plugins/input/csv/csv_utils.os' + program_env['LINKFLAGS'] +program_env['LINKFLAGS'] = '-l%s plugins/input/csv/csv_utils.os' % plugin_base['MAPNIK_NAME'] + program_env['LINKFLAGS'] source = Split( """ mapnik-index.cpp