Add ability to link to custom icu lib name, and remove the unneeded linking to icudata on osx, while offering compiler flags required for compiling against libicucore provided by Apple

This commit is contained in:
Dane Springmeyer 2009-11-24 20:32:41 +00:00
parent 75d67f4b43
commit b104253d9c
15 changed files with 26 additions and 31 deletions

View file

@ -144,6 +144,7 @@ opts.AddVariables(
('XML2_CONFIG', 'The path to the xml2-config executable.', 'xml2-config'), ('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_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), 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_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('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), 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'], ['z', 'zlib.h', True,'C'],
['jpeg', ['stdio.h', 'jpeglib.h'], True,'C'], ['jpeg', ['stdio.h', 'jpeglib.h'], True,'C'],
['proj', 'proj_api.h', True,'C'], ['proj', 'proj_api.h', True,'C'],
['icuuc','unicode/unistr.h',True,'C++'], [env['ICU_LIB_NAME'],'unicode/unistr.h',True,'C++'],
['icudata','unicode/utypes.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: for libinfo in LIBSHEADERS:
if not conf.CheckLibWithHeader(libinfo[0], libinfo[1], libinfo[3]): if not conf.CheckLibWithHeader(libinfo[0], libinfo[1], libinfo[3]):

View file

@ -33,8 +33,7 @@ libraries = ['mapnik','png','jpeg']
libraries.append('boost_python%s' % env['BOOST_APPEND']) libraries.append('boost_python%s' % env['BOOST_APPEND'])
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
libraries.append('boost_regex%s' % env['BOOST_APPEND']) libraries.append('boost_regex%s' % env['BOOST_APPEND'])
if env['THREADING'] == 'multi': if env['THREADING'] == 'multi':
libraries.append('boost_thread%s' % env['BOOST_APPEND']) libraries.append('boost_thread%s' % env['BOOST_APPEND'])

View file

@ -41,8 +41,7 @@ if '-DHAVE_CAIRO' in env['CXXFLAGS']:
libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')]) libraries.append([lib for lib in env['LIBS'] if lib.startswith('cairo')])
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
#libraries.append('icudata')
rundemo = env.Program('rundemo', source, CPPPATH=headers, LIBS=libraries) rundemo = env.Program('rundemo', source, CPPPATH=headers, LIBS=libraries)

View file

@ -34,8 +34,7 @@ gdal_src = Split(
libraries = [env['PLUGINS']['gdal']['lib']] libraries = [env['PLUGINS']['gdal']['lib']]
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
gdal_inputdriver = env.SharedLibrary('gdal', source=gdal_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) gdal_inputdriver = env.SharedLibrary('gdal', source=gdal_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries)

View file

@ -34,8 +34,7 @@ kismet_src = Split(
libraries = [] libraries = []
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
libraries.append('boost_thread%s' % env['BOOST_APPEND']) libraries.append('boost_thread%s' % env['BOOST_APPEND'])
kismet_inputdriver = env.SharedLibrary('kismet', source=kismet_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) kismet_inputdriver = env.SharedLibrary('kismet', source=kismet_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries)

View file

@ -37,8 +37,7 @@ occi_src = Split(
libraries = [ 'occi', 'ociei' ] libraries = [ 'occi', 'ociei' ]
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
occi_inputdriver = env.SharedLibrary('occi', source=occi_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) occi_inputdriver = env.SharedLibrary('occi', source=occi_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries)

View file

@ -40,8 +40,7 @@ if env['PLATFORM'] == 'Darwin':
boost_system = 'boost_system%s' % env['BOOST_APPEND'] boost_system = 'boost_system%s' % env['BOOST_APPEND']
libraries.append(boost_system) libraries.append(boost_system)
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
libraries.append('boost_iostreams%s' % env['BOOST_APPEND']) libraries.append('boost_iostreams%s' % env['BOOST_APPEND'])
ogr_inputdriver = env.SharedLibrary('ogr', source=ogr_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) ogr_inputdriver = env.SharedLibrary('ogr', source=ogr_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries)

View file

@ -39,8 +39,7 @@ libraries = [ 'xml2' ]
libraries.append('curl') libraries.append('curl')
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
osm_inputdriver = env.SharedLibrary('osm', source=osm_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries) osm_inputdriver = env.SharedLibrary('osm', source=osm_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries)

View file

@ -35,8 +35,7 @@ libraries = ['pq']
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
if env['THREADING'] == 'multi': if env['THREADING'] == 'multi':
libraries.append('boost_thread%s' % env['BOOST_APPEND']) libraries.append('boost_thread%s' % env['BOOST_APPEND'])

View file

@ -35,8 +35,7 @@ raster_src = Split(
libraries = [] libraries = []
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])

View file

@ -40,8 +40,7 @@ libraries = ['boost_iostreams%s' % env['BOOST_APPEND']]
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])

View file

@ -34,8 +34,7 @@ sqlite_src = Split(
libraries = [ 'sqlite3' ] libraries = [ 'sqlite3' ]
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik') libraries.append('mapnik')
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])

View file

@ -36,7 +36,7 @@ install_prefix = env['DESTDIR'] + '/' + prefix
filesystem = 'boost_filesystem%s' % env['BOOST_APPEND'] filesystem = 'boost_filesystem%s' % env['BOOST_APPEND']
regex = 'boost_regex%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']: if '-DHAVE_CAIRO' in env['CXXFLAGS']:
# add cairo and cairomm-1.0 to libs # add cairo and cairomm-1.0 to libs
@ -49,7 +49,6 @@ if env['THREADING'] == 'multi':
libraries.append('boost_thread%s' % env['BOOST_APPEND']) libraries.append('boost_thread%s' % env['BOOST_APPEND'])
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
#libraries.append('icudata')
if env['BOOST_SYSTEM_REQUIRED']: if env['BOOST_SYSTEM_REQUIRED']:
libraries.append('boost_system%s' % env['BOOST_APPEND']) libraries.append('boost_system%s' % env['BOOST_APPEND'])

View file

@ -43,8 +43,7 @@ if env['PLATFORM'] == 'Darwin':
if env['BOOST_SYSTEM_REQUIRED']: if env['BOOST_SYSTEM_REQUIRED']:
boost_system = 'boost_system%s' % env['BOOST_APPEND'] boost_system = 'boost_system%s' % env['BOOST_APPEND']
libraries.append(boost_system) libraries.append(boost_system)
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
ogrindex = env.Program('ogrindex', source, CPPPATH=headers, LIBS=libraries) ogrindex = env.Program('ogrindex', source, CPPPATH=headers, LIBS=libraries)

View file

@ -39,8 +39,7 @@ boost_thread = 'boost_thread%s' % env['BOOST_APPEND']
libraries = [boost_program_options,boost_thread,'sqlite3','pq','mapnik'] libraries = [boost_program_options,boost_thread,'sqlite3','pq','mapnik']
if env['PLATFORM'] == 'Darwin': if env['PLATFORM'] == 'Darwin':
libraries.append('icuuc') libraries.append(env['ICU_LIB_NAME'])
libraries.append('icudata')
pgsql2sqlite = env.Program('pgsql2sqlite', source, CPPPATH=headers, LIBS=libraries) pgsql2sqlite = env.Program('pgsql2sqlite', source, CPPPATH=headers, LIBS=libraries)