directly link libmapnik in plugins (not just darwin) - patch from Stella L. - closes #790

This commit is contained in:
Dane Springmeyer 2011-07-05 23:41:17 +00:00
parent 3bbd4b9b3a
commit e84119aed9
14 changed files with 72 additions and 96 deletions

View file

@ -39,6 +39,7 @@ Patches
- Aubrey Holland
- Konstantin Käfer
- Mak Kolybabi
- Stella Laurenzo
- Dennis Luxen
- Tom MacWright
- Michal Migurski

View file

@ -14,6 +14,8 @@ For a complete change history, see the SVN log.
Mapnik Trunk
------------
- Directly link input plugins to libmapnik to avoid having to set dlopen flags from binding languages (#790)
- Throw an error during registration for fonts which Freetype2 does not report a family or style name (r2985).
- Fixed quoting syntax for "table"."attribute" in PostGIS plugin (previously if table aliases were used quoting like "table.attribute" would cause query failure) (r2979).

View file

@ -43,18 +43,6 @@ import os
import sys
import warnings
try:
from ctypes import RTLD_NOW, RTLD_GLOBAL
except ImportError:
try:
from DLFCN import RTLD_NOW, RTLD_GLOBAL
except ImportError:
RTLD_NOW = 2
RTLD_GLOBAL = 256
flags = sys.getdlopenflags()
sys.setdlopenflags(RTLD_NOW | RTLD_GLOBAL)
from _mapnik2 import *
from paths import inputpluginspath, fontscollectionpath
@ -660,9 +648,6 @@ def register_fonts(path=fontscollectionpath,valid_extensions=['.ttf','.otf','.tt
register_plugins()
register_fonts()
#set dlopen flags back to the original
sys.setdlopenflags(flags)
# Explicitly export API members to avoid namespace pollution
# and ensure correct documentation processing
__all__ = [

View file

@ -35,15 +35,14 @@ gdal_src = Split(
libraries = [env['PLUGINS']['gdal']['lib']]
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
input_plugin = plugin_env.SharedLibrary('../gdal', source=gdal_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -36,17 +36,16 @@ geos_src = Split(
libraries = [env['PLUGINS']['geos']['lib']]
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
input_plugin = plugin_env.SharedLibrary('../geos', source=geos_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -34,16 +34,15 @@ kismet_src = Split(
)
libraries = []
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
input_plugin = plugin_env.SharedLibrary('../kismet', source=kismet_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -37,15 +37,13 @@ occi_src = Split(
)
libraries = [ 'occi', 'ociei' ]
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
input_plugin = plugin_env.SharedLibrary('../occi', source=occi_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -38,17 +38,16 @@ ogr_src = Split(
libraries = [env['PLUGINS']['ogr']['lib']]
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
input_plugin = plugin_env.SharedLibrary('../ogr', source=ogr_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -39,15 +39,13 @@ osm_src = Split(
libraries = [ 'xml2' ]
libraries.append('curl')
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
input_plugin = plugin_env.SharedLibrary('../osm', source=osm_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -35,17 +35,16 @@ postgis_src = Split(
libraries = ['pq']
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
if env['THREADING'] == 'multi':
libraries.append('boost_thread%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
if env['THREADING'] == 'multi':
libraries.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['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -35,17 +35,16 @@ raster_src = Split(
)
libraries = []
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
input_plugin = plugin_env.SharedLibrary('../raster', source=raster_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -35,17 +35,16 @@ rasterlite_src = Split(
libraries = [env['PLUGINS']['rasterlite']['lib']]
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
input_plugin = plugin_env.SharedLibrary('../rasterlite', source=rasterlite_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -39,20 +39,19 @@ shape_src = Split(
libraries = []
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
if env['SHAPE_MEMORY_MAPPED_FILE']:
plugin_env.Append(CXXFLAGS = '-DSHAPE_MEMORY_MAPPED_FILE')
input_plugin = plugin_env.SharedLibrary('../shape', SHLIBSUFFIX='.input', source=shape_src, SHLIBPREFIX='', LIBS = libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)

View file

@ -34,17 +34,17 @@ sqlite_src = Split(
)
libraries = [ 'sqlite3' ]
if env['PLATFORM'] == 'Darwin':
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
# Link Library to Dependencies
libraries.append('mapnik2')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
input_plugin = plugin_env.SharedLibrary('../sqlite', source=sqlite_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS'])
if env['PLATFORM'] == 'Darwin':
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin,'../../../src/libmapnik2.dylib')
# if the plugin links to libmapnik2 ensure it is built first
Depends(input_plugin, env.subst('../../../src/${SHLIBPREFIX}mapnik2${SHLIBSUFFIX}'))
if 'uninstall' not in COMMAND_LINE_TARGETS:
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', input_plugin)