Allow the environment to override certain flags.
authorAlan Hourihane <alanh@vmware.com>
Tue, 26 Jan 2010 19:14:16 +0000 (19:14 +0000)
committerAlan Hourihane <alanh@vmware.com>
Tue, 26 Jan 2010 19:14:50 +0000 (19:14 +0000)
SConstruct

index ff06b9b5921c20d0901dd0ab77fd715f57da84c2..0770fe43e7fd40e768de3420d796a51f4691efc1 100644 (file)
@@ -59,6 +59,17 @@ env = Environment(
        ENV = os.environ,
 )
 
+if os.environ.has_key('CC'):
+       env['CC'] = os.environ['CC']
+if os.environ.has_key('CFLAGS'):
+       env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+if os.environ.has_key('CXX'):
+       env['CXX'] = os.environ['CXX']
+if os.environ.has_key('CXXFLAGS'):
+       env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+if os.environ.has_key('LDFLAGS'):
+       env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+
 Help(opts.GenerateHelpText(env))
 
 # replicate options values in local variables