summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-11 18:14:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-11 18:14:56 (GMT)
commitd9a29f93cd4ff505e264974febd0566ae29880ca (patch)
tree6eea9e476374863e93c80aacb76840ac24f0c50f /3rdParty/SCons/scons-local/SCons/SConf.py
parent73f845a3f380c5a1adbac2cf29e9f36cc9b498cf (diff)
downloadswift-d9a29f93cd4ff505e264974febd0566ae29880ca.zip
swift-d9a29f93cd4ff505e264974febd0566ae29880ca.tar.bz2
Update SCons to 1.3.0.d20100404.
Diffstat (limited to '3rdParty/SCons/scons-local/SCons/SConf.py')
-rw-r--r--3rdParty/SCons/scons-local/SCons/SConf.py43
1 files changed, 26 insertions, 17 deletions
diff --git a/3rdParty/SCons/scons-local/SCons/SConf.py b/3rdParty/SCons/scons-local/SCons/SConf.py
index 923247c8..4a80da7 100644
--- a/3rdParty/SCons/scons-local/SCons/SConf.py
+++ b/3rdParty/SCons/scons-local/SCons/SConf.py
@@ -4,7 +4,7 @@ Autoconf-like configuration support.
"""
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -26,7 +26,7 @@ Autoconf-like configuration support.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/SConf.py 4043 2009/02/23 09:06:45 scons"
+__revision__ = "src/engine/SCons/SConf.py 4761 2010/04/04 14:04:44 bdeegan"
import os
import re
@@ -324,7 +324,8 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
env_decider=env.decide_source):
env_decider(dependency, target, prev_ni)
return True
- env.Decider(force_build)
+ if env.decide_source.func_code is not force_build.func_code:
+ env.Decider(force_build)
env['PSTDOUT'] = env['PSTDERR'] = s
try:
sconf.cached = 0
@@ -398,11 +399,11 @@ class SConfBase:
if not SConfFS:
SConfFS = SCons.Node.FS.default_fs or \
SCons.Node.FS.FS(env.fs.pathTop)
- if not sconf_global is None:
+ if sconf_global is not None:
raise (SCons.Errors.UserError,
"Only one SConf object may be active at one time")
self.env = env
- if log_file != None:
+ if log_file is not None:
log_file = SConfFS.File(env.subst(log_file))
self.logfile = log_file
self.logstream = None
@@ -429,7 +430,7 @@ class SConfBase:
self.AddTests(default_tests)
self.AddTests(custom_tests)
self.confdir = SConfFS.Dir(env.subst(conf_dir))
- if not config_h is None:
+ if config_h is not None:
config_h = SConfFS.File(config_h)
self.config_h = config_h
self._startup()
@@ -471,7 +472,7 @@ class SConfBase:
Tries to build the given nodes immediately. Returns 1 on success,
0 on error.
"""
- if self.logstream != None:
+ if self.logstream is not None:
# override stdout / stderr to write in log file
oldStdout = sys.stdout
sys.stdout = self.logstream
@@ -510,7 +511,7 @@ class SConfBase:
SConfFS.set_max_drift(save_max_drift)
os.chdir(old_os_dir)
SConfFS.chdir(old_fs_dir, change_os_dir=0)
- if self.logstream != None:
+ if self.logstream is not None:
# restore stdout / stderr
sys.stdout = oldStdout
sys.stderr = oldStderr
@@ -559,7 +560,7 @@ class SConfBase:
self.env['SPAWN'] = self.pspawn_wrapper
sourcetext = self.env.Value(text)
- if text != None:
+ if text is not None:
textFile = self.confdir.File(f + extension)
textFileNode = self.env.SConfSourceBuilder(target=textFile,
source=sourcetext)
@@ -625,8 +626,8 @@ class SConfBase:
ok = self.TryLink(text, extension)
if( ok ):
prog = self.lastTarget
- pname = str(prog)
- output = SConfFS.File(pname+'.out')
+ pname = prog.path
+ output = self.confdir.File(os.path.basename(pname)+'.out')
node = self.env.Command(output, prog, [ [ pname, ">", "${TARGET}"] ])
ok = self.BuildNodes(node)
if ok:
@@ -645,7 +646,7 @@ class SConfBase:
"Test called after sconf.Finish()")
context = CheckContext(self.sconf)
ret = apply(self.test, (context,) + args, kw)
- if not self.sconf.config_h is None:
+ if self.sconf.config_h is not None:
self.sconf.config_h_text = self.sconf.config_h_text + context.config_h
context.Result("error: no result")
return ret
@@ -685,7 +686,7 @@ class SConfBase:
self._createDir(self.confdir)
self.confdir.up().add_ignore( [self.confdir] )
- if self.logfile != None and not dryrun:
+ if self.logfile is not None and not dryrun:
# truncate logfile, if SConf.Configure is called for the first time
# in a build
if _ac_config_logs.has_key(self.logfile):
@@ -724,7 +725,7 @@ class SConfBase:
if not self.active:
raise SCons.Errors.UserError, "Finish may be called only once!"
- if self.logstream != None and not dryrun:
+ if self.logstream is not None and not dryrun:
self.logstream.write("\n")
self.logstream.close()
self.logstream = None
@@ -784,8 +785,7 @@ class CheckContext:
def Result(self, res):
"""Inform about the result of the test. res may be an integer or a
- string. In case of an integer, the written text will be 'ok' or
- 'failed'.
+ string. In case of an integer, the written text will be 'yes' or 'no'.
The result is only displayed when self.did_show_result is not set.
"""
if type(res) in BooleanTypes:
@@ -854,6 +854,11 @@ class CheckContext:
self.env.Append(LIBS = lib_name_list)
return oldLIBS
+ def PrependLIBS(self, lib_name_list):
+ oldLIBS = self.env.get( 'LIBS', [] )
+ self.env.Prepend(LIBS = lib_name_list)
+ return oldLIBS
+
def SetLIBS(self, val):
oldLIBS = self.env.get( 'LIBS', [] )
self.env.Replace(LIBS = val)
@@ -870,7 +875,7 @@ class CheckContext:
self.Log("scons: Configure: " + msg + "\n")
def Log(self, msg):
- if self.sconf.logstream != None:
+ if self.sconf.logstream is not None:
self.sconf.logstream.write(msg)
#### End of stuff used by Conftest.py.
@@ -944,18 +949,22 @@ def CheckHeader(context, header, include_quotes = '<>', language = None):
def CheckCC(context):
res = SCons.Conftest.CheckCC(context)
+ context.did_show_result = 1
return not res
def CheckCXX(context):
res = SCons.Conftest.CheckCXX(context)
+ context.did_show_result = 1
return not res
def CheckSHCC(context):
res = SCons.Conftest.CheckSHCC(context)
+ context.did_show_result = 1
return not res
def CheckSHCXX(context):
res = SCons.Conftest.CheckSHCXX(context)
+ context.did_show_result = 1
return not res
# Bram: Make this function obsolete? CheckHeader() is more generic.