fix linking of gdal/ogr plugins when linking to statically built gdal

This commit is contained in:
Dane Springmeyer 2013-06-03 13:43:49 -07:00
parent 5cb6bbe01c
commit a21f883c5c
2 changed files with 16 additions and 10 deletions

View file

@ -21,6 +21,7 @@
Import ('plugin_base')
Import ('env')
from copy import copy
PLUGIN_NAME = 'gdal'
@ -33,18 +34,20 @@ plugin_sources = Split(
""" % locals()
)
# Link Library to Dependencies
libraries = [env['PLUGINS']['gdal']['lib']]
libraries.append('boost_system%s' % env['BOOST_APPEND'])
libraries.append(env['ICU_LIB_NAME'])
plugin_env['LIBS'] = []
if env['RUNTIME_LINK'] == 'static':
cmd = 'gdal-config --dep-libs'
plugin_env.ParseConfig(cmd)
libraries.append('proj')
# Link Library to Dependencies
plugin_env.Append(LIBS=env['PLUGINS']['gdal']['lib'])
libraries = copy(plugin_env['LIBS'])
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',

View file

@ -21,6 +21,7 @@
Import ('plugin_base')
Import ('env')
from copy import copy
PLUGIN_NAME = 'ogr'
@ -35,17 +36,17 @@ plugin_sources = Split(
""" % locals()
)
# Link Library to Dependencies
libraries = [env['PLUGINS']['ogr']['lib']]
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
cxxflags = []
plugin_env['LIBS'] = []
if env['RUNTIME_LINK'] == 'static':
cmd = 'gdal-config --dep-libs'
plugin_env.ParseConfig(cmd)
libraries.append('proj')
# Link Library to Dependencies
plugin_env.Append(LIBS=env['PLUGINS']['ogr']['lib'])
libraries = copy(plugin_env['LIBS'])
if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])
@ -58,6 +59,8 @@ plugin_env.Append(CXXFLAGS=cxxflags)
if env['PLUGIN_LINKING'] == 'shared':
libraries.append('mapnik')
libraries.append(env['ICU_LIB_NAME'])
libraries.append('boost_system%s' % env['BOOST_APPEND'])
TARGET = plugin_env.SharedLibrary('../%s' % PLUGIN_NAME,
SHLIBPREFIX='',