From: g0dil Date: Fri, 28 Aug 2009 15:57:25 +0000 (+0000) Subject: Compatibility workarounds for SCons 0.97 (hardy) X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=8715a32e62efafee5a9681f3f3ee8d18c4bf2859;p=senf.git Compatibility workarounds for SCons 0.97 (hardy) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1354 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Mainpage.dox b/Mainpage.dox index e535169..2fd5529 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -170,7 +170,7 @@ \c senfutil automatically parses SCons command line arguments into the SCons build environment. This allows specifying any parameter on the command line:
-    $ scons CXXCOM=mygcc CXXFLAGS+=-mtune=geode
+    $ scons CXX=myg++ CXXFLAGS+=-mtune=geode
     
You may either set variables unconditionally using '=' or append values to the end of a list using '+='. diff --git a/SConstruct b/SConstruct index f9ce745..64376fa 100644 --- a/SConstruct +++ b/SConstruct @@ -3,6 +3,11 @@ import sys, glob, os.path, fnmatch import SENFSCons, senfutil +try: + BoolVariable +except NameError: + BoolVariable = BoolOption + ########################################################################### # Load utilities and setup libraries and configure build diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 25e1249..1cb88e3 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -1,6 +1,13 @@ 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('::') ) @@ -24,7 +31,7 @@ class BuildTypeOptions: 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 @@ -37,7 +44,9 @@ of variables) using 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: