diff options
Diffstat (limited to '3rdParty/SCons/scons-local/SCons/Environment.py')
-rw-r--r-- | 3rdParty/SCons/scons-local/SCons/Environment.py | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/3rdParty/SCons/scons-local/SCons/Environment.py b/3rdParty/SCons/scons-local/SCons/Environment.py index 9c04d73..8bf089e 100644 --- a/3rdParty/SCons/scons-local/SCons/Environment.py +++ b/3rdParty/SCons/scons-local/SCons/Environment.py @@ -10,7 +10,7 @@ Environment """ # -# 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 @@ -32,7 +32,7 @@ Environment # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Environment.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Environment.py 4761 2010/04/04 14:04:44 bdeegan" import copy @@ -54,6 +54,7 @@ import SCons.Node.Alias import SCons.Node.FS import SCons.Node.Python import SCons.Platform +import SCons.SConf import SCons.SConsign import SCons.Subst import SCons.Tool @@ -119,7 +120,11 @@ reserved_construction_var_names = [ 'UNCHANGED_TARGETS', ] -future_reserved_construction_var_names = [] +future_reserved_construction_var_names = [ + #'HOST_OS', + #'HOST_ARCH', + #'HOST_CPU', + ] def copy_non_reserved_keywords(dict): result = semi_deepcopy(dict) @@ -147,6 +152,9 @@ def _set_BUILDERS(env, key, value): except KeyError: bd = BuilderDict(kwbd, env) env._dict[key] = bd + for k, v in value.items(): + if not SCons.Builder.is_a_Builder(v): + raise SCons.Errors.UserError('%s is not a Builder.' % repr(v)) bd.update(value) def _del_SCANNERS(env, key): @@ -245,9 +253,9 @@ class BuilderWrapper(MethodWrapper): if source is _null: source = target target = None - if not target is None and not SCons.Util.is_List(target): + if target is not None and not SCons.Util.is_List(target): target = [target] - if not source is None and not SCons.Util.is_List(source): + if source is not None and not SCons.Util.is_List(source): source = [source] return apply(MethodWrapper.__call__, (self, target, source) + args, kw) @@ -457,9 +465,9 @@ class SubstitutionEnvironment: n = None for l in lookup_list: n = l(v) - if not n is None: + if n is not None: break - if not n is None: + if n is not None: if SCons.Util.is_String(n): # n = self.subst(n, raw=1, **kw) kw['raw'] = 1 @@ -896,9 +904,6 @@ class Base(SubstitutionEnvironment): Environment. """ - if SCons.Memoize.use_memoizer: - __metaclass__ = SCons.Memoize.Memoized_Metaclass - memoizer_counters = [] ####################################################################### @@ -962,6 +967,14 @@ class Base(SubstitutionEnvironment): platform = SCons.Platform.Platform(platform) self._dict['PLATFORM'] = str(platform) platform(self) + + self._dict['HOST_OS'] = self._dict.get('HOST_OS',None) + self._dict['HOST_ARCH'] = self._dict.get('HOST_ARCH',None) + + # Now set defaults for TARGET_{OS|ARCH} + self._dict['TARGET_OS'] = self._dict.get('HOST_OS',None) + self._dict['TARGET_ARCH'] = self._dict.get('HOST_ARCH',None) + # Apply the passed-in and customizable variables to the # environment before calling the tools, because they may use @@ -1037,7 +1050,7 @@ class Base(SubstitutionEnvironment): """ name = default try: - is_node = issubclass(factory, SCons.Node.Node) + is_node = issubclass(factory, SCons.Node.FS.Base) except TypeError: # The specified factory isn't a Node itself--it's # most likely None, or possibly a callable. @@ -1825,7 +1838,7 @@ class Base(SubstitutionEnvironment): def CacheDir(self, path): import SCons.CacheDir - if not path is None: + if path is not None: path = self.subst(path) self._CacheDir_path = path @@ -2016,7 +2029,7 @@ class Base(SubstitutionEnvironment): return apply(SCons.Scanner.Base, nargs, nkw) def SConsignFile(self, name=".sconsign", dbm_module=None): - if not name is None: + if name is not None: name = self.subst(name) if not os.path.isabs(name): name = os.path.join(str(self.fs.SConstruct_dir), name) @@ -2176,9 +2189,6 @@ class OverrideEnvironment(Base): values from the overrides dictionary. """ - if SCons.Memoize.use_memoizer: - __metaclass__ = SCons.Memoize.Memoized_Metaclass - def __init__(self, subject, overrides={}): if __debug__: logInstanceCreation(self, 'Environment.OverrideEnvironment') self.__dict__['__subject'] = subject |