diff --git a/SConstruct b/SConstruct index e54db3c72..b3dc059df 100644 --- a/SConstruct +++ b/SConstruct @@ -144,6 +144,7 @@ opts.AddVariables( ('XML2_CONFIG', 'The path to the xml2-config executable.', 'xml2-config'), PathVariable('ICU_INCLUDES', 'Search path for ICU include files', '/usr/include', PathVariable.PathAccept), PathVariable('ICU_LIBS','Search path for ICU include files','/usr/' + LIBDIR_SCHEMA, PathVariable.PathAccept), + ('ICU_LIB_NAME', 'The library name for icu (such as icuuc, sicuuc, or icucore)', 'icuuc'), PathVariable('PNG_INCLUDES', 'Search path for libpng include files', '/usr/include', PathVariable.PathAccept), PathVariable('PNG_LIBS','Search path for libpng include files','/usr/' + LIBDIR_SCHEMA, PathVariable.PathAccept), PathVariable('JPEG_INCLUDES', 'Search path for libjpeg include files', '/usr/include', PathVariable.PathAccept), @@ -653,10 +654,18 @@ if not preconfigured: ['z', 'zlib.h', True,'C'], ['jpeg', ['stdio.h', 'jpeglib.h'], True,'C'], ['proj', 'proj_api.h', True,'C'], - ['icuuc','unicode/unistr.h',True,'C++'], - ['icudata','unicode/utypes.h' , True,'C++'], + [env['ICU_LIB_NAME'],'unicode/unistr.h',True,'C++'], ] - + + # allow for mac osx /usr/lib/libicucore.dylib compatibility + # requires custom supplied headers since Apple does not include them + # details: http://lists.apple.com/archives/xcode-users/2005/Jun/msg00633.html + # To use system lib download and make && make install one of these: + http://www.opensource.apple.com/tarballs/ICU/ + # then copy the headers to a location that mapnik will find + if env['ICU_LIB_NAME'] == 'icucore': + env.Append(CXXFLAGS = '-DU_HIDE_DRAFT_API') + env.Append(CXXFLAGS = '-DUDISABLE_RENAMING') for libinfo in LIBSHEADERS: if not conf.CheckLibWithHeader(libinfo[0], libinfo[1], libinfo[3]): diff --git a/bindings/python/SConscript b/bindings/python/SConscript index bdc44df03..7c1dad99c 100644 --- a/bindings/python/SConscript +++ b/bindings/python/SConscript @@ -33,8 +33,7 @@ libraries = ['mapnik','png','jpeg'] libraries.append('boost_python%s' % env['BOOST_APPEND']) if env['PLATFORM'] == 'Darwin': - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_regex%s' % env['BOOST_APPEND']) if env['THREADING'] == 'multi': libraries.append('boost_thread%s' % env['BOOST_APPEND']) diff --git a/demo/c++/SConscript b/demo/c++/SConscript index 8f734d718..c5bf402ff 100644 --- a/demo/c++/SConscript +++ b/demo/c++/SConscript @@ -41,8 +41,7 @@ if '-DHAVE_CAIRO' in env['CXXFLAGS']: libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) if env['PLATFORM'] == 'Darwin': - libraries.append('icuuc') - #libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) rundemo = env.Program('rundemo', source, CPPPATH=headers, LIBS=libraries) diff --git a/plugins/input/gdal/SConscript b/plugins/input/gdal/SConscript index ef1ba49f7..f9bb57246 100644 --- a/plugins/input/gdal/SConscript +++ b/plugins/input/gdal/SConscript @@ -34,8 +34,7 @@ gdal_src = Split( libraries = [env['PLUGINS']['gdal']['lib']] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) gdal_inputdriver = env.SharedLibrary('gdal', source=gdal_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) diff --git a/plugins/input/kismet/SConscript b/plugins/input/kismet/SConscript index 6b49451d8..549023261 100644 --- a/plugins/input/kismet/SConscript +++ b/plugins/input/kismet/SConscript @@ -34,8 +34,7 @@ kismet_src = Split( libraries = [] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_thread%s' % env['BOOST_APPEND']) kismet_inputdriver = env.SharedLibrary('kismet', source=kismet_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) diff --git a/plugins/input/occi/SConscript b/plugins/input/occi/SConscript index 0dca85c33..9d48cef7a 100644 --- a/plugins/input/occi/SConscript +++ b/plugins/input/occi/SConscript @@ -37,8 +37,7 @@ occi_src = Split( libraries = [ 'occi', 'ociei' ] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) occi_inputdriver = env.SharedLibrary('occi', source=occi_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) diff --git a/plugins/input/ogr/SConscript b/plugins/input/ogr/SConscript index 95a140e3f..c73277b12 100644 --- a/plugins/input/ogr/SConscript +++ b/plugins/input/ogr/SConscript @@ -40,8 +40,7 @@ if env['PLATFORM'] == 'Darwin': boost_system = 'boost_system%s' % env['BOOST_APPEND'] libraries.append(boost_system) libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_iostreams%s' % env['BOOST_APPEND']) ogr_inputdriver = env.SharedLibrary('ogr', source=ogr_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) diff --git a/plugins/input/osm/SConscript b/plugins/input/osm/SConscript index 2ba447cff..9c7b84d2a 100644 --- a/plugins/input/osm/SConscript +++ b/plugins/input/osm/SConscript @@ -39,8 +39,7 @@ libraries = [ 'xml2' ] libraries.append('curl') if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) osm_inputdriver = env.SharedLibrary('osm', source=osm_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) diff --git a/plugins/input/postgis/SConscript b/plugins/input/postgis/SConscript index 667e7f4e6..b0a069cd1 100644 --- a/plugins/input/postgis/SConscript +++ b/plugins/input/postgis/SConscript @@ -35,8 +35,7 @@ libraries = ['pq'] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) if env['THREADING'] == 'multi': libraries.append('boost_thread%s' % env['BOOST_APPEND']) diff --git a/plugins/input/raster/SConscript b/plugins/input/raster/SConscript index afd7c6998..ea3bc2924 100644 --- a/plugins/input/raster/SConscript +++ b/plugins/input/raster/SConscript @@ -35,8 +35,7 @@ raster_src = Split( libraries = [] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) diff --git a/plugins/input/shape/SConscript b/plugins/input/shape/SConscript index cb29fe4ef..526e58065 100644 --- a/plugins/input/shape/SConscript +++ b/plugins/input/shape/SConscript @@ -40,8 +40,7 @@ libraries = ['boost_iostreams%s' % env['BOOST_APPEND']] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) diff --git a/plugins/input/sqlite/SConscript b/plugins/input/sqlite/SConscript index b502c6957..2746617d2 100644 --- a/plugins/input/sqlite/SConscript +++ b/plugins/input/sqlite/SConscript @@ -34,8 +34,7 @@ sqlite_src = Split( libraries = [ 'sqlite3' ] if env['PLATFORM'] == 'Darwin': libraries.append('mapnik') - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) diff --git a/src/SConscript b/src/SConscript index 38a7b88d0..65e3626b1 100644 --- a/src/SConscript +++ b/src/SConscript @@ -36,7 +36,7 @@ install_prefix = env['DESTDIR'] + '/' + prefix filesystem = 'boost_filesystem%s' % env['BOOST_APPEND'] regex = 'boost_regex%s' % env['BOOST_APPEND'] -libraries = ['freetype','ltdl','png','tiff','z','jpeg','proj','icuuc',filesystem,regex] +libraries = ['freetype','ltdl','png','tiff','z','jpeg','proj',env['ICU_LIB_NAME'],filesystem,regex] if '-DHAVE_CAIRO' in env['CXXFLAGS']: # add cairo and cairomm-1.0 to libs @@ -49,7 +49,6 @@ if env['THREADING'] == 'multi': libraries.append('boost_thread%s' % env['BOOST_APPEND']) if env['PLATFORM'] == 'Darwin': - #libraries.append('icudata') if env['BOOST_SYSTEM_REQUIRED']: libraries.append('boost_system%s' % env['BOOST_APPEND']) diff --git a/utils/ogrindex/SConscript b/utils/ogrindex/SConscript index c21c91d51..5118ac0d0 100644 --- a/utils/ogrindex/SConscript +++ b/utils/ogrindex/SConscript @@ -43,8 +43,7 @@ if env['PLATFORM'] == 'Darwin': if env['BOOST_SYSTEM_REQUIRED']: boost_system = 'boost_system%s' % env['BOOST_APPEND'] libraries.append(boost_system) - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) ogrindex = env.Program('ogrindex', source, CPPPATH=headers, LIBS=libraries) diff --git a/utils/pgsql2sqlite/SConscript b/utils/pgsql2sqlite/SConscript index f25a24158..ed2bca090 100644 --- a/utils/pgsql2sqlite/SConscript +++ b/utils/pgsql2sqlite/SConscript @@ -39,8 +39,7 @@ boost_thread = 'boost_thread%s' % env['BOOST_APPEND'] libraries = [boost_program_options,boost_thread,'sqlite3','pq','mapnik'] if env['PLATFORM'] == 'Darwin': - libraries.append('icuuc') - libraries.append('icudata') + libraries.append(env['ICU_LIB_NAME']) pgsql2sqlite = env.Program('pgsql2sqlite', source, CPPPATH=headers, LIBS=libraries)