consistently use pkg-config in both postgis plugin and pgsql2sqlite + use GDAL_CONFIG var in plugins
This commit is contained in:
parent
0c232313d6
commit
e0db6b9a47
3 changed files with 17 additions and 12 deletions
|
@ -38,7 +38,7 @@ plugin_env['LIBS'] = []
|
|||
plugin_env.Append(LIBS=env['PLUGINS']['gdal']['lib'])
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
cmd = 'gdal-config --dep-libs'
|
||||
cmd = '%s --dep-libs' % plugin_env['GDAL_CONFIG']
|
||||
plugin_env.ParseConfig(cmd)
|
||||
|
||||
# Link Library to Dependencies
|
||||
|
|
|
@ -42,7 +42,7 @@ plugin_env['LIBS'] = []
|
|||
plugin_env.Append(LIBS=env['PLUGINS']['ogr']['lib'])
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
cmd = 'gdal-config --dep-libs'
|
||||
cmd = '%s --dep-libs' % plugin_env['GDAL_CONFIG']
|
||||
plugin_env.ParseConfig(cmd)
|
||||
|
||||
# Link Library to Dependencies
|
||||
|
|
|
@ -39,6 +39,20 @@ source = Split(
|
|||
program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
|
||||
program_env['LINKFLAGS'] = copy(env['LIBMAPNIK_LINKFLAGS'])
|
||||
program_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
||||
program_env['LIBS'] = []
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
# pkg-config is more reliable than pg_config across platforms
|
||||
cmd = 'pkg-config libpq --libs --static'
|
||||
try:
|
||||
program_env.ParseConfig(cmd)
|
||||
except OSError, e:
|
||||
program_env.Append(LIBS='pq')
|
||||
else:
|
||||
program_env.Append(LIBS='pq')
|
||||
|
||||
# Link Library to Dependencies
|
||||
libraries = copy(program_env['LIBS'])
|
||||
|
||||
if env['HAS_CAIRO']:
|
||||
program_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
|
||||
|
@ -46,9 +60,8 @@ if env['HAS_CAIRO']:
|
|||
|
||||
program_env.PrependUnique(CPPPATH=['#plugins/input/postgis'])
|
||||
|
||||
libraries = []
|
||||
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||
libraries.extend([boost_program_options,'sqlite3','pq',env['MAPNIK_NAME'],'icuuc'])
|
||||
libraries.extend([boost_program_options,'sqlite3',env['MAPNIK_NAME'],'icuuc'])
|
||||
|
||||
if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
|
||||
boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])
|
||||
|
@ -59,14 +72,6 @@ if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
|
|||
if env['SQLITE_LINKFLAGS']:
|
||||
program_env.Append(LINKFLAGS=env['SQLITE_LINKFLAGS'])
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
if env['PLATFORM'] == 'Darwin':
|
||||
libraries.extend(['ldap', 'pam', 'ssl', 'crypto', 'krb5'])
|
||||
else:
|
||||
# TODO - parse back into libraries variable
|
||||
program_env.ParseConfig('pg_config --libs')
|
||||
libraries.append('dl')
|
||||
|
||||
pgsql2sqlite = program_env.Program('pgsql2sqlite', source, LIBS=libraries)
|
||||
Depends(pgsql2sqlite, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
||||
|
||||
|
|
Loading…
Reference in a new issue