scons: handle a gdal-config --libs that reports -framework GDAL on osx
This commit is contained in:
parent
ca8e241006
commit
f1e1900480
1 changed files with 16 additions and 3 deletions
19
SConstruct
19
SConstruct
|
@ -521,7 +521,16 @@ def parse_config(context, config, checks='--libs --cflags'):
|
||||||
parsed = False
|
parsed = False
|
||||||
if ret:
|
if ret:
|
||||||
try:
|
try:
|
||||||
env.ParseConfig(cmd)
|
# hack for potential -framework GDAL syntax
|
||||||
|
# which will not end up being added to env['LIBS']
|
||||||
|
# and thus breaks knowledge below that gdal worked
|
||||||
|
if 'gdal-config' in cmd:
|
||||||
|
num_libs = len(env['LIBS'])
|
||||||
|
env.ParseConfig(cmd)
|
||||||
|
if not num_libs > env['LIBS']:
|
||||||
|
env['LIBS'].append('gdal')
|
||||||
|
else:
|
||||||
|
env.ParseConfig(cmd)
|
||||||
parsed = True
|
parsed = True
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
ret = False
|
ret = False
|
||||||
|
@ -546,9 +555,13 @@ def get_pkg_lib(context, config, lib):
|
||||||
parsed = False
|
parsed = False
|
||||||
if ret:
|
if ret:
|
||||||
try:
|
try:
|
||||||
libnames = re.findall(libpattern,call(cmd,silent=True))
|
value = call(cmd,silent=True)
|
||||||
|
libnames = re.findall(libpattern,value)
|
||||||
if libnames:
|
if libnames:
|
||||||
libname = libnames[0]
|
libname = libnames[0]
|
||||||
|
else:
|
||||||
|
# osx 1.8 install gives '-framework GDAL'
|
||||||
|
libname = 'gdal'
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
ret = False
|
ret = False
|
||||||
print ' unable to determine library name:'# %s' % str(e)
|
print ' unable to determine library name:'# %s' % str(e)
|
||||||
|
|
Loading…
Reference in a new issue