Permalink
Browse files

scons: port minor build fixes from master to make building os x binar…

…ies (against static icu and libpq) easier
  • Loading branch information...
1 parent c8848c8 commit 51bf0ef2a5e3e93c8542d7f35423fe4e69885dcb Dane Springmeyer committed Jun 15, 2012
Showing with 24 additions and 6 deletions.
  1. +3 −0 SConstruct
  2. +13 −5 plugins/input/postgis/build.py
  3. +8 −1 src/build.py
View
@@ -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 <boost/regex/icu.hpp>
@@ -32,15 +32,23 @@
"""
)
-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']))
View
@@ -55,7 +55,10 @@ def ldconfig(*args,**kwargs):
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 @@ def ldconfig(*args,**kwargs):
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'

0 comments on commit 51bf0ef

Please sign in to comment.