Added support for easily importing additional environment variables into the SCons build.
Optimized strict equality checks.
Fixed crash in indexed setters on objects without a corresponding getter (issue 298).
Re-enabled script compilation cache.
git-svn-id: http://v8.googlecode.com/svn/trunk@1682 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/SConstruct b/SConstruct
index 68b7793..9654ebd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -507,7 +507,8 @@
result = Options()
result.Add('mode', 'compilation mode (debug, release)', 'release')
result.Add('sample', 'build sample (shell, process)', '')
- result.Add('env', 'override environment settings (NAME1:value1,NAME2:value2)', '')
+ result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '')
+ result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
for (name, option) in SIMPLE_OPTIONS.iteritems():
help = '%s (%s)' % (name, ", ".join(option['values']))
result.Add(name, help, option.get('default'))
@@ -626,9 +627,13 @@
options['arch'] = options['simulator']
-def ParseEnvOverrides(arg):
- # The environment overrides are in the format NAME1:value1,NAME2:value2
+def ParseEnvOverrides(arg, imports):
+ # The environment overrides are in the format NAME0:value0,NAME1:value1,...
+ # The environment imports are in the format NAME0,NAME1,...
overrides = {}
+ for var in imports.split(','):
+ if var in os.environ:
+ overrides[var] = os.environ[var]
for override in arg.split(','):
pos = override.find(':')
if pos == -1:
@@ -726,7 +731,7 @@
env = Environment(options=opts)
Help(opts.GenerateHelpText(env))
VerifyOptions(env)
- env_overrides = ParseEnvOverrides(env['env'])
+ env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
SourceSignatures(env['sourcesignatures'])