make gdal lib check more robust

This commit is contained in:
Dane Springmeyer 2013-07-29 20:32:03 -04:00
parent 64efd5fdf2
commit 187ab3fe73

View file

@ -615,6 +615,10 @@ def get_pkg_lib(context, config, lib):
if ret:
try:
value = call(cmd,silent=True)
if ' ' in value:
parts = value.split(' ')
if len(parts) > 1:
value = parts[1]
libnames = re.findall(libpattern,value)
if libnames:
libname = libnames[0]
@ -1364,6 +1368,11 @@ if not preconfigured:
conf.parse_config('GDAL_CONFIG',checks='--cflags')
libname = conf.get_pkg_lib('GDAL_CONFIG','gdal')
if libname:
if not conf.CheckLibWithHeader(libname, details['inc'], details['lang']):
env['SKIPPED_DEPS'].append('gdal')
if libname in env['LIBS']:
env['LIBS'].remove(libname)
else:
details['lib'] = libname
elif plugin == 'postgis':
conf.parse_pg_config('PG_CONFIG')
@ -1374,6 +1383,12 @@ if not preconfigured:
conf.parse_config('GDAL_CONFIG',checks='--cflags')
libname = conf.get_pkg_lib('GDAL_CONFIG','ogr')
if libname:
if not conf.CheckLibWithHeader(libname, details['inc'], details['lang']):
if 'gdal' not in env['SKIPPED_DEPS']:
env['SKIPPED_DEPS'].append('gdal')
if libname in env['LIBS']:
env['LIBS'].remove(libname)
else:
details['lib'] = libname
elif details['path'] and details['lib'] and details['inc']:
backup = env.Clone().Dictionary()