[cig-commits] commit: SCons has a bug involving RPATHs and the GNU mac

Mercurial hg at geodynamics.org
Mon Nov 24 11:22:44 PST 2008


changeset:   25:aae43104d6c8
user:        LukeHodkinson
date:        Mon Feb 11 03:15:38 2008 +0000
files:       SConstruct
description:
SCons has a bug involving RPATHs and the GNU mac
os x linker.  While they've actually fixed the problem
it won't be around until the next SCons release.
I've thrown in a brutal hack to get around the
issue now.


diff -r af0c54c31d8c -r aae43104d6c8 SConstruct
--- a/SConstruct	Mon Feb 11 03:13:57 2008 +0000
+++ b/SConstruct	Mon Feb 11 03:15:38 2008 +0000
@@ -8,7 +8,7 @@ EnsureSConsVersion(0, 97)
 # Create our substitution environment.
 #
 
-env = Environment(CC='cc', ENV=os.environ)
+env = Environment(ENV=os.environ)
 
 # Include our SCons utils (hopefully they'll add stuff to do 
 # these things we need).
@@ -47,15 +47,31 @@ opts.Update(env)
 opts.Update(env)
 opts.Save('config.cache', env)
 
+# BEGIN MAC HACK FIX
+import SCons.Util
+env['LINKFLAGS'] = SCons.Util.CLVar('')
+env['RPATHPREFIX'] = ''
+env['RPATHSUFFIX'] = ''
+env['_RPATH'] = ''
+# END MAC HACK FIX
+
 # Generate some help text at this point.
 env.Help(opts.GenerateHelpText(env))
 
 # We need to add these guys so we don't get dictionary key errors.
 env['CPPPATH'] = env['CPPPATH'] if 'CPPPATH' in env._dict else []
+env['CPPFLAGS'] = env['CPPFLAGS'] if 'CPPFLAGS' in env._dict else []
 env['LIBPATH'] = env['LIBPATH'] if 'LIBPATH' in env._dict else []
 env['CPPDEFINES'] = env['CPPDEFINES'] if 'CPPDEFINES' in env._dict else []
 env['LIBS'] = env['LIBS'] if 'LIBS' in env._dict else []
 env['RPATH'] = env['RPATH'] if 'RPATH' in env._dict else []
+
+# Setup all our StGermain specific utilities.
+SConscript('StgSCons', exports='env')
+
+# Configure the environment.
+build_opts = False
+SConscript('SConfigure', exports='env opts build_opts')
 
 # Add any variables that get used throughout the whole build.
 if env['debug']:
@@ -65,16 +81,6 @@ env.Prepend(LIBPATH=['#build/lib'])
 
 # Setup any additional build targets.
 env.Alias('install', env['prefix'])
-
-# Setup all our StGermain specific utilities.
-SConscript('StgSCons', exports='env')
-
-#
-# Configuration section.
-#
-
-build_opts = False
-SConscript('SConfigure', exports='env opts build_opts')
 
 #
 # Call target SConscripts.



More information about the CIG-COMMITS mailing list