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
This commit is contained in:
Fischlurch 2008-08-21 01:24:46 +02:00
parent 944b7c4dd4
commit 0ece037f91

View file

@ -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