From 0ece037f9145b0c2a3465e7320836c6de6ee8187 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 21 Aug 2008 01:24:46 +0200 Subject: [PATCH] make build work again with SCons 0.96 Added a conditional switch to use the pre-0.98-fix only for the old SCons versions --- admin/scons/LumieraEnvironment.py | 36 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/admin/scons/LumieraEnvironment.py b/admin/scons/LumieraEnvironment.py index 8e39dd516..2d8f1bb01 100644 --- a/admin/scons/LumieraEnvironment.py +++ b/admin/scons/LumieraEnvironment.py @@ -22,7 +22,8 @@ ##################################################################### -from SCons.SConf import SConfBase +import SCons +import SCons.SConf from SCons.Environment import Environment from Buildhelper import * @@ -76,22 +77,35 @@ class LumieraEnvironment(Environment): libInfo.ParseConfig ('pkg-config --cflags --libs '+ libID ) return libInfo -# def Glob (self, pattern): -# """ temporary workaround; newer versions of SCons provide this as a global function """ -# pattern = self.subst(pattern) -# return glob.glob(pattern) - -# def AddMethod (self, function): -# """ temporary workaround; newer versions of SCons provide this as a global function """ -# self.__dict__[function.__name__] = function.__get__(self) + def Glob (self, pattern): + """ temporary workaround; newer versions of SCons provide this as a global function """ + pattern = self.subst(pattern) + return glob.glob(pattern) + def AddMethod (self, function): + """ temporary workaround; newer versions of SCons provide this as a global function """ + self.__dict__[function.__name__] = function.__get__(self) + + +#### temporary pre 1.0 SCons compatibility hack #### +_ver = map(int, SCons.__version__.split('.')) +_old = (_ver[0]<1 and _ver[1]<98) +if _old: + ConfigBase = SCons.SConf.SConf +else: + ConfigBase = SCons.SConf.SConfBase + del LumieraEnvironment.Glob + del LumieraEnvironment.AddMethod + # use the official impl present since SCons 0.98 + # use the new name of the config context base class -class LumieraConfigContext(SConfBase): + +class LumieraConfigContext(ConfigBase): """ Extends the SCons Configure context with some convenience methods """ def __init__(self, *args,**kw): - SConfBase.__init__(self,*args,**kw) + ConfigBase.__init__(self,*args,**kw) def CheckPkgConfig (self, libID, minVersion=0): print "Checking for library configuration: %s " % libID