diff --git a/SConstruct b/SConstruct index 3075160f7..195867475 100644 --- a/SConstruct +++ b/SConstruct @@ -834,6 +834,9 @@ int main() return False def boost_regex_has_icu(context): + if env['RUNTIME_LINK'] == 'static': + context.env.Append(LIBS='icui18n') + context.env.Append(LIBS='icudata') ret = context.TryRun(""" #include diff --git a/plugins/input/postgis/build.py b/plugins/input/postgis/build.py index f9961b564..5b2996bbc 100644 --- a/plugins/input/postgis/build.py +++ b/plugins/input/postgis/build.py @@ -32,15 +32,23 @@ postgis_src = Split( """ ) -libraries = ['pq'] +# clear out and rebuild libs +plugin_env['LIBS'] = ['pq'] # Link Library to Dependencies -libraries.append('mapnik') -libraries.append(env['ICU_LIB_NAME']) +plugin_env['LIBS'].append('mapnik') +plugin_env['LIBS'].append(env['ICU_LIB_NAME']) if env['THREADING'] == 'multi': - libraries.append('boost_thread%s' % env['BOOST_APPEND']) + plugin_env['LIBS'].append('boost_thread%s' % env['BOOST_APPEND']) -input_plugin = plugin_env.SharedLibrary('../postgis', source=postgis_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS']) +if env['RUNTIME_LINK'] == 'static': + #cmd = 'pg_config --libs' + #plugin_env.ParseConfig(cmd) + # pg_config does not seem to report correct deps of libpq + # so resort to hardcoding for now + plugin_env['LIBS'].extend(['ldap','pam','ssl','crypto','krb5']) + +input_plugin = plugin_env.SharedLibrary('../postgis', source=postgis_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LINKFLAGS=env['CUSTOM_LDFLAGS']) # if the plugin links to libmapnik ensure it is built first Depends(input_plugin, env.subst('../../../src/%s' % env['MAPNIK_LIB_NAME'])) diff --git a/src/build.py b/src/build.py index d702b4aea..72a7326fa 100644 --- a/src/build.py +++ b/src/build.py @@ -55,7 +55,10 @@ filesystem = 'boost_filesystem%s' % env['BOOST_APPEND'] regex = 'boost_regex%s' % env['BOOST_APPEND'] # 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] +lib_env['LIBS'] = ['freetype','ltdl','png','tiff','z','proj',env['ICU_LIB_NAME'],filesystem,regex] + +if env['JPEG']: + lib_env['LIBS'].append('jpeg') if len(env['EXTRA_FREETYPE_LIBS']): lib_env['LIBS'].extend(copy(env['EXTRA_FREETYPE_LIBS'])) @@ -77,6 +80,10 @@ if not env['RUNTIME_LINK'] == 'static': else: lib_env['LIBS'].append([lib for lib in env['LIBS'] if lib.startswith('agg')]) +if env['RUNTIME_LINK'] == 'static': + if 'icuuc' in env['ICU_LIB_NAME']: + lib_env['LIBS'].append('icudata') + lib_env['LIBS'].append('icui18n') if env['PLATFORM'] == 'Darwin': mapnik_libname = 'libmapnik.dylib'