better workaround for unsupported GDAL framework linking on osx

This commit is contained in:
Dane Springmeyer 2011-02-23 21:24:23 +00:00
parent 9d351be091
commit 3b295143bc

View file

@ -521,14 +521,17 @@ def parse_config(context, config, checks='--libs --cflags'):
parsed = False
if ret:
try:
if 'gdal-config' in cmd:
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']:
# TODO - upgrade our scons logic to support Framework linking
if env['PLATFORM'] == 'Darwin':
value = call(cmd,silent=True)
if value and '-framework GDAL' in value:
env['LIBS'].append('gdal')
if os.path.exists('/Library/Frameworks/GDAL.framework/unix/lib'):
env['LIBPATH'].insert(0,'/Library/Frameworks/GDAL.framework/unix/lib')
if 'GDAL' in env.get('FRAMEWORKS',[]):
env["FRAMEWORKS"].remove("GDAL")