\c senfutil automatically parses SCons command line arguments into the SCons build
environment. This allows specifying any parameter on the command line:
<pre>
- $ scons CXXCOM=mygcc CXXFLAGS+=-mtune=geode
+ $ scons CXX=myg++ CXXFLAGS+=-mtune=geode
</pre>
You may either set variables unconditionally using '=' or append values to the end of a list
using '+='.
import sys, glob, os.path, fnmatch
import SENFSCons, senfutil
+try:
+ BoolVariable
+except NameError:
+ BoolVariable = BoolOption
+
###########################################################################
# Load utilities and setup libraries and configure build
import os.path
from SCons.Script import *
+# Fix for SCons 0.97 compatibility
+try:
+ Variables
+except NameError:
+ Variables = Options
+ BoolVariable = BoolOption
+
def parseLogOption(value):
stream, area, level = ( x.strip() for x in value.strip().split('|') )
stream = ''.join('(%s)' % x for x in stream.split('::') )
def parseArguments(env, *defs):
vars = Variables(args=ARGUMENTS)
- vars.AddVariables(*defs)
+ for d in defs : vars.Add(d)
vars.Update(env)
env.Help("""
Any construction environment variable may be set from the scons
Special command line parameters:
""")
env.Help(vars.GenerateHelpText(env))
- for k,v in vars.UnknownVariables().iteritems():
+ try : unknv = vars.UnknownVariables()
+ except AttributeError: unknv = vars.UnknownOptions()
+ for k,v in unknv.iteritems():
if k.endswith('+'):
env.Append(**{k[:-1]: v})
else: