From: tho Date: Thu, 12 Aug 2010 09:59:50 +0000 (+0000) Subject: site_scons: added fix for SCons 0.97 compatibility; export BOOST_VERSION to env X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=921f56955af3a51522914f170991692df0e1fd98 site_scons: added fix for SCons 0.97 compatibility; export BOOST_VERSION to env git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1679 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/site_scons/senfconf.py b/site_scons/senfconf.py index 49169fe..89ef0c2 100644 --- a/site_scons/senfconf.py +++ b/site_scons/senfconf.py @@ -2,6 +2,26 @@ _configTests = {} +# Fix for SCons 0.97 compatibility +import SCons.SConf +try: SCons.SConf.SConfBase.Define +except AttributeError: + import string + def Define(self, name, value = None, comment = None): + lines = [] + if comment: + comment_str = "/* %s */" % comment + lines.append(comment_str) + if value is not None: + define_str = "#define %s %s" % (name, value) + else: + define_str = "#define %s" % name + lines.append(define_str) + lines.append('') + self.config_h_text = self.config_h_text + string.join(lines, '\n') + SCons.SConf.SConfBase.Define = Define + + def Tests(): global _configTests return _configTests @@ -32,9 +52,11 @@ def CheckBoostVersion(context): ".cc")[-1].strip() if not ret: context.Result("no boost includes found") + context.env.Replace( BOOST_VERSION = '' ) return None else: context.Result(ret) + context.env.Replace( BOOST_VERSION = ret ) return ret @Test