From 48c4a86abbbcad13d5d126ee1905ffa72204fe80 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 5 Feb 2011 02:12:22 +0000 Subject: [PATCH] backport r2570 from trunk - fix for gdal framework installer --- SConstruct | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 30a92294a..450b5360e 100644 --- a/SConstruct +++ b/SConstruct @@ -446,7 +446,17 @@ def parse_config(context, config, checks='--libs --cflags'): parsed = False if ret: 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') + env['LIBPATH'].insert(0,'/Library/Frameworks/GDAL.framework/unix/lib') + else: + env.ParseConfig(cmd) parsed = True except OSError, e: ret = False @@ -456,7 +466,7 @@ def parse_config(context, config, checks='--libs --cflags'): env['SKIPPED_DEPS'].append(tool) conf.rollback_option('GDAL_CONFIG') else: - env['MISSING_DEPS'].append(tool) + env['MISSING_DEPS'].append(tool) context.Result( ret ) return ret @@ -470,9 +480,13 @@ def get_pkg_lib(context, config, lib): parsed = False if ret: try: - libnames = re.findall(libpattern,call(cmd,silent=True)) + value = call(cmd,silent=True) + libnames = re.findall(libpattern,value) if libnames: - libname = libnames[0] + libname = libnames[0] + else: + # osx 1.8 install gives '-framework GDAL' + libname = 'gdal' except Exception, e: ret = False print ' unable to determine library name:'# %s' % str(e)