diff options
189 files changed, 2409 insertions, 859 deletions
diff --git a/3rdParty/SCons/scons-LICENSE b/3rdParty/SCons/scons-LICENSE index 4ac2352..790d971 100644 --- a/3rdParty/SCons/scons-LICENSE +++ b/3rdParty/SCons/scons-LICENSE @@ -3,7 +3,7 @@ This copyright and license do not apply to any other software with which this software may have been included. -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 diff --git a/3rdParty/SCons/scons-README b/3rdParty/SCons/scons-README index 89bc634..3e2a129 100644 --- a/3rdParty/SCons/scons-README +++ b/3rdParty/SCons/scons-README @@ -1,4 +1,4 @@ -# 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 SCons - a software construction tool diff --git a/3rdParty/SCons/scons-local/SCons/Action.py b/3rdParty/SCons/scons-local/SCons/Action.py index 9535194..8b5e6dc 100644 --- a/3rdParty/SCons/scons-local/SCons/Action.py +++ b/3rdParty/SCons/scons-local/SCons/Action.py @@ -76,7 +76,7 @@ way for wrapping up the functions. """ -# 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 @@ -97,7 +97,7 @@ way for wrapping up the functions. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Action.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Action.py 4761 2010/04/04 14:04:44 bdeegan" import cPickle import dis @@ -430,7 +430,7 @@ class ActionBase: # This should never happen, as the Action() factory should wrap # the varlist, but just in case an action is created directly, # we duplicate this check here. - vl = self.varlist + vl = self.get_varlist(target, source, env) if is_String(vl): vl = (vl,) for v in vl: result.append(env.subst('${'+v+'}')) @@ -454,6 +454,9 @@ class ActionBase: self.presub_env = None # don't need this any more return lines + def get_varlist(self, target, source, env, executor=None): + return self.varlist + def get_targets(self, env, executor): """ Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used @@ -897,6 +900,9 @@ class CommandGeneratorAction(ActionBase): def get_implicit_deps(self, target, source, env, executor=None): return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env) + def get_varlist(self, target, source, env, executor=None): + return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor) + def get_targets(self, env, executor): return self._generate(None, None, env, 1, executor).get_targets(env, executor) @@ -958,6 +964,9 @@ class LazyAction(CommandGeneratorAction, CommandAction): c = self.get_parent_class(env) return c.get_presig(self, target, source, env) + def get_varlist(self, target, source, env, executor=None): + c = self.get_parent_class(env) + return c.get_varlist(self, target, source, env, executor) class FunctionAction(_ActionAction): @@ -1139,6 +1148,13 @@ class ListAction(ActionBase): result.extend(act.get_implicit_deps(target, source, env)) return result + def get_varlist(self, target, source, env, executor=None): + result = SCons.Util.OrderedDict() + for act in self.list: + for var in act.get_varlist(target, source, env, executor): + result[var] = True + return result.keys() + class ActionCaller: """A class for delaying calling an Action function with specific (positional and keyword) arguments until the Action is actually diff --git a/3rdParty/SCons/scons-local/SCons/Builder.py b/3rdParty/SCons/scons-local/SCons/Builder.py index 18026c3..e0d76a8 100644 --- a/3rdParty/SCons/scons-local/SCons/Builder.py +++ b/3rdParty/SCons/scons-local/SCons/Builder.py @@ -76,7 +76,7 @@ There are the following methods for internal use within this module: """ # -# 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 @@ -98,7 +98,7 @@ There are the following methods for internal use within this module: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Builder.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Builder.py 4761 2010/04/04 14:04:44 bdeegan" import UserDict import UserList @@ -861,6 +861,16 @@ class CompositeBuilder(SCons.Util.Proxy): self.cmdgen.add_action(suffix, action) self.set_src_suffix(self.cmdgen.src_suffixes()) +def is_a_Builder(obj): + """"Returns True iff the specified obj is one of our Builder classes. + + The test is complicated a bit by the fact that CompositeBuilder + is a proxy, not a subclass of BuilderBase. + """ + return (isinstance(obj, BuilderBase) + or isinstance(obj, CompositeBuilder) + or callable(obj)) + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/3rdParty/SCons/scons-local/SCons/CacheDir.py b/3rdParty/SCons/scons-local/SCons/CacheDir.py index eda431a..86394f3 100644 --- a/3rdParty/SCons/scons-local/SCons/CacheDir.py +++ b/3rdParty/SCons/scons-local/SCons/CacheDir.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/CacheDir.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/CacheDir.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ CacheDir support diff --git a/3rdParty/SCons/scons-local/SCons/Conftest.py b/3rdParty/SCons/scons-local/SCons/Conftest.py index 6327353..e995e77 100644 --- a/3rdParty/SCons/scons-local/SCons/Conftest.py +++ b/3rdParty/SCons/scons-local/SCons/Conftest.py @@ -64,13 +64,19 @@ Autoconf-like configuration support; low level implementation of tests. # Append "lib_name_list" to the value of LIBS. # "lib_namelist" is a list of strings. # Return the value of LIBS before changing it (any type -# can be used, it is passed to SetLIBS() later. +# can be used, it is passed to SetLIBS() later.) +# +# context.PrependLIBS(lib_name_list) +# Prepend "lib_name_list" to the value of LIBS. +# "lib_namelist" is a list of strings. +# Return the value of LIBS before changing it (any type +# can be used, it is passed to SetLIBS() later.) # # context.SetLIBS(value) # Set LIBS to "value". The type of "value" is what # AppendLIBS() returned. # Return the value of LIBS before changing it (any type -# can be used, it is passed to SetLIBS() later. +# can be used, it is passed to SetLIBS() later.) # # context.headerfilename # Name of file to append configure results to, usually @@ -572,7 +578,8 @@ int main() return st def CheckLib(context, libs, func_name = None, header = None, - extra_libs = None, call = None, language = None, autoadd = 1): + extra_libs = None, call = None, language = None, autoadd = 1, + append = True): """ Configure check for a C or C++ libraries "libs". Searches through the list of libraries, until one is found where the test succeeds. @@ -657,7 +664,10 @@ return 0; l = [ lib_name ] if extra_libs: l.extend(extra_libs) - oldLIBS = context.AppendLIBS(l) + if append: + oldLIBS = context.AppendLIBS(l) + else: + oldLIBS = context.PrependLIBS(l) sym = "HAVE_LIB" + lib_name else: oldLIBS = -1 diff --git a/3rdParty/SCons/scons-local/SCons/Debug.py b/3rdParty/SCons/scons-local/SCons/Debug.py index cc7041d..f7805eb 100644 --- a/3rdParty/SCons/scons-local/SCons/Debug.py +++ b/3rdParty/SCons/scons-local/SCons/Debug.py @@ -7,7 +7,7 @@ needed by most users. """ # -# 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 @@ -29,11 +29,12 @@ needed by most users. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Debug.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Debug.py 4761 2010/04/04 14:04:44 bdeegan" import os import string import sys +import time # Recipe 14.10 from the Python Cookbook. try: @@ -196,14 +197,24 @@ if sys.platform == 'win32': else: TraceDefault = '/dev/tty' -def Trace(msg, file=None, mode='w'): +TimeStampDefault = None +StartTime = time.time() +PreviousTime = StartTime + +def Trace(msg, file=None, mode='w', tstamp=None): """Write a trace message to a file. Whenever a file is specified, it becomes the default for the next call to Trace().""" global TraceDefault + global TimeStampDefault + global PreviousTime if file is None: file = TraceDefault else: TraceDefault = file + if tstamp is None: + tstamp = TimeStampDefault + else: + TimeStampDefault = tstamp try: fp = TraceFP[file] except KeyError: @@ -212,6 +223,10 @@ def Trace(msg, file=None, mode='w'): except TypeError: # Assume we were passed an open file pointer. fp = file + if tstamp: + now = time.time() + fp.write('%8.4f %8.4f: ' % (now - StartTime, now - PreviousTime)) + PreviousTime = now fp.write(msg) fp.flush() diff --git a/3rdParty/SCons/scons-local/SCons/Defaults.py b/3rdParty/SCons/scons-local/SCons/Defaults.py index d52bf59..2ae69f7 100644 --- a/3rdParty/SCons/scons-local/SCons/Defaults.py +++ b/3rdParty/SCons/scons-local/SCons/Defaults.py @@ -10,7 +10,7 @@ from distutils.msvccompiler. """ # -# 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 @@ from distutils.msvccompiler. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Defaults.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Defaults.py 4761 2010/04/04 14:04:44 bdeegan" @@ -237,7 +237,7 @@ Mkdir = ActionFactory(mkdir_func, def move_func(dest, src): SCons.Node.FS.invalidate_node_memos(dest) SCons.Node.FS.invalidate_node_memos(src) - os.rename(src, dest) + shutil.move(src, dest) Move = ActionFactory(move_func, lambda dest, src: 'Move("%s", "%s")' % (dest, src), @@ -273,7 +273,7 @@ def _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None): return list l = f(SCons.PathList.PathList(list).subst_path(env, target, source)) - if not l is None: + if l is not None: list = l return _concat_ixes(prefix, list, suffix, env) @@ -367,9 +367,9 @@ def _stripixes(prefix, list, suffix, stripprefixes, stripsuffixes, env, c=None): return c(prefix, stripped, suffix, env) -def _defines(prefix, defs, suffix, env, c=_concat_ixes): - """A wrapper around _concat_ixes that turns a list or string - into a list of C preprocessor command-line definitions. +def processDefines(defs): + """process defines, resolving strings, lists, dictionaries, into a list of + strings """ if SCons.Util.is_List(defs): l = [] @@ -396,7 +396,14 @@ def _defines(prefix, defs, suffix, env, c=_concat_ixes): l.append(str(k) + '=' + str(v)) else: l = [str(defs)] - return c(prefix, env.subst_path(l), suffix, env) + return l + +def _defines(prefix, defs, suffix, env, c=_concat_ixes): + """A wrapper around _concat_ixes that turns a list or string + into a list of C preprocessor command-line definitions. + """ + + return c(prefix, env.subst_path(processDefines(defs)), suffix, env) class NullCmdGenerator: """This is a callable class that can be used in place of other @@ -456,7 +463,7 @@ ConstructionEnvironment = { 'DSUFFIXES' : SCons.Tool.DSuffixes, 'ENV' : {}, 'IDLSUFFIXES' : SCons.Tool.IDLSuffixes, - 'LATEXSUFFIXES' : SCons.Tool.LaTeXSuffixes, +# 'LATEXSUFFIXES' : SCons.Tool.LaTeXSuffixes, # moved to the TeX tools generate functions '_concat' : _concat, '_defines' : _defines, '_stripixes' : _stripixes, 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 diff --git a/3rdParty/SCons/scons-local/SCons/Errors.py b/3rdParty/SCons/scons-local/SCons/Errors.py index 1fd5663..05b8df5 100644 --- a/3rdParty/SCons/scons-local/SCons/Errors.py +++ b/3rdParty/SCons/scons-local/SCons/Errors.py @@ -1,5 +1,5 @@ # -# 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 @@ -28,7 +28,7 @@ and user errors in SCons. """ -__revision__ = "src/engine/SCons/Errors.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Errors.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Executor.py b/3rdParty/SCons/scons-local/SCons/Executor.py index 0dfeaf1..9dce698 100644 --- a/3rdParty/SCons/scons-local/SCons/Executor.py +++ b/3rdParty/SCons/scons-local/SCons/Executor.py @@ -6,7 +6,7 @@ Nodes. """ # -# 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 @@ -28,7 +28,7 @@ Nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Executor.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Executor.py 4761 2010/04/04 14:04:44 bdeegan" import string import UserList diff --git a/3rdParty/SCons/scons-local/SCons/Job.py b/3rdParty/SCons/scons-local/SCons/Job.py index 4efddd4..8173db2 100644 --- a/3rdParty/SCons/scons-local/SCons/Job.py +++ b/3rdParty/SCons/scons-local/SCons/Job.py @@ -7,7 +7,7 @@ stop, and wait on jobs. """ # -# 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 @@ -29,7 +29,7 @@ stop, and wait on jobs. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Job.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Job.py 4761 2010/04/04 14:04:44 bdeegan" import os import signal diff --git a/3rdParty/SCons/scons-local/SCons/Memoize.py b/3rdParty/SCons/scons-local/SCons/Memoize.py index dbb0cf1..b21c733 100644 --- a/3rdParty/SCons/scons-local/SCons/Memoize.py +++ b/3rdParty/SCons/scons-local/SCons/Memoize.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Memoize.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Memoize.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Memoizer diff --git a/3rdParty/SCons/scons-local/SCons/Node/Alias.py b/3rdParty/SCons/scons-local/SCons/Node/Alias.py index a52a3fb..84be60b 100644 --- a/3rdParty/SCons/scons-local/SCons/Node/Alias.py +++ b/3rdParty/SCons/scons-local/SCons/Node/Alias.py @@ -8,7 +8,7 @@ This creates a hash of global Aliases (dummy targets). """ # -# 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 @@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets). # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Alias.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Node/Alias.py 4761 2010/04/04 14:04:44 bdeegan" import string import UserDict diff --git a/3rdParty/SCons/scons-local/SCons/Node/FS.py b/3rdParty/SCons/scons-local/SCons/Node/FS.py index abcd8da..6a435b4 100644 --- a/3rdParty/SCons/scons-local/SCons/Node/FS.py +++ b/3rdParty/SCons/scons-local/SCons/Node/FS.py @@ -11,7 +11,7 @@ that can be used by scripts or modules looking for the canonical default. """ # -# 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 @@ -33,7 +33,7 @@ that can be used by scripts or modules looking for the canonical default. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/FS.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Node/FS.py 4761 2010/04/04 14:04:44 bdeegan" from itertools import izip import cStringIO @@ -58,12 +58,46 @@ else: except AttributeError: codecs.BOM_UTF8 = '\xef\xbb\xbf' try: - codecs.BOM_UTF16 + codecs.BOM_UTF16_LE + codecs.BOM_UTF16_BE except AttributeError: - if sys.byteorder == 'little': - codecs.BOM_UTF16 = '\xff\xfe' + codecs.BOM_UTF16_LE = '\xff\xfe' + codecs.BOM_UTF16_BE = '\xfe\xff' + + # Provide a wrapper function to handle decoding differences in + # different versions of Python. Normally, we'd try to do this in the + # compat layer (and maybe it still makes sense to move there?) but + # that doesn't provide a way to supply the string class used in + # pre-2.3 Python versions with a .decode() method that all strings + # naturally have. Plus, the 2.[01] encodings behave differently + # enough that we have to settle for a lowest-common-denominator + # wrapper approach. + # + # Note that the 2.[012] implementations below may be inefficient + # because they perform an explicit look up of the encoding for every + # decode, but they're old enough (and we want to stop supporting + # them soon enough) that it's not worth complicating the interface. + # Think of it as additional incentive for people to upgrade... + try: + ''.decode + except AttributeError: + # 2.0 through 2.2: strings have no .decode() method + try: + codecs.lookup('ascii').decode + except AttributeError: + # 2.0 and 2.1: encodings are a tuple of functions, and the + # decode() function returns a (result, length) tuple. + def my_decode(contents, encoding): + return codecs.lookup(encoding)[1](contents)[0] else: - codecs.BOM_UTF16 = '\xfe\xff' + # 2.2: encodings are an object with methods, and the + # .decode() method returns just the decoded bytes. + def my_decode(contents, encoding): + return codecs.lookup(encoding).decode(contents) + else: + # 2.3 or later: use the .decode() string method + def my_decode(contents, encoding): + return contents.decode(encoding) import SCons.Action from SCons.Debug import logInstanceCreation @@ -554,22 +588,22 @@ class Base(SCons.Node.Node): # Filenames and paths are probably reused and are intern'ed to # save some memory. - self.name = intern(name) - self.suffix = intern(SCons.Util.splitext(name)[1]) + self.name = SCons.Util.silent_intern(name) + self.suffix = SCons.Util.silent_intern(SCons.Util.splitext(name)[1]) self.fs = fs assert directory, "A directory must be provided" - self.abspath = intern(directory.entry_abspath(name)) - self.labspath = intern(directory.entry_labspath(name)) + self.abspath = SCons.Util.silent_intern(directory.entry_abspath(name)) + self.labspath = SCons.Util.silent_intern(directory.entry_labspath(name)) if directory.path == '.': - self.path = intern(name) + self.path = SCons.Util.silent_intern(name) else: - self.path = intern(directory.entry_path(name)) + self.path = SCons.Util.silent_intern(directory.entry_path(name)) if directory.tpath == '.': - self.tpath = intern(name) + self.tpath = SCons.Util.silent_intern(name) else: - self.tpath = intern(directory.entry_tpath(name)) + self.tpath = SCons.Util.silent_intern(directory.entry_tpath(name)) self.path_elements = directory.path_elements + [self] self.dir = directory @@ -1749,7 +1783,7 @@ class Dir(Base): d[name] = result return result else: - return d.has_key(name) + return d.has_key(_my_normcase(name)) memoizer_counters.append(SCons.Memoize.CountValue('srcdir_list')) @@ -1919,7 +1953,9 @@ class Dir(Base): """ dirname, basename = os.path.split(pathname) if not dirname: - return self._glob1(basename, ondisk, source, strings) + result = self._glob1(basename, ondisk, source, strings) + result.sort(lambda a, b: cmp(str(a), str(b))) + return result if has_glob_magic(dirname): list = self.glob(dirname, ondisk, source, strings=False) else: @@ -2074,7 +2110,8 @@ class RootDir(Dir): result = self._lookupDict[k] except KeyError: if not create: - raise SCons.Errors.UserError + msg = "No such file or directory: '%s' in '%s' (and create is False)" % (p, str(self)) + raise SCons.Errors.UserError, msg # There is no Node for this path name, and we're allowed # to create it. dir_name, file_name = os.path.split(p) @@ -2309,10 +2346,27 @@ class File(Base): # it's a valid python string. def get_text_contents(self): contents = self.get_contents() + # The behavior of various decode() methods and functions + # w.r.t. the initial BOM bytes is different for different + # encodings and/or Python versions. ('utf-8' does not strip + # them, but has a 'utf-8-sig' which does; 'utf-16' seems to + # strip them; etc.) Just side step all the complication by + # explicitly stripping the BOM before we decode(). if contents.startswith(codecs.BOM_UTF8): - contents = contents.decode('utf-8') - elif contents.startswith(codecs.BOM_UTF16): - contents = contents.decode('utf-16') + contents = contents[len(codecs.BOM_UTF8):] + # TODO(2.2): Remove when 2.3 becomes floor. + #contents = contents.decode('utf-8') + contents = my_decode(contents, 'utf-8') + elif contents.startswith(codecs.BOM_UTF16_LE): + contents = contents[len(codecs.BOM_UTF16_LE):] + # TODO(2.2): Remove when 2.3 becomes floor. + #contents = contents.decode('utf-16-le') + contents = my_decode(contents, 'utf-16-le') + elif contents.startswith(codecs.BOM_UTF16_BE): + contents = contents[len(codecs.BOM_UTF16_BE):] + # TODO(2.2): Remove when 2.3 becomes floor. + #contents = contents.decode('utf-16-be') + contents = my_decode(contents, 'utf-16-be') return contents def get_content_hash(self): diff --git a/3rdParty/SCons/scons-local/SCons/Node/Python.py b/3rdParty/SCons/scons-local/SCons/Node/Python.py index 9a22f42..c7188e2 100644 --- a/3rdParty/SCons/scons-local/SCons/Node/Python.py +++ b/3rdParty/SCons/scons-local/SCons/Node/Python.py @@ -5,7 +5,7 @@ Python nodes. """ # -# 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 @@ -27,7 +27,7 @@ Python nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Python.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Node/Python.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Node @@ -53,7 +53,7 @@ class Value(SCons.Node.Node): def __init__(self, value, built_value=None): SCons.Node.Node.__init__(self) self.value = value - if not built_value is None: + if built_value is not None: self.built_value = built_value def str_for_display(self): @@ -88,17 +88,20 @@ class Value(SCons.Node.Node): self.built_value = self.value return self.built_value - def get_contents(self): + def get_text_contents(self): """By the assumption that the node.built_value is a deterministic product of the sources, the contents of a Value are the concatenation of all the contents of its sources. As the value need not be built when get_contents() is called, we cannot use the actual node.built_value.""" + ###TODO: something reasonable about universal newlines contents = str(self.value) for kid in self.children(None): contents = contents + kid.get_contents() return contents + get_contents = get_text_contents ###TODO should return 'bytes' value + def changed_since_last_build(self, target, prev_ni): cur_csig = self.get_csig() try: diff --git a/3rdParty/SCons/scons-local/SCons/Node/__init__.py b/3rdParty/SCons/scons-local/SCons/Node/__init__.py index abb746e..f2ed2f0 100644 --- a/3rdParty/SCons/scons-local/SCons/Node/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Node/__init__.py @@ -20,7 +20,7 @@ be able to depend on any other type of "thing." """ # -# 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 @@ -42,7 +42,7 @@ be able to depend on any other type of "thing." # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Node/__init__.py 4761 2010/04/04 14:04:44 bdeegan" import copy from itertools import chain, izip @@ -352,7 +352,7 @@ class Node: if d.missing(): msg = "Explicit dependency `%s' not found, needed by target `%s'." raise SCons.Errors.StopError, msg % (d, self) - if not self.implicit is None: + if self.implicit is not None: for i in self.implicit: if i.missing(): msg = "Implicit dependency `%s' not found, needed by target `%s'." @@ -474,7 +474,7 @@ class Node: # There was no explicit builder for this Node, so initialize # the self.builder attribute to None now. b = self.builder = None - return not b is None + return b is not None def set_explicit(self, is_explicit): self.is_explicit = is_explicit @@ -602,7 +602,7 @@ class Node: # Don't bother scanning non-derived files, because we don't # care what their dependencies are. # Don't scan again, if we already have scanned. - if not self.implicit is None: + if self.implicit is not None: return self.implicit = [] self.implicit_set = set() @@ -891,7 +891,7 @@ class Node: def add_wkid(self, wkid): """Add a node to the list of kids waiting to be evaluated""" - if self.wkids != None: + if self.wkids is not None: self.wkids.append(wkid) def _children_reset(self): diff --git a/3rdParty/SCons/scons-local/SCons/Options/BoolOption.py b/3rdParty/SCons/scons-local/SCons/Options/BoolOption.py index f74854a..a6dba21 100644 --- a/3rdParty/SCons/scons-local/SCons/Options/BoolOption.py +++ b/3rdParty/SCons/scons-local/SCons/Options/BoolOption.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Options/BoolOption.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Options/BoolOption.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Options module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/Options/EnumOption.py b/3rdParty/SCons/scons-local/SCons/Options/EnumOption.py index 1546ec9..d5f13f7 100644 --- a/3rdParty/SCons/scons-local/SCons/Options/EnumOption.py +++ b/3rdParty/SCons/scons-local/SCons/Options/EnumOption.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Options/EnumOption.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Options/EnumOption.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Options module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/Options/ListOption.py b/3rdParty/SCons/scons-local/SCons/Options/ListOption.py index fbc7160..f60a01c 100644 --- a/3rdParty/SCons/scons-local/SCons/Options/ListOption.py +++ b/3rdParty/SCons/scons-local/SCons/Options/ListOption.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Options/ListOption.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Options/ListOption.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Options module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/Options/PackageOption.py b/3rdParty/SCons/scons-local/SCons/Options/PackageOption.py index 656c87b..3d6450e 100644 --- a/3rdParty/SCons/scons-local/SCons/Options/PackageOption.py +++ b/3rdParty/SCons/scons-local/SCons/Options/PackageOption.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Options/PackageOption.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Options/PackageOption.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Options module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/Options/PathOption.py b/3rdParty/SCons/scons-local/SCons/Options/PathOption.py index afcf919..7762a09 100644 --- a/3rdParty/SCons/scons-local/SCons/Options/PathOption.py +++ b/3rdParty/SCons/scons-local/SCons/Options/PathOption.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Options/PathOption.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Options/PathOption.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Options module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/Options/__init__.py b/3rdParty/SCons/scons-local/SCons/Options/__init__.py index 053b565..63e018d 100644 --- a/3rdParty/SCons/scons-local/SCons/Options/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Options/__init__.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Options/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Options/__init__.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Options module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/PathList.py b/3rdParty/SCons/scons-local/SCons/PathList.py index 78aafe1..27f1829 100644 --- a/3rdParty/SCons/scons-local/SCons/PathList.py +++ b/3rdParty/SCons/scons-local/SCons/PathList.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/PathList.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/PathList.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """SCons.PathList diff --git a/3rdParty/SCons/scons-local/SCons/Platform/__init__.py b/3rdParty/SCons/scons-local/SCons/Platform/__init__.py index 9c23554..717ba43 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/__init__.py @@ -20,7 +20,7 @@ their own platform definition. """ # -# 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 @@ -42,7 +42,9 @@ their own platform definition. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/__init__.py 4761 2010/04/04 14:04:44 bdeegan" + +import SCons.compat import imp import os @@ -176,8 +178,8 @@ class TempFileMunge: # We use the .lnk suffix for the benefit of the Phar Lap # linkloc linker, which likes to append an .lnk suffix if # none is given. - tmp = os.path.normpath(tempfile.mktemp('.lnk')) - native_tmp = SCons.Util.get_native_path(tmp) + (fd, tmp) = tempfile.mkstemp('.lnk', text=True) + native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp)) if env['SHELL'] and env['SHELL'] == 'sh': # The sh shell will try to escape the backslashes in the @@ -197,7 +199,8 @@ class TempFileMunge: prefix = '@' args = map(SCons.Subst.quote_spaces, cmd[1:]) - open(tmp, 'w').write(string.join(args, " ") + "\n") + os.write(fd, string.join(args, " ") + "\n") + os.close(fd) # XXX Using the SCons.Action.print_actions value directly # like this is bogus, but expedient. This class should # really be rewritten as an Action that defines the diff --git a/3rdParty/SCons/scons-local/SCons/Platform/aix.py b/3rdParty/SCons/scons-local/SCons/Platform/aix.py index c3f5d0f..b45ca93 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/aix.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/aix.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/aix.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/aix.py 4761 2010/04/04 14:04:44 bdeegan" import os import string diff --git a/3rdParty/SCons/scons-local/SCons/Platform/cygwin.py b/3rdParty/SCons/scons-local/SCons/Platform/cygwin.py index cdc516d..4b607f6 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/cygwin.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/cygwin.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/cygwin.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/cygwin.py 4761 2010/04/04 14:04:44 bdeegan" import posix from SCons.Platform import TempFileMunge diff --git a/3rdParty/SCons/scons-local/SCons/Platform/darwin.py b/3rdParty/SCons/scons-local/SCons/Platform/darwin.py index a92b2f1..b2e3931 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/darwin.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/darwin.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/darwin.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/darwin.py 4761 2010/04/04 14:04:44 bdeegan" import posix diff --git a/3rdParty/SCons/scons-local/SCons/Platform/hpux.py b/3rdParty/SCons/scons-local/SCons/Platform/hpux.py index aa90e71..19db32f 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/hpux.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/hpux.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/hpux.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/hpux.py 4761 2010/04/04 14:04:44 bdeegan" import posix diff --git a/3rdParty/SCons/scons-local/SCons/Platform/irix.py b/3rdParty/SCons/scons-local/SCons/Platform/irix.py index a20a7de..914a8db 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/irix.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/irix.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/irix.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/irix.py 4761 2010/04/04 14:04:44 bdeegan" import posix diff --git a/3rdParty/SCons/scons-local/SCons/Platform/os2.py b/3rdParty/SCons/scons-local/SCons/Platform/os2.py index f8fa379..e3b2754 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/os2.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/os2.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,8 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/os2.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/os2.py 4761 2010/04/04 14:04:44 bdeegan" +import win32 def generate(env): if not env.has_key('ENV'): @@ -47,6 +48,8 @@ def generate(env): env['SHLIBSUFFIX'] = '.dll' env['LIBPREFIXES'] = '$LIBPREFIX' env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ] + env['HOST_OS'] = 'os2' + env['HOST_ARCH'] = win32.get_architecture().arch # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Platform/posix.py b/3rdParty/SCons/scons-local/SCons/Platform/posix.py index 0a31dd6..0c2a9e3 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/posix.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/posix.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/posix.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/posix.py 4761 2010/04/04 14:04:44 bdeegan" import errno import os @@ -116,7 +116,7 @@ def process_cmd_output(cmd_stdout, cmd_stderr, stdout, stderr): str = cmd_stdout.read() if len(str) == 0: stdout_eof = 1 - elif stdout != None: + elif stdout is not None: stdout.write(str) if cmd_stderr in i: str = cmd_stderr.read() diff --git a/3rdParty/SCons/scons-local/SCons/Platform/sunos.py b/3rdParty/SCons/scons-local/SCons/Platform/sunos.py index 74f298a..448a4c4 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/sunos.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/sunos.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/sunos.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/sunos.py 4761 2010/04/04 14:04:44 bdeegan" import posix diff --git a/3rdParty/SCons/scons-local/SCons/Platform/win32.py b/3rdParty/SCons/scons-local/SCons/Platform/win32.py index 64b83a7..935e8d4 100644 --- a/3rdParty/SCons/scons-local/SCons/Platform/win32.py +++ b/3rdParty/SCons/scons-local/SCons/Platform/win32.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/win32.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Platform/win32.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path @@ -42,8 +42,6 @@ from SCons.Platform.posix import exitvalmap from SCons.Platform import TempFileMunge import SCons.Util - - try: import msvcrt import win32api @@ -67,7 +65,7 @@ else: _builtin_file = __builtin__.file _builtin_open = __builtin__.open - + def _scons_file(*args, **kw): fp = apply(_builtin_file, args, kw) win32api.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()), @@ -134,18 +132,18 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): ret = exitvalmap[e[0]] except KeyError: sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e[0], cmd, e[1])) - if stderr != None: + if stderr is not None: stderr.write("scons: %s: %s\n" % (cmd, e[1])) # copy child output from tempfiles to our streams # and do clean up stuff - if stdout != None and stdoutRedirected == 0: + if stdout is not None and stdoutRedirected == 0: try: stdout.write(open( tmpFileStdout, "r" ).read()) os.remove( tmpFileStdout ) except (IOError, OSError): pass - if stderr != None and stderrRedirected == 0: + if stderr is not None and stderrRedirected == 0: try: stderr.write(open( tmpFileStderr, "r" ).read()) os.remove( tmpFileStderr ) @@ -197,7 +195,7 @@ def get_system_root(): return _system_root # A resonable default if we can't read the registry - val = os.environ.get('SystemRoot', "C:/WINDOWS") + val = os.environ.get('SystemRoot', "C:\\WINDOWS") if SCons.Util.can_read_reg: try: @@ -239,6 +237,53 @@ def get_program_files_dir(): return val + + +# Determine which windows CPU were running on. +class ArchDefinition: + """ + A class for defining architecture-specific settings and logic. + """ + def __init__(self, arch, synonyms=[]): + self.arch = arch + self.synonyms = synonyms + +SupportedArchitectureList = [ + ArchDefinition( + 'x86', + ['i386', 'i486', 'i586', 'i686'], + ), + + ArchDefinition( + 'x86_64', + ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'], + ), + + ArchDefinition( + 'ia64', + ['IA64'], + ), +] + +SupportedArchitectureMap = {} +for a in SupportedArchitectureList: + SupportedArchitectureMap[a.arch] = a + for s in a.synonyms: + SupportedArchitectureMap[s] = a + +def get_architecture(arch=None): + """Returns the definition for the specified architecture string. + + If no string is specified, the system default is returned (as defined + by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment + variables). + """ + if arch is None: + arch = os.environ.get('PROCESSOR_ARCHITEW6432') + if not arch: + arch = os.environ.get('PROCESSOR_ARCHITECTURE') + return SupportedArchitectureMap.get(arch, ArchDefinition('', [''])) + def generate(env): # Attempt to find cmd.exe (for WinNT/2k/XP) or # command.com for Win9x @@ -329,6 +374,10 @@ def generate(env): env['TEMPFILEPREFIX'] = '@' env['MAXLINELENGTH'] = 2048 env['ESCAPE'] = escape + + env['HOST_OS'] = 'win32' + env['HOST_ARCH'] = get_architecture().arch + # Local Variables: # tab-width:4 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. diff --git a/3rdParty/SCons/scons-local/SCons/SConsign.py b/3rdParty/SCons/scons-local/SCons/SConsign.py index d7a8ab2..ebc82e8 100644 --- a/3rdParty/SCons/scons-local/SCons/SConsign.py +++ b/3rdParty/SCons/scons-local/SCons/SConsign.py @@ -5,7 +5,7 @@ Writing and reading information to the .sconsign file or files. """ # -# 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 @@ -27,7 +27,7 @@ Writing and reading information to the .sconsign file or files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/SConsign.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/SConsign.py 4761 2010/04/04 14:04:44 bdeegan" import cPickle import os diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/C.py b/3rdParty/SCons/scons-local/SCons/Scanner/C.py index dccd3be..cc6ab64 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/C.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/C.py @@ -5,7 +5,7 @@ This module implements the depenency scanner for C/C++ code. """ # -# 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 @@ -27,7 +27,7 @@ This module implements the depenency scanner for C/C++ code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/C.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/C.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/D.py b/3rdParty/SCons/scons-local/SCons/Scanner/D.py index 311e1af..509f7eb 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/D.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/D.py @@ -8,7 +8,7 @@ Coded by Andy Friesen """ # -# 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 @@ -30,7 +30,7 @@ Coded by Andy Friesen # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/D.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/D.py 4761 2010/04/04 14:04:44 bdeegan" import re import string diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/Dir.py b/3rdParty/SCons/scons-local/SCons/Scanner/Dir.py index aaf92d6..5e21a68 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/Dir.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/Dir.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/Dir.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/Dir.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/Fortran.py b/3rdParty/SCons/scons-local/SCons/Scanner/Fortran.py index 92f511a..572b183 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/Fortran.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/Fortran.py @@ -5,7 +5,7 @@ This module implements the dependency scanner for Fortran code. """ # -# 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 @@ -27,7 +27,7 @@ This module implements the dependency scanner for Fortran code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/Fortran.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/Fortran.py 4761 2010/04/04 14:04:44 bdeegan" import re import string diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/IDL.py b/3rdParty/SCons/scons-local/SCons/Scanner/IDL.py index 57a8a6a..21fcc45 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/IDL.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/IDL.py @@ -6,7 +6,7 @@ Definition Language) files. """ # -# 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 @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/IDL.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/IDL.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/LaTeX.py b/3rdParty/SCons/scons-local/SCons/Scanner/LaTeX.py index fe6f7e1..4b2c832 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/LaTeX.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/LaTeX.py @@ -5,7 +5,7 @@ This module implements the dependency scanner for LaTeX code. """ # -# 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 @@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/LaTeX.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/LaTeX.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import string @@ -151,6 +151,7 @@ class LaTeX(SCons.Scanner.Base): of the file being searched: env['TEXINPUTS'] for "input" and "include" keywords env['TEXINPUTS'] for "includegraphics" keyword + env['TEXINPUTS'] for "lstinputlisting" keyword env['BIBINPUTS'] for "bibliography" keyword env['BSTINPUTS'] for "bibliographystyle" keyword @@ -162,7 +163,8 @@ class LaTeX(SCons.Scanner.Base): 'includegraphics': 'TEXINPUTS', 'bibliography': 'BIBINPUTS', 'bibliographystyle': 'BSTINPUTS', - 'usepackage': 'TEXINPUTS'} + 'usepackage': 'TEXINPUTS', + 'lstinputlisting': 'TEXINPUTS'} env_variables = SCons.Util.unique(keyword_paths.values()) def __init__(self, name, suffixes, graphics_extensions, *args, **kw): @@ -172,7 +174,7 @@ class LaTeX(SCons.Scanner.Base): # Without the \n, the ^ could match the beginning of a *previous* # line followed by one or more newline characters (i.e. blank # lines), interfering with a match on the next line. - regex = r'^[^%\n]*\\(include|includegraphics(?:\[[^\]]+\])?|input|bibliography|usepackage){([^}]*)}' + regex = r'^[^%\n]*\\(include|includegraphics(?:\[[^\]]+\])?|lstinputlisting(?:\[[^\]]+\])?|input|bibliography|usepackage){([^}]*)}' self.cre = re.compile(regex, re.M) self.graphics_extensions = graphics_extensions @@ -180,7 +182,7 @@ class LaTeX(SCons.Scanner.Base): node = node.rfile() if not node.exists(): return [] - return self.scan(node, path) + return self.scan_recurse(node, path) class FindMultiPathDirs: """The stock FindPathDirs function has the wrong granularity: @@ -224,7 +226,7 @@ class LaTeX(SCons.Scanner.Base): kw['function'] = _scan kw['path_function'] = FindMultiPathDirs(LaTeX.keyword_paths) - kw['recursive'] = 1 + kw['recursive'] = 0 kw['skeys'] = suffixes kw['scan_check'] = LaTeXScanCheck(suffixes) kw['name'] = name @@ -277,13 +279,13 @@ class LaTeX(SCons.Scanner.Base): return i, include return i, include - def scan(self, node, path=()): + def scan(self, node): # Modify the default scan function to allow for the regular # expression to return a comma separated list of file names # as can be the case with the bibliography keyword. # Cache the includes list in node so we only scan it once: - path_dict = dict(list(path)) + # path_dict = dict(list(path)) noopt_cre = re.compile('\[.*$') if node.includes != None: includes = node.includes @@ -308,6 +310,19 @@ class LaTeX(SCons.Scanner.Base): includes = split_includes node.includes = includes + return includes + + def scan_recurse(self, node, path=()): + """ do a recursive scan of the top level target file + This lets us search for included files based on the + directory of the main file just as latex does""" + + path_dict = dict(list(path)) + + queue = [] + queue.extend( self.scan(node) ) + seen = {} + # This is a hand-coded DSU (decorate-sort-undecorate, or # Schwartzian transform) pattern. The sort key is the raw name # of the file as specifed on the \include, \input, etc. line. @@ -317,7 +332,24 @@ class LaTeX(SCons.Scanner.Base): # is actually found in a Repository or locally.""" nodes = [] source_dir = node.get_dir() - for include in includes: + #for include in includes: + while queue: + + include = queue.pop() + # TODO(1.5): more compact: + #try: + # if seen[include[1]] == 1: + # continue + #except KeyError: + # seen[include[1]] = 1 + try: + already_seen = seen[include[1]] + except KeyError: + seen[include[1]] = 1 + already_seen = False + if already_seen: + continue + # # Handle multiple filenames in include[1] # @@ -331,6 +363,9 @@ class LaTeX(SCons.Scanner.Base): else: sortkey = self.sort_key(n) nodes.append((sortkey, n)) + # recurse down + queue.extend( self.scan(n) ) + # nodes.sort() nodes = map(lambda pair: pair[1], nodes) diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/Prog.py b/3rdParty/SCons/scons-local/SCons/Scanner/Prog.py index 47054a8..f5f94a4 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/Prog.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/Prog.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/Prog.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/Prog.py 4761 2010/04/04 14:04:44 bdeegan" import string diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/RC.py b/3rdParty/SCons/scons-local/SCons/Scanner/RC.py index e804a3f..b89442b 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/RC.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/RC.py @@ -6,7 +6,7 @@ Definition Language) files. """ # -# 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 @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/RC.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/RC.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/3rdParty/SCons/scons-local/SCons/Scanner/__init__.py b/3rdParty/SCons/scons-local/SCons/Scanner/__init__.py index f5ce271..b7eb2d8 100644 --- a/3rdParty/SCons/scons-local/SCons/Scanner/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Scanner/__init__.py @@ -5,7 +5,7 @@ The Scanner package for the SCons software construction utility. """ # -# 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 @@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Scanner/__init__.py 4761 2010/04/04 14:04:44 bdeegan" import re import string @@ -92,7 +92,9 @@ class Base: argument = _null, skeys = _null, path_function = None, - node_class = SCons.Node.FS.Entry, + # Node.FS.Base so that, by default, it's okay for a + # scanner to return a Dir, File or Entry. + node_class = SCons.Node.FS.Base, node_factory = None, scan_check = None, recursive = None): @@ -352,16 +354,13 @@ class Classic(Current): def scan(self, node, path=()): # cache the includes list in node so we only scan it once: - if node.includes != None: + if node.includes is not None: includes = node.includes else: includes = self.find_include_names (node) # Intern the names of the include files. Saves some memory # if the same header is included many times. - try: - node.includes = map(intern, includes) - except TypeError: - node.includes = includes + node.includes = map(SCons.Util.silent_intern, includes) # This is a hand-coded DSU (decorate-sort-undecorate, or # Schwartzian transform) pattern. The sort key is the raw name @@ -405,7 +404,8 @@ class ClassicCPP(Classic): n = SCons.Node.FS.find_file(include[1], paths) - return n, intern(include[1]) + i = SCons.Util.silent_intern(include[1]) + return n, i def sort_key(self, include): return SCons.Node.FS._my_normcase(string.join(include)) diff --git a/3rdParty/SCons/scons-local/SCons/Script/Interactive.py b/3rdParty/SCons/scons-local/SCons/Script/Interactive.py index 75ca1c7..1300116 100644 --- a/3rdParty/SCons/scons-local/SCons/Script/Interactive.py +++ b/3rdParty/SCons/scons-local/SCons/Script/Interactive.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/Interactive.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Script/Interactive.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ SCons interactive mode diff --git a/3rdParty/SCons/scons-local/SCons/Script/Main.py b/3rdParty/SCons/scons-local/SCons/Script/Main.py index 537bcf1..72ff71c 100644 --- a/3rdParty/SCons/scons-local/SCons/Script/Main.py +++ b/3rdParty/SCons/scons-local/SCons/Script/Main.py @@ -12,7 +12,7 @@ it goes here. """ # -# 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 @@ -34,7 +34,7 @@ it goes here. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/Main.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Script/Main.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path @@ -207,7 +207,12 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask): t = self.targets[0] if self.top and not t.has_builder() and not t.side_effect: if not t.exists(): - errstr="Do not know how to make target `%s'." % t + def classname(obj): + return string.split(str(obj.__class__), '.')[-1] + if classname(t) in ('File', 'Dir', 'Entry'): + errstr="Do not know how to make %s target `%s' (%s)." % (classname(t), t, t.abspath) + else: # Alias or Python or ... + errstr="Do not know how to make %s target `%s'." % (classname(t), t) sys.stderr.write("scons: *** " + errstr) if not self.options.keep_going: sys.stderr.write(" Stop.") @@ -426,7 +431,7 @@ def python_version_unsupported(version=sys.version_info): return version < (1, 5, 2) def python_version_deprecated(version=sys.version_info): - return version < (2, 2, 0) + return version < (2, 4, 0) # Global variables @@ -693,20 +698,41 @@ def _load_site_scons_dir(topdir, site_dir_name=None): site_tools_dir = os.path.join(site_dir, site_tools_dirname) if os.path.exists(site_init_file): import imp + # TODO(2.4): turn this into try:-except:-finally: try: - fp, pathname, description = imp.find_module(site_init_modname, - [site_dir]) try: - imp.load_module(site_init_modname, fp, pathname, description) - finally: - if fp: - fp.close() - except ImportError, e: - sys.stderr.write("Can't import site init file '%s': %s\n"%(site_init_file, e)) - raise - except Exception, e: - sys.stderr.write("Site init file '%s' raised exception: %s\n"%(site_init_file, e)) - raise + fp, pathname, description = imp.find_module(site_init_modname, + [site_dir]) + # Load the file into SCons.Script namespace. This is + # opaque and clever; m is the module object for the + # SCons.Script module, and the exec ... in call executes a + # file (or string containing code) in the context of the + # module's dictionary, so anything that code defines ends + # up adding to that module. This is really short, but all + # the error checking makes it longer. + try: + m = sys.modules['SCons.Script'] + except Exception, e: + fmt = 'cannot import site_init.py: missing SCons.Script module %s' + raise SCons.Errors.InternalError, fmt % repr(e) + try: + # This is the magic. + exec fp in m.__dict__ + except KeyboardInterrupt: + raise + except Exception, e: + fmt = '*** Error loading site_init file %s:\n' + sys.stderr.write(fmt % repr(site_init_file)) + raise + except KeyboardInterrupt: + raise + except ImportError, e: + fmt = '*** cannot import site init file %s:\n' + sys.stderr.write(fmt % repr(site_init_file)) + raise + finally: + if fp: + fp.close() if os.path.exists(site_tools_dir): SCons.Tool.DefaultToolpath.append(os.path.abspath(site_tools_dir)) @@ -750,6 +776,8 @@ def _main(parser): SCons.Warnings.MisleadingKeywordsWarning, SCons.Warnings.ReservedVariableWarning, SCons.Warnings.StackSizeWarning, + SCons.Warnings.VisualVersionMismatch, + SCons.Warnings.VisualCMissingWarning, ] for warning in default_warnings: @@ -778,16 +806,13 @@ def _main(parser): # want to start everything, which means first handling any relevant # options that might cause us to chdir somewhere (-C, -D, -U, -u). if options.directory: - cdir = _create_path(options.directory) - try: - os.chdir(cdir) - except OSError: - sys.stderr.write("Could not change directory to %s\n" % cdir) + script_dir = os.path.abspath(_create_path(options.directory)) + else: + script_dir = os.getcwd() target_top = None if options.climb_up: target_top = '.' # directory to prepend to targets - script_dir = os.getcwd() # location of script while script_dir and not _SConstruct_exists(script_dir, options.repository, options.file): @@ -796,9 +821,13 @@ def _main(parser): target_top = os.path.join(last_part, target_top) else: script_dir = '' - if script_dir and script_dir != os.getcwd(): - display("scons: Entering directory `%s'" % script_dir) + + if script_dir and script_dir != os.getcwd(): + display("scons: Entering directory `%s'" % script_dir) + try: os.chdir(script_dir) + except OSError: + sys.stderr.write("Could not change directory to %s\n" % script_dir) # Now that we're in the top-level SConstruct directory, go ahead # and initialize the FS object that represents the file system, @@ -868,7 +897,7 @@ def _main(parser): targets = [] xmit_args = [] for a in parser.largs: - if a[0] == '-': + if a[:1] == '-': continue if '=' in a: xmit_args.append(a) @@ -885,9 +914,9 @@ def _main(parser): # module will no longer work. This affects the behavior during # --interactive mode. --interactive should only be used when stdin and # stdout refer to a tty. - if not sys.stdout.isatty(): + if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty(): sys.stdout = SCons.Util.Unbuffered(sys.stdout) - if not sys.stderr.isatty(): + if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty(): sys.stderr = SCons.Util.Unbuffered(sys.stderr) memory_stats.append('before reading SConscript files:') @@ -933,7 +962,7 @@ def _main(parser): # warning about deprecated Python versions--delayed until here # in case they disabled the warning in the SConscript files. if python_version_deprecated(): - msg = "Support for pre-2.2 Python (%s) is deprecated.\n" + \ + msg = "Support for pre-2.4 Python (%s) is deprecated.\n" + \ " If this will cause hardship, contact dev@scons.tigris.org." SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning, msg % python_version_string()) @@ -1075,14 +1104,14 @@ def _build_targets(fs, options, targets, target_top): else: node = None # Why would ltop be None? Unfortunately this happens. - if ltop == None: ltop = '' + if ltop is None: ltop = '' # Curdir becomes important when SCons is called with -u, -C, # or similar option that changes directory, and so the paths # of targets given on the command line need to be adjusted. curdir = os.path.join(os.getcwd(), str(ltop)) for lookup in SCons.Node.arg2nodes_lookups: node = lookup(x, curdir=curdir) - if node != None: + if node is not None: break if node is None: node = fs.Entry(x, directory=ltop, create=1) @@ -1255,7 +1284,7 @@ def main(): # __main__.__version__, hence there is no script version. pass parts.append(version_string("engine", SCons)) - parts.append("Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation") + parts.append("Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation") version = string.join(parts, '') import SConsOptions diff --git a/3rdParty/SCons/scons-local/SCons/Script/SConsOptions.py b/3rdParty/SCons/scons-local/SCons/Script/SConsOptions.py index 7724590..d6001c5 100644 --- a/3rdParty/SCons/scons-local/SCons/Script/SConsOptions.py +++ b/3rdParty/SCons/scons-local/SCons/Script/SConsOptions.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/SConsOptions.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Script/SConsOptions.py 4761 2010/04/04 14:04:44 bdeegan" import optparse import re @@ -870,8 +870,6 @@ def Parser(version): def opt_not_yet(option, opt, value, parser): msg = "Warning: the %s option is not yet implemented\n" % opt sys.stderr.write(msg) - sys.exit(0) - op.add_option('-l', '--load-average', '--max-load', nargs=1, type="int", diff --git a/3rdParty/SCons/scons-local/SCons/Script/SConscript.py b/3rdParty/SCons/scons-local/SCons/Script/SConscript.py index cde6dec..c0505ae 100644 --- a/3rdParty/SCons/scons-local/SCons/Script/SConscript.py +++ b/3rdParty/SCons/scons-local/SCons/Script/SConscript.py @@ -6,7 +6,7 @@ files. """ # -# 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 @@ -28,7 +28,7 @@ files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/SConscript.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Script/SConscript.py 4761 2010/04/04 14:04:44 bdeegan" import SCons import SCons.Action @@ -189,7 +189,11 @@ def _SConscript(fs, *files, **kw): # fs match so we can open the SConscript. fs.chdir(top, change_os_dir=1) if f.rexists(): - _file_ = open(f.rfile().get_abspath(), "r") + actual = f.rfile() + _file_ = open(actual.get_abspath(), "r") + elif f.srcnode().rexists(): + actual = f.srcnode().rfile() + _file_ = open(actual.get_abspath(), "r") elif f.has_src_builder(): # The SConscript file apparently exists in a source # code management system. Build it, but then clear @@ -233,8 +237,7 @@ def _SConscript(fs, *files, **kw): # interpret the stuff within the SConscript file # relative to where we are logically. fs.chdir(ldir, change_os_dir=0) - # TODO Not sure how to handle src_dir here - os.chdir(f.rfile().dir.get_abspath()) + os.chdir(actual.dir.get_abspath()) # Append the SConscript directory to the beginning # of sys.path so Python modules in the SConscript @@ -488,9 +491,10 @@ class SConsEnvironment(SCons.Environment.Base): def Exit(self, value=0): sys.exit(value) - def Export(self, *vars): + def Export(self, *vars, **kw): for var in vars: global_exports.update(compute_exports(self.Split(var))) + global_exports.update(kw) def GetLaunchDir(self): global launch_dir diff --git a/3rdParty/SCons/scons-local/SCons/Script/__init__.py b/3rdParty/SCons/scons-local/SCons/Script/__init__.py index fcfb717..875e921 100644 --- a/3rdParty/SCons/scons-local/SCons/Script/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Script/__init__.py @@ -12,7 +12,7 @@ it goes here. """ # -# 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 @@ -34,7 +34,7 @@ it goes here. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Script/__init__.py 4761 2010/04/04 14:04:44 bdeegan" import time start_time = time.time() diff --git a/3rdParty/SCons/scons-local/SCons/Sig.py b/3rdParty/SCons/scons-local/SCons/Sig.py index 6feb19c..7a3387a 100644 --- a/3rdParty/SCons/scons-local/SCons/Sig.py +++ b/3rdParty/SCons/scons-local/SCons/Sig.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Sig.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Sig.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Place-holder for the old SCons.Sig module hierarchy diff --git a/3rdParty/SCons/scons-local/SCons/Subst.py b/3rdParty/SCons/scons-local/SCons/Subst.py index 1127424..6db7ed3 100644 --- a/3rdParty/SCons/scons-local/SCons/Subst.py +++ b/3rdParty/SCons/scons-local/SCons/Subst.py @@ -5,7 +5,7 @@ SCons string substitution. """ # -# 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 @@ -27,7 +27,7 @@ SCons string substitution. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Subst.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Subst.py 4761 2010/04/04 14:04:44 bdeegan" import re import string diff --git a/3rdParty/SCons/scons-local/SCons/Taskmaster.py b/3rdParty/SCons/scons-local/SCons/Taskmaster.py index a33233d..3e80ac8 100644 --- a/3rdParty/SCons/scons-local/SCons/Taskmaster.py +++ b/3rdParty/SCons/scons-local/SCons/Taskmaster.py @@ -1,5 +1,5 @@ # -# 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 @@ -48,7 +48,7 @@ interface and the SCons build engine. There are two key classes here: target(s) that it decides need to be evaluated and/or built. """ -__revision__ = "src/engine/SCons/Taskmaster.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Taskmaster.py 4761 2010/04/04 14:04:44 bdeegan" from itertools import chain import operator @@ -359,7 +359,8 @@ class Task: for t in self.targets: t.disambiguate().set_state(NODE_EXECUTING) for s in t.side_effects: - s.set_state(NODE_EXECUTING) + # add disambiguate here to mirror the call on targets above + s.disambiguate().set_state(NODE_EXECUTING) def make_ready_current(self): """ @@ -390,7 +391,8 @@ class Task: for t in self.targets: t.set_state(NODE_EXECUTING) for s in t.side_effects: - s.set_state(NODE_EXECUTING) + # add disambiguate here to mirror the call on targets in first loop above + s.disambiguate().set_state(NODE_EXECUTING) else: for t in self.targets: # We must invoke visited() to ensure that the node @@ -797,7 +799,7 @@ class Taskmaster: children_not_ready = [] children_failed = False - for child in chain(children, executor.get_all_prerequisites()): + for child in chain(executor.get_all_prerequisites(), children): childstate = child.get_state() if T: T.write(self.trace_message(' ' + self.trace_node(child))) diff --git a/3rdParty/SCons/scons-local/SCons/Tool/386asm.py b/3rdParty/SCons/scons-local/SCons/Tool/386asm.py index 19dd14c..72b87a1 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/386asm.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/386asm.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/386asm.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/386asm.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.PharLapCommon import addPharLapPaths import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/BitKeeper.py b/3rdParty/SCons/scons-local/SCons/Tool/BitKeeper.py index 61476ca..407431f 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/BitKeeper.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/BitKeeper.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/BitKeeper.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/BitKeeper.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/CVS.py b/3rdParty/SCons/scons-local/SCons/Tool/CVS.py index 0782970..2334d13 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/CVS.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/CVS.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/CVS.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/CVS.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/FortranCommon.py b/3rdParty/SCons/scons-local/SCons/Tool/FortranCommon.py index 2cc4387..b982d61 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/FortranCommon.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/FortranCommon.py @@ -5,7 +5,7 @@ Stuff for processing Fortran, common to all fortran dialects. """ # -# 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 @@ -27,7 +27,7 @@ Stuff for processing Fortran, common to all fortran dialects. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/FortranCommon.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/FortranCommon.py 4761 2010/04/04 14:04:44 bdeegan" import re import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/JavaCommon.py b/3rdParty/SCons/scons-local/SCons/Tool/JavaCommon.py index cc3e421..2c5b5a2 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/JavaCommon.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/JavaCommon.py @@ -5,7 +5,7 @@ Stuff for processing Java. """ # -# 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 @@ -27,7 +27,7 @@ Stuff for processing Java. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/JavaCommon.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/JavaCommon.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path @@ -65,7 +65,8 @@ if java_parsing: interfaces, and anonymous inner classes.""" def __init__(self, version=default_java_version): - if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6'): + if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', + '5', '6'): msg = "Java version %s not supported" % version raise NotImplementedError, msg @@ -171,7 +172,7 @@ if java_parsing: if self.version in ('1.1', '1.2', '1.3', '1.4'): clazz = self.listClasses[0] self.listOutputs.append('%s$%d' % (clazz, self.nextAnon)) - elif self.version in ('1.5', '1.6'): + elif self.version in ('1.5', '1.6', '5', '6'): self.stackAnonClassBrackets.append(self.brackets) className = [] className.extend(self.listClasses) diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/__init__.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/__init__.py index 66afde3..01ba242 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/__init__.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ Common functions for Microsoft Visual Studio and Visual C/C++. @@ -36,10 +36,17 @@ import SCons.Errors import SCons.Platform.win32 import SCons.Util -from SCons.Tool.MSCommon.vs import detect_msvs, \ - get_default_version, \ +from SCons.Tool.MSCommon.sdk import mssdk_exists, \ + mssdk_setup_env + +from SCons.Tool.MSCommon.vc import msvc_exists, \ + msvc_setup_env, \ + msvc_setup_env_once + +from SCons.Tool.MSCommon.vs import get_default_version, \ get_vs_by_version, \ merge_default_version, \ + msvs_exists, \ query_versions # Local Variables: diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/arch.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/arch.py new file mode 100644 index 0000000..d80df7d --- /dev/null +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/arch.py @@ -0,0 +1,61 @@ +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py 4761 2010/04/04 14:04:44 bdeegan" + +__doc__ = """Module to define supported Windows chip architectures. +""" + +import os + +class ArchDefinition: + """ + A class for defining architecture-specific settings and logic. + """ + def __init__(self, arch, synonyms=[]): + self.arch = arch + self.synonyms = synonyms + +SupportedArchitectureList = [ + ArchitectureDefinition( + 'x86', + ['i386', 'i486', 'i586', 'i686'], + ), + + ArchitectureDefinition( + 'x86_64', + ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'], + ), + + ArchitectureDefinition( + 'ia64', + ['IA64'], + ), +] + +SupportedArchitectureMap = {} +for a in SupportedArchitectureList: + SupportedArchitectureMap[a.arch] = a + for s in a.synonyms: + SupportedArchitectureMap[s] = a + diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/common.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/common.py index 0cac163..2e7f430 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/common.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/common.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,10 +21,10 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ -Common helper functions for working with +Common helper functions for working with the Microsoft tool chain. """ import copy @@ -36,7 +36,10 @@ import SCons.Util logfile = os.environ.get('SCONS_MSCOMMON_DEBUG') -if logfile: +if logfile == '-': + def debug(x): + print x +elif logfile: try: import logging except ImportError: @@ -48,23 +51,51 @@ else: debug = lambda x: None -# TODO(sgk): unused +_is_win64 = None + def is_win64(): - """Return true if running on windows 64 bits.""" - # Unfortunately, python does not seem to have anything useful: neither - # sys.platform nor os.name gives something different on windows running on - # 32 bits or 64 bits. Note that we don't care about whether python itself - # is 32 or 64 bits here - value = "Software\Wow6432Node" - yo = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, value)[0] - if yo is None: - return 0 - else: - return 1 + """Return true if running on windows 64 bits. + + Works whether python itself runs in 64 bits or 32 bits.""" + # Unfortunately, python does not provide a useful way to determine + # if the underlying Windows OS is 32-bit or 64-bit. Worse, whether + # the Python itself is 32-bit or 64-bit affects what it returns, + # so nothing in sys.* or os.* help. + + # Apparently the best solution is to use env vars that Windows + # sets. If PROCESSOR_ARCHITECTURE is not x86, then the python + # process is running in 64 bit mode (on a 64-bit OS, 64-bit + # hardware, obviously). + # If this python is 32-bit but the OS is 64, Windows will set + # ProgramW6432 and PROCESSOR_ARCHITEW6432 to non-null. + # (Checking for HKLM\Software\Wow6432Node in the registry doesn't + # work, because some 32-bit installers create it.) + global _is_win64 + if _is_win64 is None: + # I structured these tests to make it easy to add new ones or + # add exceptions in the future, because this is a bit fragile. + _is_win64 = False + if os.environ.get('PROCESSOR_ARCHITECTURE','x86') != 'x86': + _is_win64 = True + if os.environ.get('PROCESSOR_ARCHITEW6432'): + _is_win64 = True + if os.environ.get('ProgramW6432'): + _is_win64 = True + return _is_win64 + def read_reg(value): return SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, value)[0] +def has_reg(value): + """Return True if the given key exists in HKEY_LOCAL_MACHINE, False + otherwise.""" + try: + SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value) + ret = True + except WindowsError: + ret = False + return ret # Functions for fetching environment variable settings from batch files. @@ -125,7 +156,7 @@ def parse_output(output, keep = ("INCLUDE", "LIB", "LIBPATH", "PATH")): for i in keep: rdk[i] = re.compile('%s=(.*)' % i, re.I) - def add_env(rmatch, key): + def add_env(rmatch, key, dkeep=dkeep): plist = rmatch.group(1).split(os.pathsep) for p in plist: # Do not add empty paths (when a var ends with ;) diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/netframework.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/netframework.py index 33a0224..eaf9e9b 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/netframework.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/netframework.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ """ diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/sdk.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/sdk.py index e11df4e..5ab58e3 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/sdk.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/sdk.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Module to detect the Platform/Windows SDK @@ -31,9 +31,12 @@ PSDK 2003 R1 is the earliest version detected. import os import SCons.Errors -from SCons.Tool.MSCommon.common import debug, read_reg import SCons.Util +import common + +debug = common.debug + # SDK Checks. This is of course a mess as everything else on MS platforms. Here # is what we do to detect the SDK: # @@ -69,24 +72,27 @@ class SDKDefinition: Return None if failed or the directory does not exist. """ if not SCons.Util.can_read_reg: - debug('find_sdk_dir(): can not read registry') + debug('find_sdk_dir(): can not read registry') return None hkey = self.HKEY_FMT % self.hkey_data + debug('find_sdk_dir(): checking registry:%s'%hkey) try: - sdk_dir = read_reg(hkey) + sdk_dir = common.read_reg(hkey) except WindowsError, e: - debug('find_sdk_dir(): no registry key %s' % hkey) + debug('find_sdk_dir(): no SDK registry key %s' % repr(hkey)) return None + debug('find_sdk_dir(): Trying SDK Dir: %s'%sdk_dir) + if not os.path.exists(sdk_dir): debug('find_sdk_dir(): %s not on file system' % sdk_dir) return None ftc = os.path.join(sdk_dir, self.sanity_check_file) if not os.path.exists(ftc): - debug("find_sdk_dir(): sanity check %s not found" % ftc) + debug("find_sdk_dir(): sanity check %s not found" % ftc) return None return sdk_dir @@ -99,6 +105,25 @@ class SDKDefinition: sdk_dir = self.find_sdk_dir() self._sdk_dir = sdk_dir return sdk_dir + + def get_sdk_vc_script(self,host_arch, target_arch): + """ Return the script to initialize the VC compiler installed by SDK + """ + + if (host_arch == 'amd64' and target_arch == 'x86'): + # No cross tools needed compiling 32 bits on 64 bit machine + host_arch=target_arch + + arch_string=target_arch + if (host_arch != target_arch): + arch_string='%s_%s'%(host_arch,target_arch) + + debug("sdk.py: get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s"%(arch_string, + host_arch, + target_arch)) + file=self.vc_setup_scripts.get(arch_string,None) + debug("sdk.py: get_sdk_vc_script():file:%s"%file) + return file class WindowsSDK(SDKDefinition): """ @@ -118,6 +143,27 @@ class PlatformSDK(SDKDefinition): apply(SDKDefinition.__init__, (self,)+args, kw) self.hkey_data = self.uuid +# +# The list of VC initialization scripts installed by the SDK +# These should be tried if the vcvarsall.bat TARGET_ARCH fails +preSDK61VCSetupScripts = { 'x86' : r'bin\vcvars32.bat', + 'amd64' : r'bin\vcvarsamd64.bat', + 'x86_amd64': r'bin\vcvarsx86_amd64.bat', + 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', + 'ia64' : r'bin\vcvarsia64.bat'} + +SDK61VCSetupScripts = {'x86' : r'bin\vcvars32.bat', + 'amd64' : r'bin\amd64\vcvarsamd64.bat', + 'x86_amd64': r'bin\x86_amd64\vcvarsx86_amd64.bat', + 'x86_ia64' : r'bin\x86_ia64\vcvarsx86_ia64.bat', + 'ia64' : r'bin\ia64\vcvarsia64.bat'} + +SDK70VCSetupScripts = { 'x86' : r'bin\vcvars32.bat', + 'amd64' : r'bin\vcvars64.bat', + 'x86_amd64': r'bin\vcvarsx86_amd64.bat', + 'x86_ia64' : r'bin\vcvarsx86_ia64.bat', + 'ia64' : r'bin\vcvarsia64.bat'} + # The list of support SDKs which we know how to detect. # # The first SDK found in the list is the one used by default if there @@ -126,22 +172,56 @@ class PlatformSDK(SDKDefinition): # # If you update this list, update the documentation in Tool/mssdk.xml. SupportedSDKList = [ + WindowsSDK('7.0', + sanity_check_file=r'bin\SetEnv.Cmd', + include_subdir='include', + lib_subdir={ + 'x86' : ['lib'], + 'x86_64' : [r'lib\x64'], + 'ia64' : [r'lib\ia64'], + }, + vc_setup_scripts = SDK70VCSetupScripts, + ), WindowsSDK('6.1', - sanity_check_file=r'include\windows.h'), + sanity_check_file=r'bin\SetEnv.Cmd', + include_subdir='include', + lib_subdir={ + 'x86' : ['lib'], + 'x86_64' : [r'lib\x64'], + 'ia64' : [r'lib\ia64'], + }, + vc_setup_scripts = SDK61VCSetupScripts, + ), WindowsSDK('6.0A', - sanity_check_file=r'include\windows.h'), + sanity_check_file=r'include\windows.h', + include_subdir='include', + lib_subdir={ + 'x86' : ['lib'], + 'x86_64' : [r'lib\x64'], + 'ia64' : [r'lib\ia64'], + }, + vc_setup_scripts = preSDK61VCSetupScripts, + ), WindowsSDK('6.0', - sanity_check_file=r'bin\gacutil.exe'), + sanity_check_file=r'bin\gacutil.exe', + include_subdir='include', + lib_subdir='lib', + vc_setup_scripts = preSDK61VCSetupScripts, + ), PlatformSDK('2003R2', sanity_check_file=r'SetEnv.Cmd', - uuid="D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1"), + uuid="D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1", + vc_setup_scripts = preSDK61VCSetupScripts, + ), PlatformSDK('2003R1', sanity_check_file=r'SetEnv.Cmd', - uuid="8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3"), + uuid="8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3", + vc_setup_scripts = preSDK61VCSetupScripts, + ), ] SupportedSDKMap = {} @@ -160,13 +240,14 @@ InstalledSDKMap = None def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap + debug('sdk.py:get_installed_sdks()') if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: - debug('trying to find SDK %s' % sdk.version) + debug('MSCommon/sdk.py: trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): - debug('found SDK %s' % sdk.version) + debug('MSCommon/sdk.py:found SDK %s' % sdk.version) InstalledSDKList.append(sdk) InstalledSDKMap[sdk.version] = sdk return InstalledSDKList @@ -181,6 +262,7 @@ SDKEnvironmentUpdates = {} def set_sdk_by_directory(env, sdk_dir): global SDKEnvironmentUpdates + debug('set_sdk_by_directory: Using dir:%s'%sdk_dir) try: env_tuple_list = SDKEnvironmentUpdates[sdk_dir] except KeyError: @@ -215,7 +297,7 @@ def get_cur_sdk_dir_from_reg(): return None try: - val = read_reg(_CURINSTALLED_SDK_HKEY_ROOT) + val = common.read_reg(_CURINSTALLED_SDK_HKEY_ROOT) debug("Found current sdk dir in registry: %s" % val) except WindowsError, e: debug("Did not find current sdk in registry") @@ -227,28 +309,80 @@ def get_cur_sdk_dir_from_reg(): return val - -def detect_sdk(): - return (len(get_installed_sdks()) > 0) - -def set_sdk_by_version(env, mssdk): +def get_sdk_by_version(mssdk): if not SupportedSDKMap.has_key(mssdk): msg = "SDK version %s is not supported" % repr(mssdk) raise SCons.Errors.UserError, msg get_installed_sdks() - sdk = InstalledSDKMap.get(mssdk) - if not sdk: - msg = "SDK version %s is not installed" % repr(mssdk) - raise SCons.Errors.UserError, msg - set_sdk_by_directory(env, sdk.get_sdk_dir()) + return InstalledSDKMap.get(mssdk) -def set_default_sdk(env, msver): +def get_default_sdk(): """Set up the default Platform/Windows SDK.""" - # For MSVS < 8, use integrated windows sdk by default - if msver >= 8: - sdks = get_installed_sdks() - if len(sdks) > 0: - set_sdk_by_directory(env, sdks[0].get_sdk_dir()) + get_installed_sdks() + if not InstalledSDKList: + return None + return InstalledSDKList[0] + + + + +def mssdk_setup_env(env): + debug('sdk.py:mssdk_setup_env()') + if env.has_key('MSSDK_DIR'): + sdk_dir = env['MSSDK_DIR'] + if sdk_dir is None: + return + sdk_dir = env.subst(sdk_dir) + debug('sdk.py:mssdk_setup_env: Using MSSDK_DIR:%s'%sdk_dir) + elif env.has_key('MSSDK_VERSION'): + sdk_version = env['MSSDK_VERSION'] + if sdk_version is None: + msg = "SDK version %s is not installed" % repr(mssdk) + raise SCons.Errors.UserError, msg + sdk_version = env.subst(sdk_version) + mssdk = get_sdk_by_version(sdk_version) + sdk_dir = mssdk.get_sdk_dir() + debug('sdk.py:mssdk_setup_env: Using MSSDK_VERSION:%s'%sdk_dir) + elif env.has_key('MSVS_VERSION'): + msvs_version = env['MSVS_VERSION'] + debug('sdk.py:mssdk_setup_env:Getting MSVS_VERSION from env:%s'%msvs_version) + if msvs_version is None: + debug('sdk.py:mssdk_setup_env thinks msvs_version is None') + return + msvs_version = env.subst(msvs_version) + import vs + msvs = vs.get_vs_by_version(msvs_version) + debug('sdk.py:mssdk_setup_env:msvs is :%s'%msvs) + if not msvs: + debug('sdk.py:mssdk_setup_env: no VS version detected, bailingout:%s'%msvs) + return + sdk_version = msvs.sdk_version + debug('sdk.py:msvs.sdk_version is %s'%sdk_version) + if not sdk_version: + return + mssdk = get_sdk_by_version(sdk_version) + if not mssdk: + mssdk = get_default_sdk() + if not mssdk: + return + sdk_dir = mssdk.get_sdk_dir() + debug('sdk.py:mssdk_setup_env: Using MSVS_VERSION:%s'%sdk_dir) + else: + mssdk = get_default_sdk() + if not mssdk: + return + sdk_dir = mssdk.get_sdk_dir() + debug('sdk.py:mssdk_setup_env: not using any env values. sdk_dir:%s'%sdk_dir) + + set_sdk_by_directory(env, sdk_dir) + + #print "No MSVS_VERSION: this is likely to be a bug" + +def mssdk_exists(version=None): + sdks = get_installed_sdks() + if version is None: + return len(sdks) > 0 + return sdks.has_key(version) # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vc.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vc.py new file mode 100644 index 0000000..bf2412b --- /dev/null +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vc.py @@ -0,0 +1,412 @@ +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +# TODO: +# * supported arch for versions: for old versions of batch file without +# argument, giving bogus argument cannot be detected, so we have to hardcode +# this here +# * print warning when msvc version specified but not found +# * find out why warning do not print +# * test on 64 bits XP + VS 2005 (and VS 6 if possible) +# * SDK +# * Assembly +__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 4761 2010/04/04 14:04:44 bdeegan" + +__doc__ = """Module for Visual C/C++ detection and configuration. +""" +import SCons.compat + +import string +import os +import platform + +import SCons.Warnings + +import common + +debug = common.debug + +import sdk + +get_installed_sdks = sdk.get_installed_sdks + + +class VisualCException(Exception): + pass + +class UnsupportedVersion(VisualCException): + pass + +class UnsupportedArch(VisualCException): + pass + +class MissingConfiguration(VisualCException): + pass + +class NoVersionFound(VisualCException): + pass + +class BatchFileExecutionError(VisualCException): + pass + +# Dict to 'canonalize' the arch +_ARCH_TO_CANONICAL = { + "x86": "x86", + "amd64": "amd64", + "i386": "x86", + "emt64": "amd64", + "x86_64": "amd64", + "itanium": "ia64", + "ia64": "ia64", +} + +# Given a (host, target) tuple, return the argument for the bat file. Both host +# and targets should be canonalized. +_HOST_TARGET_ARCH_TO_BAT_ARCH = { + ("x86", "x86"): "x86", + ("x86", "amd64"): "x86_amd64", + ("amd64", "amd64"): "amd64", + ("amd64", "x86"): "x86", + ("x86", "ia64"): "x86_ia64" +} + +def get_host_target(env): + host_platform = env.get('HOST_ARCH') + if not host_platform: + host_platform = platform.machine() + # TODO(2.5): the native Python platform.machine() function returns + # '' on all Python versions before 2.6, after which it also uses + # PROCESSOR_ARCHITECTURE. + if not host_platform: + host_platform = os.environ.get('PROCESSOR_ARCHITECTURE', '') + target_platform = env.get('TARGET_ARCH') + if not target_platform: + target_platform = host_platform + + try: + host = _ARCH_TO_CANONICAL[host_platform] + except KeyError, e: + msg = "Unrecognized host architecture %s" + raise ValueError(msg % repr(host_platform)) + + try: + target = _ARCH_TO_CANONICAL[target_platform] + except KeyError, e: + raise ValueError("Unrecognized target architecture %s" % target_platform) + + return (host, target) + +_VCVER = ["10.0", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"] + +_VCVER_TO_PRODUCT_DIR = { + '10.0': [ + r'Microsoft\VisualStudio\10.0\Setup\VC\ProductDir'], + '9.0': [ + r'Microsoft\VisualStudio\9.0\Setup\VC\ProductDir'], + '9.0Exp' : [ + r'Microsoft\VCExpress\9.0\Setup\VC\ProductDir'], + '8.0': [ + r'Microsoft\VisualStudio\8.0\Setup\VC\ProductDir'], + '8.0Exp': [ + r'Microsoft\VCExpress\8.0\Setup\VC\ProductDir'], + '7.1': [ + r'Microsoft\VisualStudio\7.1\Setup\VC\ProductDir'], + '7.0': [ + r'Microsoft\VisualStudio\7.0\Setup\VC\ProductDir'], + '6.0': [ + r'Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir'] +} + +def msvc_version_to_maj_min(msvc_version): + msvc_ver_numeric = string.join(filter(lambda x: x in string.digits + ".", msvc_version), '') + + t = msvc_version_numeric.split(".") + if not len(t) == 2: + raise ValueError("Unrecognized version %s" % msvc_version) + try: + maj = int(t[0]) + min = int(t[1]) + return maj, min + except ValueError, e: + raise ValueError("Unrecognized version %s" % msvc_version) + +def is_host_target_supported(host_target, msvc_version): + """Return True if the given (host, target) tuple is supported given the + msvc version. + + Parameters + ---------- + host_target: tuple + tuple of (canonalized) host-target, e.g. ("x86", "amd64") for cross + compilation from 32 bits windows to 64 bits. + msvc_version: str + msvc version (major.minor, e.g. 10.0) + + Note + ---- + This only check whether a given version *may* support the given (host, + target), not that the toolchain is actually present on the machine. + """ + # We assume that any Visual Studio version supports x86 as a target + if host_target[1] != "x86": + maj, min = msvc_version_to_maj_min(msvc_version) + if maj < 8: + return False + + return True + +def find_vc_pdir(msvc_version): + """Try to find the product directory for the given + version. + + Note + ---- + If for some reason the requested version could not be found, an + exception which inherits from VisualCException will be raised.""" + root = 'Software\\' + if common.is_win64(): + root = root + 'Wow6432Node\\' + try: + hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version] + except KeyError: + debug("Unknown version of MSVC: %s" % msvc_version) + raise UnsupportedVersion("Unknown version %s" % msvc_version) + + for key in hkeys: + key = root + key + try: + comps = common.read_reg(key) + except WindowsError, e: + debug('find_vc_dir(): no VC registry key %s' % repr(key)) + else: + debug('find_vc_dir(): found VC in registry: %s' % comps) + if os.path.exists(comps): + return comps + else: + debug('find_vc_dir(): reg says dir is %s, but it does not exist. (ignoring)'\ + % comps) + raise MissingConfiguration("registry dir %s not found on the filesystem" % comps) + return None + +def find_batch_file(env,msvc_version): + """ + Find the location of the batch script which should set up the compiler + for any TARGET_ARCH whose compilers were installed by Visual Studio/VCExpress + """ + pdir = find_vc_pdir(msvc_version) + if pdir is None: + raise NoVersionFound("No version of Visual Studio found") + + debug('vc.py: find_batch_file() pdir:%s'%pdir) + + # filter out e.g. "Exp" from the version name + msvc_ver_numeric = string.join(filter(lambda x: x in string.digits + ".", msvc_version), '') + vernum = float(msvc_ver_numeric) + if 7 <= vernum < 8: + pdir = os.path.join(pdir, os.pardir, "Common7", "Tools") + batfilename = os.path.join(pdir, "vsvars32.bat") + elif vernum < 7: + pdir = os.path.join(pdir, "Bin") + batfilename = os.path.join(pdir, "vcvars32.bat") + else: # >= 8 + batfilename = os.path.join(pdir, "vcvarsall.bat") + + if not os.path.exists(batfilename): + debug("Not found: %s" % batfilename) + batfilename = None + + installed_sdks=get_installed_sdks() + (host_arch,target_arch)=get_host_target(env) + for _sdk in installed_sdks: + sdk_bat_file=_sdk.get_sdk_vc_script(host_arch,target_arch) + sdk_bat_file_path=os.path.join(pdir,sdk_bat_file) + debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path) + if os.path.exists(sdk_bat_file_path): + return (batfilename,sdk_bat_file_path) + else: + debug("vc.py:find_batch_file() not found:%s"%sdk_bat_file_path) + else: + return (batfilename,None) + +__INSTALLED_VCS_RUN = None + +def cached_get_installed_vcs(): + global __INSTALLED_VCS_RUN + + if __INSTALLED_VCS_RUN is None: + ret = get_installed_vcs() + __INSTALLED_VCS_RUN = ret + + return __INSTALLED_VCS_RUN + +def get_installed_vcs(): + installed_versions = [] + for ver in _VCVER: + debug('trying to find VC %s' % ver) + try: + if find_vc_pdir(ver): + debug('found VC %s' % ver) + installed_versions.append(ver) + else: + debug('find_vc_pdir return None for ver %s' % ver) + except VisualCException, e: + debug('did not find VC %s: caught exception %s' % (ver, str(e))) + return installed_versions + +def reset_installed_vcs(): + """Make it try again to find VC. This is just for the tests.""" + __INSTALLED_VCS_RUN = None + +def script_env(script, args=None): + stdout = common.get_output(script, args) + # Stupid batch files do not set return code: we take a look at the + # beginning of the output for an error message instead + olines = stdout.splitlines() + if olines[0].startswith("The specified configuration type is missing"): + raise BatchFileExecutionError("\n".join(olines[:2])) + + return common.parse_output(stdout) + +def get_default_version(env): + debug('get_default_version()') + + msvc_version = env.get('MSVC_VERSION') + msvs_version = env.get('MSVS_VERSION') + + debug('get_default_version(): msvc_version:%s msvs_version:%s'%(msvc_version,msvs_version)) + + if msvs_version and not msvc_version: + SCons.Warnings.warn( + SCons.Warnings.DeprecatedWarning, + "MSVS_VERSION is deprecated: please use MSVC_VERSION instead ") + return msvs_version + elif msvc_version and msvs_version: + if not msvc_version == msvs_version: + SCons.Warnings.warn( + SCons.Warnings.VisualVersionMismatch, + "Requested msvc version (%s) and msvs version (%s) do " \ + "not match: please use MSVC_VERSION only to request a " \ + "visual studio version, MSVS_VERSION is deprecated" \ + % (msvc_version, msvs_version)) + return msvs_version + if not msvc_version: + installed_vcs = cached_get_installed_vcs() + debug('installed_vcs:%s' % installed_vcs) + if not installed_vcs: + msg = 'No installed VCs' + debug('msv %s\n' % repr(msg)) + SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, msg) + return None + msvc_version = installed_vcs[0] + debug('msvc_setup_env: using default installed MSVC version %s\n' % repr(msvc_version)) + + return msvc_version + +def msvc_setup_env_once(env): + try: + has_run = env["MSVC_SETUP_RUN"] + except KeyError: + has_run = False + + if not has_run: + msvc_setup_env(env) + env["MSVC_SETUP_RUN"] = True + +def msvc_setup_env(env): + debug('msvc_setup_env()') + + version = get_default_version(env) + if version is None: + warn_msg = "No version of Visual Studio compiler found - C/C++ " \ + "compilers most likely not set correctly" + SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) + return None + debug('msvc_setup_env: using specified MSVC version %s\n' % repr(version)) + + # XXX: we set-up both MSVS version for backward + # compatibility with the msvs tool + env['MSVC_VERSION'] = version + env['MSVS_VERSION'] = version + env['MSVS'] = {} + + try: + (vc_script,sdk_script) = find_batch_file(env,version) + debug('vc.py:msvc_setup_env() vc_script:%s sdk_script:%s'%(vc_script,sdk_script)) + except VisualCException, e: + msg = str(e) + debug('Caught exception while looking for batch file (%s)' % msg) + warn_msg = "VC version %s not installed. " + \ + "C/C++ compilers are most likely not set correctly.\n" + \ + " Installed versions are: %s" + warn_msg = warn_msg % (version, cached_get_installed_vcs()) + SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) + return None + + debug('vc.py:msvc_setup_env() vc_script:%s sdk_script:%s'%(vc_script,sdk_script)) + use_script = env.get('MSVC_USE_SCRIPT', True) + if SCons.Util.is_String(use_script): + debug('use_script 1 %s\n' % repr(use_script)) + d = script_env(use_script) + elif use_script: + host_platform, target_platform = get_host_target(env) + host_target = (host_platform, target_platform) + if not is_host_target_supported(host_target, version): + warn_msg = "host, target = %s not supported for MSVC version %s" % \ + (host_target, version) + SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) + arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target] + debug('use_script 2 %s, args:%s\n' % (repr(vc_script), arg)) + if vc_script: + try: + d = script_env(vc_script, args=arg) + except BatchFileExecutionError, e: + debug('use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e)) + vc_script=None + if not vc_script and sdk_script: + debug('use_script 4: trying sdk script: %s'%(sdk_script)) + try: + d = script_env(sdk_script,args=[]) + except BatchFileExecutionError,e: + debug('use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e)) + return None + elif not vc_script and not sdk_script: + debug('use_script 6: Neither VC script nor SDK script found') + return None + + else: + debug('MSVC_USE_SCRIPT set to False') + warn_msg = "MSVC_USE_SCRIPT set to False, assuming environment " \ + "set correctly." + SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) + return None + + for k, v in d.items(): + debug('vc.py:msvc_setup_env() env:%s -> %s'%(k,v)) + env.PrependENVPath(k, v, delete_existing=True) + +def msvc_exists(version=None): + vcs = cached_get_installed_vcs() + if version is None: + return len(vcs) > 0 + return version in vcs + diff --git a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vs.py b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vs.py index 2203e20..2dce362 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vs.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/MSCommon/vs.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """Module to detect Visual Studio and/or Visual C/C++ """ @@ -31,11 +31,14 @@ import os import SCons.Errors import SCons.Util -from SCons.Tool.MSCommon.common import debug, \ - read_reg, \ - normalize_env, \ - get_output, \ - parse_output +from common import debug, \ + get_output, \ + is_win64, \ + normalize_env, \ + parse_output, \ + read_reg + +import SCons.Tool.MSCommon.vc class VisualStudio: """ @@ -44,70 +47,75 @@ class VisualStudio: """ def __init__(self, version, **kw): self.version = version + kw['vc_version'] = kw.get('vc_version', version) + kw['sdk_version'] = kw.get('sdk_version', version) self.__dict__.update(kw) self._cache = {} # def find_batch_file(self): - """Try to find the Visual Studio or Visual C/C++ batch file. - - Return None if failed or the batch file does not exist. - """ - pdir = self.get_vc_product_dir() - if not pdir: - debug('find_batch_file(): no pdir') + vs_dir = self.get_vs_dir() + if not vs_dir: + debug('find_executable(): no vs_dir') return None - batch_file = os.path.normpath(os.path.join(pdir, self.batch_file)) + batch_file = os.path.join(vs_dir, self.batch_file_path) batch_file = os.path.normpath(batch_file) if not os.path.isfile(batch_file): debug('find_batch_file(): %s not on file system' % batch_file) return None return batch_file + def find_vs_dir_by_vc(self): + SCons.Tool.MSCommon.vc.get_installed_vcs() + dir = SCons.Tool.MSCommon.vc.find_vc_pdir(self.vc_version) + if not dir: + debug('find_vs_dir(): no installed VC %s' % self.vc_version) + return None + return dir + + def find_vs_dir_by_reg(self): + root = 'Software\\' + + if is_win64(): + root = root + 'Wow6432Node\\' + for key in self.hkeys: + if key=='use_dir': + return self.find_vs_dir_by_vc() + key = root + key + try: + comps = read_reg(key) + except WindowsError, e: + debug('find_vs_dir_by_reg(): no VS registry key %s' % repr(key)) + else: + debug('find_vs_dir_by_reg(): found VS in registry: %s' % comps) + return comps + return None + + def find_vs_dir(self): + """ Can use registry or location of VC to find vs dir + First try to find by registry, and if that fails find via VC dir + """ + + + if True: + vs_dir=self.find_vs_dir_by_reg() + return vs_dir + else: + return self.find_vs_dir_by_vc() + def find_executable(self): - pdir = self.get_vc_product_dir() - if not pdir: - debug('find_executable(): no pdir') + vs_dir = self.get_vs_dir() + if not vs_dir: + debug('find_executable(): no vs_dir (%s)'%vs_dir) return None - executable = os.path.join(pdir, self.executable_path) + executable = os.path.join(vs_dir, self.executable_path) executable = os.path.normpath(executable) if not os.path.isfile(executable): debug('find_executable(): %s not on file system' % executable) return None return executable - - def find_vc_product_dir(self): - if not SCons.Util.can_read_reg: - debug('find_vc_product_dir(): can not read registry') - return None - key = self.hkey_root + '\\' + self.vc_product_dir_key - try: - comps = read_reg(key) - except WindowsError, e: - debug('find_vc_product_dir(): no registry key %s' % key) - else: - if self.batch_file_dir_reg_relpath: - comps = os.path.join(comps, self.batch_file_dir_reg_relpath) - comps = os.path.normpath(comps) - if os.path.exists(comps): - return comps - else: - debug('find_vc_product_dir(): %s not on file system' % comps) - - d = os.environ.get(self.common_tools_var) - if not d: - msg = 'find_vc_product_dir(): no %s variable' - debug(msg % self.common_tools_var) - return None - if not os.path.isdir(d): - debug('find_vc_product_dir(): %s not on file system' % d) - return None - if self.batch_file_dir_env_relpath: - d = os.path.join(d, self.batch_file_dir_env_relpath) - d = os.path.normpath(d) - return d - + # def get_batch_file(self): @@ -120,12 +128,22 @@ class VisualStudio: def get_executable(self): try: + debug('get_executable using cache:%s'%self._cache['executable']) return self._cache['executable'] except KeyError: executable = self.find_executable() self._cache['executable'] = executable + debug('get_executable not in cache:%s'%executable) return executable + def get_vs_dir(self): + try: + return self._cache['vs_dir'] + except KeyError: + vs_dir = self.find_vs_dir() + self._cache['vs_dir'] = vs_dir + return vs_dir + def get_supported_arch(self): try: return self._cache['supported_arch'] @@ -135,14 +153,6 @@ class VisualStudio: self._cache['supported_arch'] = self.supported_arch return self.supported_arch - def get_vc_product_dir(self): - try: - return self._cache['vc_product_dir'] - except KeyError: - vc_product_dir = self.find_vc_product_dir() - self._cache['vc_product_dir'] = vc_product_dir - return vc_product_dir - def reset(self): self._cache = {} @@ -197,10 +207,6 @@ SupportedVSList = [ #VisualStudio('TBD', # hkey_root=r'TBD', # common_tools_var='TBD', - # batch_file='TBD', - # vc_product_dir_key=r'TBD', - # batch_file_dir_reg_relpath=None, - # batch_file_dir_env_relpath=r'TBD', # executable_path=r'TBD', # default_dirname='TBD', #), @@ -209,13 +215,11 @@ SupportedVSList = [ # The batch file we look for is in the VC directory, # so the devenv.com executable is up in ..\..\Common7\IDE. VisualStudio('9.0', - hkey_root=r'Software\Microsoft\VisualStudio\9.0', + sdk_version='6.1', + hkeys=[r'Microsoft\VisualStudio\9.0\Setup\VS\ProductDir'], common_tools_var='VS90COMNTOOLS', - batch_file='vcvarsall.bat', - vc_product_dir_key=r'Setup\VC\ProductDir', - batch_file_dir_reg_relpath=None, - batch_file_dir_env_relpath=r'..\..\VC', - executable_path=r'..\Common7\IDE\devenv.com', + executable_path=r'Common7\IDE\devenv.com', + batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 9', supported_arch=['x86', 'amd64'], ), @@ -224,13 +228,12 @@ SupportedVSList = [ # The batch file we look for is in the VC directory, # so the VCExpress.exe executable is up in ..\..\Common7\IDE. VisualStudio('9.0Exp', - hkey_root=r'Software\Microsoft\VisualStudio\9.0', + vc_version='9.0', + sdk_version='6.1', + hkeys=[r'Microsoft\VCExpress\9.0\Setup\VS\ProductDir'], common_tools_var='VS90COMNTOOLS', - batch_file='vcvarsall.bat', - vc_product_dir_key=r'Setup\VC\ProductDir', - batch_file_dir_reg_relpath=None, - batch_file_dir_env_relpath=r'..\..\VC', - executable_path=r'..\Common7\IDE\VCExpress.exe', + executable_path=r'Common7\IDE\VCExpress.exe', + batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 9', supported_arch=['x86'], ), @@ -239,13 +242,11 @@ SupportedVSList = [ # The batch file we look for is in the VC directory, # so the devenv.com executable is up in ..\..\Common7\IDE. VisualStudio('8.0', - hkey_root=r'Software\Microsoft\VisualStudio\8.0', + sdk_version='6.0A', + hkeys=[r'Microsoft\VisualStudio\8.0\Setup\VS\ProductDir'], common_tools_var='VS80COMNTOOLS', - batch_file='vcvarsall.bat', - vc_product_dir_key=r'Setup\VC\ProductDir', - batch_file_dir_reg_relpath=None, - batch_file_dir_env_relpath=r'..\..\VC', - executable_path=r'..\Common7\IDE\devenv.com', + executable_path=r'Common7\IDE\devenv.com', + batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 8', supported_arch=['x86', 'amd64'], ), @@ -254,15 +255,12 @@ SupportedVSList = [ # The batch file we look for is in the VC directory, # so the VCExpress.exe executable is up in ..\..\Common7\IDE. VisualStudio('8.0Exp', - hkey_root=r'Software\Microsoft\VCExpress\8.0', + vc_version='8.0Exp', + sdk_version='6.0A', + hkeys=[r'Microsoft\VCExpress\8.0\Setup\VS\ProductDir'], common_tools_var='VS80COMNTOOLS', - batch_file='vcvarsall.bat', - vc_product_dir_key=r'Setup\VC\ProductDir', - batch_file_dir_reg_relpath=None, - batch_file_dir_env_relpath=r'..\..\VC', - # The batch file is in the VC directory, so - # so the devenv.com executable is next door in ..\IDE. - executable_path=r'..\Common7\IDE\VCExpress.exe', + executable_path=r'Common7\IDE\VCExpress.exe', + batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio 8', supported_arch=['x86'], ), @@ -271,14 +269,12 @@ SupportedVSList = [ # The batch file we look for is in the Common7\Tools directory, # so the devenv.com executable is next door in ..\IDE. VisualStudio('7.1', - hkey_root=r'Software\Microsoft\VisualStudio\7.1', + sdk_version='6.0', + hkeys=[r'Microsoft\VisualStudio\7.1\Setup\VS\ProductDir'], common_tools_var='VS71COMNTOOLS', - batch_file='vsvars32.bat', - vc_product_dir_key=r'Setup\VC\ProductDir', - batch_file_dir_reg_relpath=r'..\Common7\Tools', - batch_file_dir_env_relpath=None, - executable_path=r'..\IDE\devenv.com', - default_dirname='Microsoft Visual Studio .NET', + executable_path=r'Common7\IDE\devenv.com', + batch_file_path=r'Common7\Tools\vsvars32.bat', + default_dirname='Microsoft Visual Studio .NET 2003', supported_arch=['x86'], ), @@ -286,26 +282,23 @@ SupportedVSList = [ # The batch file we look for is in the Common7\Tools directory, # so the devenv.com executable is next door in ..\IDE. VisualStudio('7.0', - hkey_root=r'Software\Microsoft\VisualStudio\7.0', + sdk_version='2003R2', + hkeys=[r'Microsoft\VisualStudio\7.0\Setup\VS\ProductDir'], common_tools_var='VS70COMNTOOLS', - batch_file='vsvars32.bat', - vc_product_dir_key=r'Setup\VC\ProductDir', - batch_file_dir_reg_relpath=r'..\Common7\Tools', - batch_file_dir_env_relpath=None, - executable_path=r'..\IDE\devenv.com', + executable_path=r'IDE\devenv.com', + batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio .NET', supported_arch=['x86'], ), # Visual Studio 6.0 VisualStudio('6.0', - hkey_root=r'Software\Microsoft\VisualStudio\6.0', + sdk_version='2003R1', + hkeys=[r'Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Studio\ProductDir', + 'use_dir'], common_tools_var='VS60COMNTOOLS', - batch_file='vcvars32.bat', - vc_product_dir_key='Setup\Microsoft Visual C++\ProductDir', - batch_file_dir_reg_relpath='Bin', - batch_file_dir_env_relpath=None, executable_path=r'Common\MSDev98\Bin\MSDEV.COM', + batch_file_path=r'Common7\Tools\vsvars32.bat', default_dirname='Microsoft Visual Studio', supported_arch=['x86'], ), @@ -323,7 +316,7 @@ for vs in SupportedVSList: # requested, and cache it. InstalledVSList = None -InstalledVSMap = None +InstalledVSMap = None def get_installed_visual_studios(): global InstalledVSList @@ -343,10 +336,14 @@ def reset_installed_visual_studios(): global InstalledVSList global InstalledVSMap InstalledVSList = None - InstalledVSMap = None + InstalledVSMap = None for vs in SupportedVSList: vs.reset() - + + # Need to clear installed VC's as well as they are used in finding + # installed VS's + SCons.Tool.MSCommon.vc.reset_installed_vcs() + # We may be asked to update multiple construction environments with # SDK information. When doing this, we check on-disk for whether @@ -380,15 +377,21 @@ def reset_installed_visual_studios(): # for variable, directory in env_tuple_list: # env.PrependENVPath(variable, directory) -def detect_msvs(): +def msvs_exists(): return (len(get_installed_visual_studios()) > 0) def get_vs_by_version(msvs): + global InstalledVSMap + global SupportedVSMap + + debug('vs.py:get_vs_by_version()') if not SupportedVSMap.has_key(msvs): msg = "Visual Studio version %s is not supported" % repr(msvs) raise SCons.Errors.UserError, msg get_installed_visual_studios() vs = InstalledVSMap.get(msvs) + debug('InstalledVSMap:%s'%InstalledVSMap) + debug('vs.py:get_vs_by_version: found vs:%s'%vs) # Some check like this would let us provide a useful error message # if they try to set a Visual Studio version that's not installed. # However, we also want to be able to run tests (like the unit @@ -456,10 +459,11 @@ def merge_default_version(env): version = get_default_version(env) arch = get_default_arch(env) +def msvs_setup_env(env): + batfilename = msvs.get_batch_file() msvs = get_vs_by_version(version) if msvs is None: return - batfilename = msvs.get_batch_file() # XXX: I think this is broken. This will silently set a bogus tool instead # of failing, but there is no other way with the current scons tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/Perforce.py b/3rdParty/SCons/scons-local/SCons/Tool/Perforce.py index 2dbdbbb..0b5124e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/Perforce.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/Perforce.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/Perforce.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/Perforce.py 4761 2010/04/04 14:04:44 bdeegan" import os diff --git a/3rdParty/SCons/scons-local/SCons/Tool/PharLapCommon.py b/3rdParty/SCons/scons-local/SCons/Tool/PharLapCommon.py index 1d7779e..f2e0e62 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/PharLapCommon.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/PharLapCommon.py @@ -7,7 +7,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and """ # -# 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 @@ -29,7 +29,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/RCS.py b/3rdParty/SCons/scons-local/SCons/Tool/RCS.py index 96ee313..3030d85 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/RCS.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/RCS.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/RCS.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/RCS.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/SCCS.py b/3rdParty/SCons/scons-local/SCons/Tool/SCCS.py index 7baa34c..db7f9b5 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/SCCS.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/SCCS.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/SCCS.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/SCCS.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/Subversion.py b/3rdParty/SCons/scons-local/SCons/Tool/Subversion.py index 063bf8d..0c036a9 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/Subversion.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/Subversion.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/Subversion.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/Subversion.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/__init__.py b/3rdParty/SCons/scons-local/SCons/Tool/__init__.py index 5b31300..c62c06b 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/__init__.py @@ -14,7 +14,7 @@ tool definition. """ # -# 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 @@ -36,7 +36,7 @@ tool definition. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/__init__.py 4761 2010/04/04 14:04:44 bdeegan" import imp import sys @@ -550,6 +550,7 @@ def FindAllTools(tools, env): def tool_list(platform, env): + other_plat_tools=[] # XXX this logic about what tool to prefer on which platform # should be moved into either the platform files or # the tool files themselves. @@ -563,14 +564,15 @@ def tool_list(platform, env): assemblers = ['masm', 'nasm', 'gas', '386asm' ] fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran'] ars = ['mslib', 'ar', 'tlib'] + other_plat_tools=['msvs','midl'] elif str(platform) == 'os2': "prefer IBM tools on OS/2" - linkers = ['ilink', 'gnulink', 'mslink'] - c_compilers = ['icc', 'gcc', 'msvc', 'cc'] - cxx_compilers = ['icc', 'g++', 'msvc', 'c++'] - assemblers = ['nasm', 'masm', 'gas'] + linkers = ['ilink', 'gnulink', ]#'mslink'] + c_compilers = ['icc', 'gcc',]# 'msvc', 'cc'] + cxx_compilers = ['icc', 'g++',]# 'msvc', 'c++'] + assemblers = ['nasm',]# 'masm', 'gas'] fortran_compilers = ['ifl', 'g77'] - ars = ['ar', 'mslib'] + ars = ['ar',]# 'mslib'] elif str(platform) == 'irix': "prefer MIPSPro on IRIX" linkers = ['sgilink', 'gnulink'] @@ -650,14 +652,14 @@ def tool_list(platform, env): 'dvipdf', 'dvips', 'gs', 'jar', 'javac', 'javah', 'latex', 'lex', - 'm4', 'midl', 'msvs', + 'm4', #'midl', 'msvs', 'pdflatex', 'pdftex', 'Perforce', 'RCS', 'rmic', 'rpcgen', 'SCCS', # 'Subversion', 'swig', 'tar', 'tex', - 'yacc', 'zip', 'rpm', 'wix'], + 'yacc', 'zip', 'rpm', 'wix']+other_plat_tools, env) tools = ([linker, c_compiler, cxx_compiler, diff --git a/3rdParty/SCons/scons-local/SCons/Tool/aixc++.py b/3rdParty/SCons/scons-local/SCons/Tool/aixc++.py index e22f736..92f5d37 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/aixc++.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/aixc++.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixc++.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/aixc++.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/aixcc.py b/3rdParty/SCons/scons-local/SCons/Tool/aixcc.py index dccb926..f44ca07 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/aixcc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/aixcc.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixcc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/aixcc.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/aixf77.py b/3rdParty/SCons/scons-local/SCons/Tool/aixf77.py index 8bb022a..349dae4 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/aixf77.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/aixf77.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixf77.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/aixf77.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/aixlink.py b/3rdParty/SCons/scons-local/SCons/Tool/aixlink.py index 7f96c4a..128b174 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/aixlink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/aixlink.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixlink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/aixlink.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/applelink.py b/3rdParty/SCons/scons-local/SCons/Tool/applelink.py index 826b119..9b1e76a 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/applelink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/applelink.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/applelink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/applelink.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/ar.py b/3rdParty/SCons/scons-local/SCons/Tool/ar.py index fbff55c..078a93a 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/ar.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/ar.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ar.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/ar.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/as.py b/3rdParty/SCons/scons-local/SCons/Tool/as.py index 635df6d..cbc8b67 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/as.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/as.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/as.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/as.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/bcc32.py b/3rdParty/SCons/scons-local/SCons/Tool/bcc32.py index e92b654..674afc8 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/bcc32.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/bcc32.py @@ -5,7 +5,7 @@ XXX """ # -# 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 @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/bcc32.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/bcc32.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/c++.py b/3rdParty/SCons/scons-local/SCons/Tool/c++.py index fabcbd7..c3ee9ff 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/c++.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/c++.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/c++.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/c++.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/cc.py b/3rdParty/SCons/scons-local/SCons/Tool/cc.py index 82d4565..0166c54 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/cc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/cc.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/cc.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Tool import SCons.Defaults diff --git a/3rdParty/SCons/scons-local/SCons/Tool/cvf.py b/3rdParty/SCons/scons-local/SCons/Tool/cvf.py index e743654..4bdca4e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/cvf.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/cvf.py @@ -5,7 +5,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler. """ # -# 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 @@ -27,7 +27,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cvf.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/cvf.py 4761 2010/04/04 14:04:44 bdeegan" import fortran diff --git a/3rdParty/SCons/scons-local/SCons/Tool/default.py b/3rdParty/SCons/scons-local/SCons/Tool/default.py index a7df8aa..36eb46a 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/default.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/default.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/default.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/default.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/dmd.py b/3rdParty/SCons/scons-local/SCons/Tool/dmd.py index 1e67822..cbd701f 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/dmd.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/dmd.py @@ -32,7 +32,7 @@ Lib tool variables: """ # -# 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 @@ -54,7 +54,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dmd.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/dmd.py 4761 2010/04/04 14:04:44 bdeegan" import os import string @@ -200,7 +200,7 @@ def generate(env): libs = env['LIBS'] except KeyError: libs = [] - if 'phobos' not in libs: + if 'phobos' not in libs and 'gphobos' not in libs: if dc is 'dmd': env.Append(LIBS = ['phobos']) elif dc is 'gdmd': diff --git a/3rdParty/SCons/scons-local/SCons/Tool/dvi.py b/3rdParty/SCons/scons-local/SCons/Tool/dvi.py index 8d67697..1d66c50 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/dvi.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/dvi.py @@ -5,7 +5,7 @@ Common DVI Builder definition for various other Tool modules that use it. """ # -# 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 @@ -27,7 +27,7 @@ Common DVI Builder definition for various other Tool modules that use it. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvi.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/dvi.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Builder import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/dvipdf.py b/3rdParty/SCons/scons-local/SCons/Tool/dvipdf.py index 1fbf4b3..40bb410 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/dvipdf.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/dvipdf.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvipdf.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/dvipdf.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Defaults diff --git a/3rdParty/SCons/scons-local/SCons/Tool/dvips.py b/3rdParty/SCons/scons-local/SCons/Tool/dvips.py index 7242622..5e2710a 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/dvips.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/dvips.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvips.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/dvips.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/f77.py b/3rdParty/SCons/scons-local/SCons/Tool/f77.py index e9299bc..d8f3283 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/f77.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/f77.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f77.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/f77.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/3rdParty/SCons/scons-local/SCons/Tool/f90.py b/3rdParty/SCons/scons-local/SCons/Tool/f90.py index 58ccc6b..014a078 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/f90.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/f90.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f90.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/f90.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/3rdParty/SCons/scons-local/SCons/Tool/f95.py b/3rdParty/SCons/scons-local/SCons/Tool/f95.py index 1097212..dc58b17 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/f95.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/f95.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f95.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/f95.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/filesystem.py b/3rdParty/SCons/scons-local/SCons/Tool/filesystem.py index 0c34337..1131595 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/filesystem.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/filesystem.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/filesystem.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/filesystem.py 4761 2010/04/04 14:04:44 bdeegan" import SCons from SCons.Tool.install import copyFunc diff --git a/3rdParty/SCons/scons-local/SCons/Tool/fortran.py b/3rdParty/SCons/scons-local/SCons/Tool/fortran.py index 83dc43a..6c2e050 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/fortran.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/fortran.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/fortran.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/fortran.py 4761 2010/04/04 14:04:44 bdeegan" import re import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/g++.py b/3rdParty/SCons/scons-local/SCons/Tool/g++.py index d21643b..57c7f0e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/g++.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/g++.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/g++.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/g++.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import re diff --git a/3rdParty/SCons/scons-local/SCons/Tool/g77.py b/3rdParty/SCons/scons-local/SCons/Tool/g77.py index 84b0ed9..be3da07 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/g77.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/g77.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/g77.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/g77.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env diff --git a/3rdParty/SCons/scons-local/SCons/Tool/gas.py b/3rdParty/SCons/scons-local/SCons/Tool/gas.py index 997690f..02d5f31 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/gas.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/gas.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gas.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/gas.py 4761 2010/04/04 14:04:44 bdeegan" as_module = __import__('as', globals(), locals(), []) diff --git a/3rdParty/SCons/scons-local/SCons/Tool/gcc.py b/3rdParty/SCons/scons-local/SCons/Tool/gcc.py index 90dd4d0..9fbb317 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/gcc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/gcc.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gcc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/gcc.py 4761 2010/04/04 14:04:44 bdeegan" import cc import os diff --git a/3rdParty/SCons/scons-local/SCons/Tool/gfortran.py b/3rdParty/SCons/scons-local/SCons/Tool/gfortran.py index 0a67b4c..d10bb39 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/gfortran.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/gfortran.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gfortran.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/gfortran.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/gnulink.py b/3rdParty/SCons/scons-local/SCons/Tool/gnulink.py index ca9672e..4329a2b 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/gnulink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/gnulink.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gnulink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/gnulink.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/gs.py b/3rdParty/SCons/scons-local/SCons/Tool/gs.py index 28b14f3..3038a32 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/gs.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/gs.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gs.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/gs.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Platform diff --git a/3rdParty/SCons/scons-local/SCons/Tool/hpc++.py b/3rdParty/SCons/scons-local/SCons/Tool/hpc++.py index 0754611..5faf492 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/hpc++.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/hpc++.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpc++.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/hpc++.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/hpcc.py b/3rdParty/SCons/scons-local/SCons/Tool/hpcc.py index 2762015..7d3b1c1 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/hpcc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/hpcc.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpcc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/hpcc.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/hplink.py b/3rdParty/SCons/scons-local/SCons/Tool/hplink.py index f47a436..17acfc1 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/hplink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/hplink.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hplink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/hplink.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/icc.py b/3rdParty/SCons/scons-local/SCons/Tool/icc.py index e2a7388..493497f 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/icc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/icc.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/icc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/icc.py 4761 2010/04/04 14:04:44 bdeegan" import cc diff --git a/3rdParty/SCons/scons-local/SCons/Tool/icl.py b/3rdParty/SCons/scons-local/SCons/Tool/icl.py index afead06..2463ceb 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/icl.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/icl.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/icl.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/icl.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Tool.intelc diff --git a/3rdParty/SCons/scons-local/SCons/Tool/ifl.py b/3rdParty/SCons/scons-local/SCons/Tool/ifl.py index f728ed5..a5b0dd0 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/ifl.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/ifl.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifl.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/ifl.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/3rdParty/SCons/scons-local/SCons/Tool/ifort.py b/3rdParty/SCons/scons-local/SCons/Tool/ifort.py index 2ef55f3..cbe0931 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/ifort.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/ifort.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifort.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/ifort.py 4761 2010/04/04 14:04:44 bdeegan" import string @@ -65,7 +65,8 @@ def generate(env): for dialect in ['F77', 'F90', 'FORTRAN', 'F95']: env['%s' % dialect] = fc env['SH%s' % dialect] = '$%s' % dialect - env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS -fPIC' % dialect) + if env['PLATFORM'] == 'posix': + env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS -fPIC' % dialect) if env['PLATFORM'] == 'win32': # On Windows, the ifort compiler specifies the object on the diff --git a/3rdParty/SCons/scons-local/SCons/Tool/ilink.py b/3rdParty/SCons/scons-local/SCons/Tool/ilink.py index 94a6f63..dd6cc90 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/ilink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/ilink.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/ilink.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/ilink32.py b/3rdParty/SCons/scons-local/SCons/Tool/ilink32.py index 474649d..ca49e88 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/ilink32.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/ilink32.py @@ -5,7 +5,7 @@ XXX """ # -# 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 @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink32.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/ilink32.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/install.py b/3rdParty/SCons/scons-local/SCons/Tool/install.py index 9596db1..6ae75af 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/install.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/install.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/install.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/install.py 4761 2010/04/04 14:04:44 bdeegan" import os import shutil @@ -86,7 +86,7 @@ def installFunc(target, source, env): def stringFunc(target, source, env): installstr = env.get('INSTALLSTR') if installstr: - return env.subst_target_source(installstr, 1, target, source) + return env.subst_target_source(installstr, 0, target, source) target = str(target[0]) source = str(source[0]) if os.path.isdir(source): diff --git a/3rdParty/SCons/scons-local/SCons/Tool/intelc.py b/3rdParty/SCons/scons-local/SCons/Tool/intelc.py index 3ced16a..1326a5b 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/intelc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/intelc.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/intelc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/intelc.py 4761 2010/04/04 14:04:44 bdeegan" import math, sys, os.path, glob, string, re @@ -259,7 +259,9 @@ def get_intel_compiler_top(version, abi): if not SCons.Util.can_read_reg: raise NoRegistryModuleError, "No Windows registry module was found" top = get_intel_registry_value('ProductDir', version, abi) - if not os.path.exists(os.path.join(top, "Bin", "icl.exe")): + # pre-11, icl was in Bin. 11 and later, it's in Bin/<abi> apparently. + if not os.path.exists(os.path.join(top, "Bin", "icl.exe")) \ + and not os.path.exists(os.path.join(top, "Bin", abi, "icl.exe")): raise MissingDirError, \ "Can't find Intel compiler in %s"%(top) elif is_mac or is_linux: diff --git a/3rdParty/SCons/scons-local/SCons/Tool/ipkg.py b/3rdParty/SCons/scons-local/SCons/Tool/ipkg.py new file mode 100644 index 0000000..746734c --- /dev/null +++ b/3rdParty/SCons/scons-local/SCons/Tool/ipkg.py @@ -0,0 +1,71 @@ +"""SCons.Tool.ipkg + +Tool-specific initialization for ipkg. + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +The ipkg tool calls the ipkg-build. Its only argument should be the +packages fake_root. +""" + +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "src/engine/SCons/Tool/ipkg.py 4761 2010/04/04 14:04:44 bdeegan" + +import os +import string + +import SCons.Builder + +def generate(env): + """Add Builders and construction variables for ipkg to an Environment.""" + try: + bld = env['BUILDERS']['Ipkg'] + except KeyError: + bld = SCons.Builder.Builder( action = '$IPKGCOM', + suffix = '$IPKGSUFFIX', + source_scanner = None, + target_scanner = None) + env['BUILDERS']['Ipkg'] = bld + + env['IPKG'] = 'ipkg-build' + env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}' + # TODO(1.5) + #env['IPKGUSER'] = os.popen('id -un').read().strip() + #env['IPKGGROUP'] = os.popen('id -gn').read().strip() + env['IPKGUSER'] = string.strip(os.popen('id -un').read()) + env['IPKGGROUP'] = string.strip(os.popen('id -gn').read()) + env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP') + env['IPKGSUFFIX'] = '.ipk' + +def exists(env): + return env.Detect('ipkg-build') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/3rdParty/SCons/scons-local/SCons/Tool/jar.py b/3rdParty/SCons/scons-local/SCons/Tool/jar.py index ddd5f66..3079a73 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/jar.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/jar.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/jar.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/jar.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Subst import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/javac.py b/3rdParty/SCons/scons-local/SCons/Tool/javac.py index f528ca2..596b3d0 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/javac.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/javac.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/javac.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/javac.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/javah.py b/3rdParty/SCons/scons-local/SCons/Tool/javah.py index dc18a08..bc26ecf 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/javah.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/javah.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/javah.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/javah.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/latex.py b/3rdParty/SCons/scons-local/SCons/Tool/latex.py index 310f1ab..cabb875 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/latex.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/latex.py @@ -1,6 +1,7 @@ """SCons.Tool.latex Tool-specific initialization for LaTeX. +Generates .dvi files from .latex or .ltx files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -9,7 +10,7 @@ selection method. """ # -# 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 @@ -31,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/latex.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/latex.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Defaults @@ -40,10 +41,10 @@ import SCons.Util import SCons.Tool import SCons.Tool.tex -LaTeXAction = None - def LaTeXAuxFunction(target = None, source= None, env=None): - result = SCons.Tool.tex.InternalLaTeXAuxAction( LaTeXAction, target, source, env ) + result = SCons.Tool.tex.InternalLaTeXAuxAction( SCons.Tool.tex.LaTeXAction, target, source, env ) + if result != 0: + print env['LATEX']," returned an error, check the log file" return result LaTeXAuxAction = SCons.Action.Action(LaTeXAuxFunction, @@ -51,9 +52,8 @@ LaTeXAuxAction = SCons.Action.Action(LaTeXAuxFunction, def generate(env): """Add Builders and construction variables for LaTeX to an Environment.""" - global LaTeXAction - if LaTeXAction is None: - LaTeXAction = SCons.Action.Action('$LATEXCOM', '$LATEXCOMSTR') + + env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) import dvi dvi.generate(env) @@ -67,10 +67,7 @@ def generate(env): bld.add_emitter('.ltx', SCons.Tool.tex.tex_eps_emitter) bld.add_emitter('.latex', SCons.Tool.tex.tex_eps_emitter) - env['LATEX'] = 'latex' - env['LATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') - env['LATEXCOM'] = 'cd ${TARGET.dir} && $LATEX $LATEXFLAGS ${SOURCE.file}' - env['LATEXRETRIES'] = 3 + SCons.Tool.tex.generate_common(env) def exists(env): return env.Detect('latex') diff --git a/3rdParty/SCons/scons-local/SCons/Tool/lex.py b/3rdParty/SCons/scons-local/SCons/Tool/lex.py index 656d5a6..c751adf 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/lex.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/lex.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/lex.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/lex.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/link.py b/3rdParty/SCons/scons-local/SCons/Tool/link.py index 8192637..32a47eb 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/link.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/link.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/link.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/link.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/linkloc.py b/3rdParty/SCons/scons-local/SCons/Tool/linkloc.py index 7fd3a3b..d0718d1 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/linkloc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/linkloc.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/linkloc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/linkloc.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import re @@ -43,7 +43,7 @@ import SCons.Errors import SCons.Tool import SCons.Util -from SCons.Tool.MSCommon import detect_msvs, merge_default_version +from SCons.Tool.MSCommon import msvs_exists, merge_default_version from SCons.Tool.PharLapCommon import addPharLapPaths _re_linker_command = re.compile(r'(\s)@\s*([^\s]+)') @@ -100,7 +100,7 @@ def generate(env): addPharLapPaths(env) def exists(env): - if detect_msvs(): + if msvs_exists(): return env.Detect('linkloc') else: return 0 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/m4.py b/3rdParty/SCons/scons-local/SCons/Tool/m4.py index 1ce3eac..4f7c85e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/m4.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/m4.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/m4.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/m4.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/masm.py b/3rdParty/SCons/scons-local/SCons/Tool/masm.py index b22a514..174d66f 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/masm.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/masm.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/masm.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/masm.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/midl.py b/3rdParty/SCons/scons-local/SCons/Tool/midl.py index 4c69358..294f107 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/midl.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/midl.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/midl.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/midl.py 4761 2010/04/04 14:04:44 bdeegan" import string @@ -41,7 +41,7 @@ import SCons.Defaults import SCons.Scanner.IDL import SCons.Util -from MSCommon import detect_msvs +from MSCommon import msvc_exists def midl_emitter(target, source, env): """Produces a list of outputs from the MIDL compiler""" @@ -81,7 +81,7 @@ def generate(env): env['BUILDERS']['TypeLibrary'] = midl_builder def exists(env): - return detect_msvs() + return msvc_exists() # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/mingw.py b/3rdParty/SCons/scons-local/SCons/Tool/mingw.py index aab45bb..bbdbb0f 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/mingw.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/mingw.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mingw.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/mingw.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/mslib.py b/3rdParty/SCons/scons-local/SCons/Tool/mslib.py index f76ac9d..26a54b9 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/mslib.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/mslib.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mslib.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/mslib.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool @@ -39,14 +39,14 @@ import SCons.Tool.msvs import SCons.Tool.msvc import SCons.Util -from MSCommon import detect_msvs, merge_default_version +from MSCommon import msvc_exists, msvc_setup_env_once def generate(env): """Add Builders and construction variables for lib to an Environment.""" SCons.Tool.createStaticLibBuilder(env) - # Set-up ms tools paths for default version - merge_default_version(env) + # Set-up ms tools paths + msvc_setup_env_once(env) env['AR'] = 'lib' env['ARFLAGS'] = SCons.Util.CLVar('/nologo') @@ -55,7 +55,7 @@ def generate(env): env['LIBSUFFIX'] = '.lib' def exists(env): - return detect_msvs() + return msvc_exists() # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/mslink.py b/3rdParty/SCons/scons-local/SCons/Tool/mslink.py index 1bad3c9..2e42919 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/mslink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/mslink.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mslink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/mslink.py 4761 2010/04/04 14:04:44 bdeegan" import os.path @@ -44,7 +44,7 @@ import SCons.Tool.msvc import SCons.Tool.msvs import SCons.Util -from MSCommon import merge_default_version, detect_msvs +from MSCommon import msvc_setup_env_once, msvc_exists def pdbGenerator(env, target, source, for_signature): try: @@ -238,8 +238,9 @@ def generate(env): env['REGSVRFLAGS'] = '/s ' env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}' - # Set-up ms tools paths for default version - merge_default_version(env) + # Set-up ms tools paths + msvc_setup_env_once(env) + # Loadable modules are on Windows the same as shared libraries, but they # are subject to different build parameters (LDMODULE* variables). @@ -256,7 +257,7 @@ def generate(env): env['LDMODULECOM'] = compositeLdmodAction def exists(env): - return detect_msvs() + return msvc_exists() # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/mssdk.py b/3rdParty/SCons/scons-local/SCons/Tool/mssdk.py index 4277d58..9402e0e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/mssdk.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/mssdk.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mssdk.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/mssdk.py 4761 2010/04/04 14:04:44 bdeegan" """engine.SCons.Tool.mssdk @@ -33,29 +33,15 @@ It will usually be imported through the generic SCons.Tool.Tool() selection method. """ -from SCons.Tool.MSCommon.sdk import detect_sdk, \ - set_default_sdk, \ - set_sdk_by_directory, \ - set_sdk_by_version +from MSCommon import mssdk_exists, \ + mssdk_setup_env def generate(env): """Add construction variables for an MS SDK to an Environment.""" - if env.has_key('MSSDK_DIR'): - set_sdk_by_directory(env, env.subst('$MSSDK_DIR')) - return - - if env.has_key('MSSDK_VERSION'): - set_sdk_by_version(env, env.subst('$MSSDK_VERSION')) - return - - if env.has_key('MSVS_VERSION'): - set_default_sdk(env, env['MSVS_VERSION']) - - #print "No MSVS_VERSION: this is likely to be a bug" - return + mssdk_setup_env(env) def exists(env): - return detect_sdk() + return mssdk_exists() # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/msvc.py b/3rdParty/SCons/scons-local/SCons/Tool/msvc.py index bd29ed0..a323652 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/msvc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/msvc.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/msvc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/msvc.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import re @@ -48,7 +48,7 @@ import SCons.Util import SCons.Warnings import SCons.Scanner.RC -from MSCommon import merge_default_version, detect_msvs +from MSCommon import msvc_exists, msvc_setup_env_once CSuffixes = ['.c', '.C'] CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++'] @@ -89,8 +89,20 @@ def object_emitter(target, source, env, parent_emitter): parent_emitter(target, source, env) - if env.has_key('PCH') and env['PCH']: - env.Depends(target, env['PCH']) + # Add a dependency, but only if the target (e.g. 'Source1.obj') + # doesn't correspond to the pre-compiled header ('Source1.pch'). + # If the basenames match, then this was most likely caused by + # someone adding the source file to both the env.PCH() and the + # env.Program() calls, and adding the explicit dependency would + # cause a cycle on the .pch file itself. + # + # See issue #2505 for a discussion of what to do if it turns + # out this assumption causes trouble in the wild: + # http://scons.tigris.org/issues/show_bug.cgi?id=2505 + if env.has_key('PCH'): + pch = env['PCH'] + if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj': + env.Depends(target, pch) return (target, source) @@ -232,11 +244,8 @@ def generate(env): env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX' - # Set-up ms tools paths for default version - merge_default_version(env) - - import mssdk - mssdk.generate(env) + # Set-up ms tools paths + msvc_setup_env_once(env) env['CFILESUFFIX'] = '.c' env['CXXFILESUFFIX'] = '.cc' @@ -251,7 +260,7 @@ def generate(env): env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root() def exists(env): - return detect_msvs() + return msvc_exists() # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/msvs.py b/3rdParty/SCons/scons-local/SCons/Tool/msvs.py index 11e7dce..b7bc205 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/msvs.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/msvs.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/msvs.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/msvs.py 4761 2010/04/04 14:04:44 bdeegan" import base64 import hashlib @@ -49,7 +49,8 @@ import SCons.Script.SConscript import SCons.Util import SCons.Warnings -from MSCommon import detect_msvs, merge_default_version +from MSCommon import msvc_exists, msvc_setup_env_once +from SCons.Defaults import processDefines ############################################################################## # Below here are the classes and functions for generation of @@ -689,7 +690,7 @@ class _GenerateV7DSP(_DSPGenerator): # TODO(1.5) #preprocdefs = xmlify(';'.join(self.env.get('CPPDEFINES', []))) #includepath = xmlify(';'.join(self.env.get('CPPPATH', []))) - preprocdefs = xmlify(string.join(self.env.get('CPPDEFINES', []), ';')) + preprocdefs = xmlify(string.join(processDefines(self.env.get('CPPDEFINES', [])), ';')) includepath = xmlify(string.join(self.env.get('CPPPATH', []), ';')) if not env_has_buildtarget: @@ -1407,9 +1408,14 @@ def generate(env): env['MSVSENCODING'] = 'Windows-1252' # Set-up ms tools paths for default version - merge_default_version(env) + msvc_setup_env_once(env) - version_num, suite = msvs_parse_version(env['MSVS_VERSION']) + if env.has_key('MSVS_VERSION'): + version_num, suite = msvs_parse_version(env['MSVS_VERSION']) + else: + (version_num, suite) = (7.0, None) # guess at a default + if not env.has_key('MSVS'): + env['MSVS'] = {} if (version_num < 7.0): env['MSVS']['PROJECTSUFFIX'] = '.dsp' env['MSVS']['SOLUTIONSUFFIX'] = '.dsw' @@ -1424,7 +1430,7 @@ def generate(env): env['SCONS_HOME'] = os.environ.get('SCONS_HOME') def exists(env): - return detect_msvs() + return msvc_exists() # Local Variables: # tab-width:4 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/mwcc.py b/3rdParty/SCons/scons-local/SCons/Tool/mwcc.py index f2966d2..13d533e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/mwcc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/mwcc.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwcc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/mwcc.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/mwld.py b/3rdParty/SCons/scons-local/SCons/Tool/mwld.py index 6d1bde8..544ef99 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/mwld.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/mwld.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwld.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/mwld.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/nasm.py b/3rdParty/SCons/scons-local/SCons/Tool/nasm.py index ee4fd35..24d38c8 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/nasm.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/nasm.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/nasm.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/nasm.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/__init__.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/__init__.py index 77a9c7a..693e549 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/__init__.py @@ -4,7 +4,7 @@ SCons Packaging Tool. """ # -# 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 @@ SCons Packaging Tool. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/__init__.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Environment from SCons.Variables import * diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/ipk.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/ipk.py index cca98c2..a6d1883 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/ipk.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/ipk.py @@ -2,7 +2,7 @@ """ # -# 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 @@ -24,7 +24,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/ipk.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/ipk.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Builder import SCons.Node.FS diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/msi.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/msi.py index fd61e0b..aac5038 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/msi.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/msi.py @@ -4,7 +4,7 @@ The msi packager. """ # -# 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 @@ The msi packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/msi.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/msi.py 4761 2010/04/04 14:04:44 bdeegan" import os import SCons @@ -163,7 +163,7 @@ def generate_guids(root): To handle this requirement, the uuid is generated with an md5 hashing the whole subtree of a xml node. """ - from md5 import md5 + from hashlib import md5 # specify which tags need a guid and in which attribute this should be stored. needs_id = { 'Product' : 'Id', diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/rpm.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/rpm.py index 0380121..ea0dd1d 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/rpm.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/rpm.py @@ -4,7 +4,7 @@ The rpm packager. """ # -# 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 @@ The rpm packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/rpm.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/rpm.py 4761 2010/04/04 14:04:44 bdeegan" import os import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_tarbz2.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_tarbz2.py index 54daddd..bf76542 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_tarbz2.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_tarbz2.py @@ -4,7 +4,7 @@ The tarbz2 SRC packager. """ # -# 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 @@ The tarbz2 SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_targz.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_targz.py index 6ec6336..ece79d1 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_targz.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_targz.py @@ -4,7 +4,7 @@ The targz SRC packager. """ # -# 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 @@ The targz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_zip.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_zip.py index 54a3a12..e363817 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_zip.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/src_zip.py @@ -4,7 +4,7 @@ The zip SRC packager. """ # -# 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 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/tarbz2.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/tarbz2.py index 9e3df17..cca3dbd 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/tarbz2.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/tarbz2.py @@ -4,7 +4,7 @@ The tarbz2 SRC packager. """ # -# 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 @@ The tarbz2 SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/targz.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/targz.py index a3714a5..b653f4c 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/targz.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/targz.py @@ -4,7 +4,7 @@ The targz SRC packager. """ # -# 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 @@ The targz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/targz.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/targz.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/3rdParty/SCons/scons-local/SCons/Tool/packaging/zip.py b/3rdParty/SCons/scons-local/SCons/Tool/packaging/zip.py index d955c3d..59462bd 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/packaging/zip.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/packaging/zip.py @@ -4,7 +4,7 @@ The zip SRC packager. """ # -# 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 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/zip.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/packaging/zip.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/3rdParty/SCons/scons-local/SCons/Tool/pdf.py b/3rdParty/SCons/scons-local/SCons/Tool/pdf.py index 333f84f..3edec06 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/pdf.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/pdf.py @@ -6,7 +6,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf """ # -# 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 @@ -28,7 +28,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdf.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/pdf.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Builder import SCons.Tool @@ -64,7 +64,7 @@ def generate2(env): env['EPSTOPDF'] = 'epstopdf' env['EPSTOPDFFLAGS'] = SCons.Util.CLVar('') - env['EPSTOPDFCOM'] = '$EPSTOPDF $EPSTOPDFFLAGS ${SOURCE} -o ${TARGET}' + env['EPSTOPDFCOM'] = '$EPSTOPDF $EPSTOPDFFLAGS ${SOURCE} --outfile=${TARGET}' def exists(env): # This only puts a skeleton Builder in place, so if someone diff --git a/3rdParty/SCons/scons-local/SCons/Tool/pdflatex.py b/3rdParty/SCons/scons-local/SCons/Tool/pdflatex.py index d5da5b1..7bc04f2 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/pdflatex.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/pdflatex.py @@ -1,6 +1,7 @@ """SCons.Tool.pdflatex Tool-specific initialization for pdflatex. +Generates .pdf files from .latex or .ltx files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -9,7 +10,7 @@ selection method. """ # -# 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 @@ -31,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdflatex.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/pdflatex.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Util @@ -42,6 +43,8 @@ PDFLaTeXAction = None def PDFLaTeXAuxFunction(target = None, source= None, env=None): result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env ) + if result != 0: + print env['PDFLATEX']," returned an error, check the log file" return result PDFLaTeXAuxAction = None @@ -57,6 +60,8 @@ def generate(env): PDFLaTeXAuxAction = SCons.Action.Action(PDFLaTeXAuxFunction, strfunction=SCons.Tool.tex.TeXLaTeXStrFunction) + env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) + import pdf pdf.generate(env) @@ -66,10 +71,7 @@ def generate(env): bld.add_emitter('.ltx', SCons.Tool.tex.tex_pdf_emitter) bld.add_emitter('.latex', SCons.Tool.tex.tex_pdf_emitter) - env['PDFLATEX'] = 'pdflatex' - env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') - env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}' - env['LATEXRETRIES'] = 3 + SCons.Tool.tex.generate_common(env) def exists(env): return env.Detect('pdflatex') diff --git a/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py b/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py index c6e2e30..ea21d33 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py @@ -1,6 +1,7 @@ """SCons.Tool.pdftex Tool-specific initialization for pdftex. +Generates .pdf files from .tex files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -9,7 +10,7 @@ selection method. """ # -# 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 @@ -31,8 +32,9 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdftex.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/pdftex.py 4761 2010/04/04 14:04:44 bdeegan" +import os import SCons.Action import SCons.Util import SCons.Tool.tex @@ -51,10 +53,17 @@ def PDFTeXLaTeXFunction(target = None, source= None, env=None): """A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.""" - if SCons.Tool.tex.is_LaTeX(source): + basedir = os.path.split(str(source[0]))[0] + abspath = os.path.abspath(basedir) + + if SCons.Tool.tex.is_LaTeX(source,env,abspath): result = PDFLaTeXAuxAction(target,source,env) + if result != 0: + print env['PDFLATEX']," returned an error, check the log file" else: result = PDFTeXAction(target,source,env) + if result != 0: + print env['PDFTEX']," returned an error, check the log file" return result PDFTeXLaTeXAction = None @@ -74,6 +83,8 @@ def generate(env): PDFTeXLaTeXAction = SCons.Action.Action(PDFTeXLaTeXFunction, strfunction=SCons.Tool.tex.TeXLaTeXStrFunction) + env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) + import pdf pdf.generate(env) @@ -85,15 +96,7 @@ def generate(env): # so pdftex is the default for no source suffix pdf.generate2(env) - env['PDFTEX'] = 'pdftex' - env['PDFTEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') - env['PDFTEXCOM'] = 'cd ${TARGET.dir} && $PDFTEX $PDFTEXFLAGS ${SOURCE.file}' - - # Duplicate from latex.py. If latex.py goes away, then this is still OK. - env['PDFLATEX'] = 'pdflatex' - env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') - env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}' - env['LATEXRETRIES'] = 3 + SCons.Tool.tex.generate_common(env) def exists(env): return env.Detect('pdftex') diff --git a/3rdParty/SCons/scons-local/SCons/Tool/qt.py b/3rdParty/SCons/scons-local/SCons/Tool/qt.py index cf99080..d51a708 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/qt.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/qt.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/qt.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/qt.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import re diff --git a/3rdParty/SCons/scons-local/SCons/Tool/rmic.py b/3rdParty/SCons/scons-local/SCons/Tool/rmic.py index a743e04..5d8ff03 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/rmic.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/rmic.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rmic.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/rmic.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/rpcgen.py b/3rdParty/SCons/scons-local/SCons/Tool/rpcgen.py index 727cdce..92ffbb9 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/rpcgen.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/rpcgen.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpcgen.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/rpcgen.py 4761 2010/04/04 14:04:44 bdeegan" from SCons.Builder import Builder import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/rpm.py b/3rdParty/SCons/scons-local/SCons/Tool/rpm.py index d085d99..3a1a0e7 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/rpm.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/rpm.py @@ -11,7 +11,7 @@ tar.gz consisting of the source file and a specfile. """ # -# 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 @@ -33,7 +33,7 @@ tar.gz consisting of the source file and a specfile. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpm.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/rpm.py 4761 2010/04/04 14:04:44 bdeegan" import os import re diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sgiar.py b/3rdParty/SCons/scons-local/SCons/Tool/sgiar.py index 6df401a..00ecd2d 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sgiar.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sgiar.py @@ -11,7 +11,7 @@ selection method. """ # -# 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 @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgiar.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sgiar.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sgic++.py b/3rdParty/SCons/scons-local/SCons/Tool/sgic++.py index 262ad53..c2a473f 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sgic++.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sgic++.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgic++.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sgic++.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sgicc.py b/3rdParty/SCons/scons-local/SCons/Tool/sgicc.py index b8ef3d7..f2f2f96 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sgicc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sgicc.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgicc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sgicc.py 4761 2010/04/04 14:04:44 bdeegan" import cc diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sgilink.py b/3rdParty/SCons/scons-local/SCons/Tool/sgilink.py index a9ac31f..c6460d4 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sgilink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sgilink.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgilink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sgilink.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sunar.py b/3rdParty/SCons/scons-local/SCons/Tool/sunar.py index 5f7288e..b198996 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sunar.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sunar.py @@ -10,7 +10,7 @@ selection method. """ # -# 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 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunar.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sunar.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sunc++.py b/3rdParty/SCons/scons-local/SCons/Tool/sunc++.py index c2bcf8e..68e7b66 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sunc++.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sunc++.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,18 +31,68 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunc++.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sunc++.py 4761 2010/04/04 14:04:44 bdeegan" import SCons -import os.path +import os +import re +import subprocess cplusplus = __import__('c++', globals(), locals(), []) +package_info = {} + +def get_package_info(package_name, pkginfo, pkgchk): + try: + return package_info[package_name] + except KeyError: + version = None + pathname = None + try: + sadm_contents = open('/var/sadm/install/contents', 'r').read() + except EnvironmentError: + pass + else: + sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M) + sadm_match = sadm_re.search(sadm_contents) + if sadm_match: + pathname = os.path.dirname(sadm_match.group(1)) + + try: + p = subprocess.Popen([pkginfo, '-l', package_name], + stdout=subprocess.PIPE, + stderr=open('/dev/null', 'w')) + except EnvironmentError: + pass + else: + pkginfo_contents = p.communicate()[0] + version_re = re.compile('^ *VERSION:\s*(.*)$', re.M) + version_match = version_re.search(pkginfo_contents) + if version_match: + version = version_match.group(1) + + if pathname is None: + try: + p = subprocess.Popen([pkgchk, '-l', package_name], + stdout=subprocess.PIPE, + stderr=open('/dev/null', 'w')) + except EnvironmentError: + pass + else: + pkgchk_contents = p.communicate()[0] + pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M) + pathname_match = pathname_re.search(pkgchk_contents) + if pathname_match: + pathname = os.path.dirname(pathname_match.group(1)) + + package_info[package_name] = (pathname, version) + return package_info[package_name] + # use the package installer tool lslpp to figure out where cppc and what # version of it is installed def get_cppc(env): - cxx = env.get('CXX', None) + cxx = env.subst('$CXX') if cxx: cppcPath = os.path.dirname(cxx) else: @@ -53,25 +103,11 @@ def get_cppc(env): pkginfo = env.subst('$PKGINFO') pkgchk = env.subst('$PKGCHK') - def look_pkg_db(pkginfo=pkginfo, pkgchk=pkgchk): - version = None - path = None - for package in ['SPROcpl']: - cmd = "%s -l %s 2>/dev/null | grep '^ *VERSION:'" % (pkginfo, package) - line = os.popen(cmd).readline() - if line: - version = line.split()[-1] - cmd = "%s -l %s 2>/dev/null | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package) - line = os.popen(cmd).readline() - if line: - path = os.path.dirname(line.split()[-1]) - break - - return path, version - - path, version = look_pkg_db() - if path and version: - cppcPath, cppcVersion = path, version + for package in ['SPROcpl']: + path, version = get_package_info(package, pkginfo, pkgchk) + if path and version: + cppcPath, cppcVersion = path, version + break return (cppcPath, 'CC', 'CC', cppcVersion) diff --git a/3rdParty/SCons/scons-local/SCons/Tool/suncc.py b/3rdParty/SCons/scons-local/SCons/Tool/suncc.py index 5f171d3..9913912 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/suncc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/suncc.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/suncc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/suncc.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sunf77.py b/3rdParty/SCons/scons-local/SCons/Tool/sunf77.py index 95e35bf..6c84007 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sunf77.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sunf77.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf77.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sunf77.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sunf90.py b/3rdParty/SCons/scons-local/SCons/Tool/sunf90.py index db2bfda..cc6662e 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sunf90.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sunf90.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf90.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sunf90.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sunf95.py b/3rdParty/SCons/scons-local/SCons/Tool/sunf95.py index 3a1b326..ec8afcd 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sunf95.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sunf95.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf95.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sunf95.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Util diff --git a/3rdParty/SCons/scons-local/SCons/Tool/sunlink.py b/3rdParty/SCons/scons-local/SCons/Tool/sunlink.py index 3e97aa9..8acce84 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/sunlink.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/sunlink.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunlink.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/sunlink.py 4761 2010/04/04 14:04:44 bdeegan" import os import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Tool/swig.py b/3rdParty/SCons/scons-local/SCons/Tool/swig.py index 947cfde..c734c97 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/swig.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/swig.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,11 +31,12 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/swig.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/swig.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import re import string +import subprocess import SCons.Action import SCons.Defaults @@ -62,7 +63,13 @@ def _find_modules(src): case.)""" directors = 0 mnames = [] - matches = _reModule.findall(open(src).read()) + try: + matches = _reModule.findall(open(src).read()) + except IOError: + # If the file's not yet generated, guess the module name from the filename + matches = [] + mnames.append(os.path.splitext(src)[0]) + for m in matches: mnames.append(m[2]) directors = directors or string.find(m[0], 'directors') >= 0 @@ -90,8 +97,18 @@ def _swigEmitter(target, source, env): mnames, directors = _find_modules(src) if directors: _add_director_header_targets(target, env) - target.extend(map(lambda m, d=target[0].dir: - d.File(m + ".py"), mnames)) + python_files = map(lambda m: m + ".py", mnames) + outdir = env.subst('$SWIGOUTDIR', target=target, source=source) + # .py files should be generated in SWIGOUTDIR if specified, + # otherwise in the same directory as the target + if outdir: + python_files = map(lambda j, o=outdir, e=env: + e.fs.File(os.path.join(o, j)), + python_files) + else: + python_files = map(lambda m, d=target[0].dir: + d.File(m), python_files) + target.extend(python_files) if "-java" in flags: if mnames is None: mnames, directors = _find_modules(src) @@ -109,6 +126,19 @@ def _swigEmitter(target, source, env): target.extend(java_files) return (target, source) +def _get_swig_version(env): + """Run the SWIG command line tool to get and return the version number""" + pipe = SCons.Action._subproc(env, [env['SWIG'], '-version'], + stdin = 'devnull', + stderr = 'devnull', + stdout = subprocess.PIPE) + if pipe.wait() != 0: return + + out = pipe.stdout.read() + match = re.search(r'SWIG Version\s+(\S+)$', out, re.MULTILINE) + if match: + return match.group(1) + def generate(env): """Add Builders and construction variables for swig to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) @@ -129,6 +159,7 @@ def generate(env): java_file.add_emitter('.i', _swigEmitter) env['SWIG'] = 'swig' + env['SWIGVERSION'] = _get_swig_version(env) env['SWIGFLAGS'] = SCons.Util.CLVar('') env['SWIGDIRECTORSUFFIX'] = '_wrap.h' env['SWIGCFILESUFFIX'] = '_wrap$CFILESUFFIX' diff --git a/3rdParty/SCons/scons-local/SCons/Tool/tar.py b/3rdParty/SCons/scons-local/SCons/Tool/tar.py index b573282..e3c0fe7 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/tar.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/tar.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tar.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/tar.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Action import SCons.Builder diff --git a/3rdParty/SCons/scons-local/SCons/Tool/tex.py b/3rdParty/SCons/scons-local/SCons/Tool/tex.py index cbbee2d..b422e06 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/tex.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/tex.py @@ -1,6 +1,7 @@ """SCons.Tool.tex Tool-specific initialization for TeX. +Generates .dvi files from .tex files There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -9,7 +10,7 @@ selection method. """ # -# 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 @@ -31,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tex.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/tex.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import re @@ -52,14 +53,14 @@ must_rerun_latex = True check_suffixes = ['.toc', '.lof', '.lot', '.out', '.nav', '.snm'] # these are files that require bibtex or makeindex to be run when they change -all_suffixes = check_suffixes + ['.bbl', '.idx', '.nlo', '.glo'] +all_suffixes = check_suffixes + ['.bbl', '.idx', '.nlo', '.glo', '.acn'] # # regular expressions used to search for Latex features # or outputs that require rerunning latex # -# search for all .aux files opened by latex (recorded in the .log file) -openout_aux_re = re.compile(r"\\openout.*`(.*\.aux)'") +# search for all .aux files opened by latex (recorded in the .fls file) +openout_aux_re = re.compile(r"INPUT *(.*\.aux)") #printindex_re = re.compile(r"^[^%]*\\printindex", re.MULTILINE) #printnomenclature_re = re.compile(r"^[^%]*\\printnomenclature", re.MULTILINE) @@ -87,16 +88,19 @@ listoftables_re = re.compile(r"^[^%\n]*\\listoftables", re.MULTILINE) hyperref_re = re.compile(r"^[^%\n]*\\usepackage.*\{hyperref\}", re.MULTILINE) makenomenclature_re = re.compile(r"^[^%\n]*\\makenomenclature", re.MULTILINE) makeglossary_re = re.compile(r"^[^%\n]*\\makeglossary", re.MULTILINE) +makeglossaries_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE) +makeacronyms_re = re.compile(r"^[^%\n]*\\makeglossaries", re.MULTILINE) beamer_re = re.compile(r"^[^%\n]*\\documentclass\{beamer\}", re.MULTILINE) # search to find all files included by Latex include_re = re.compile(r'^[^%\n]*\\(?:include|input){([^}]*)}', re.MULTILINE) +includeOnly_re = re.compile(r'^[^%\n]*\\(?:include){([^}]*)}', re.MULTILINE) # search to find all graphics files included by Latex includegraphics_re = re.compile(r'^[^%\n]*\\(?:includegraphics(?:\[[^\]]+\])?){([^}]*)}', re.MULTILINE) # search to find all files opened by Latex (recorded in .log file) -openout_re = re.compile(r"\\openout.*`(.*)'") +openout_re = re.compile(r"OUTPUT *(.*)") # list of graphics file extensions for TeX and LaTeX TexGraphics = SCons.Scanner.LaTeX.TexGraphics @@ -121,6 +125,9 @@ MakeNclAction = None # An action to run MakeIndex (for glossary) on a file. MakeGlossaryAction = None +# An action to run MakeIndex (for acronyms) on a file. +MakeAcronymsAction = None + # Used as a return value of modify_env_var if the variable is not set. _null = SCons.Scanner.LaTeX._null @@ -206,6 +213,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None run_makeindex = makeindex_re.search(src_content) and not os.path.exists(targetbase + '.idx') run_nomenclature = makenomenclature_re.search(src_content) and not os.path.exists(targetbase + '.nlo') run_glossary = makeglossary_re.search(src_content) and not os.path.exists(targetbase + '.glo') + run_glossaries = makeglossaries_re.search(src_content) and not os.path.exists(targetbase + '.glo') + run_acronyms = makeacronyms_re.search(src_content) and not os.path.exists(targetbase + '.acn') saved_hashes = {} suffix_nodes = {} @@ -256,13 +265,22 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None must_rerun_latex = False # Decide if various things need to be run, or run again. - # Read the log file to find all .aux files + # Read the log file to find warnings/errors logfilename = targetbase + '.log' logContent = '' - auxfiles = [] if os.path.exists(logfilename): logContent = open(logfilename, "rb").read() - auxfiles = openout_aux_re.findall(logContent) + + + # Read the fls file to find all .aux files + flsfilename = targetbase + '.fls' + flsContent = '' + auxfiles = [] + if os.path.exists(flsfilename): + flsContent = open(flsfilename, "rb").read() + auxfiles = openout_aux_re.findall(flsContent) + if Verbose: + print "auxfiles ",auxfiles # Now decide if bibtex will need to be run. # The information that bibtex reads from the .aux file is @@ -280,6 +298,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None bibfile = env.fs.File(targetbase) result = BibTeXAction(bibfile, bibfile, env) if result != 0: + print env['BIBTEX']," returned an error, check the blg file" return result must_rerun_latex = check_MD5(suffix_nodes['.bbl'],'.bbl') break @@ -292,6 +311,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None idxfile = suffix_nodes['.idx'] result = MakeIndexAction(idxfile, idxfile, env) if result != 0: + print env['MAKEINDEX']," returned an error, check the ilg file" return result # TO-DO: need to add a way for the user to extend this list for whatever @@ -309,16 +329,29 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None nclfile = suffix_nodes['.nlo'] result = MakeNclAction(nclfile, nclfile, env) if result != 0: - return result + print env['MAKENCL']," (nomenclature) returned an error, check the nlg file" + #return result # Now decide if latex will need to be run again due to glossary. - if check_MD5(suffix_nodes['.glo'],'.glo') or (count == 1 and run_glossary): + if check_MD5(suffix_nodes['.glo'],'.glo') or (count == 1 and run_glossaries) or (count == 1 and run_glossary): # We must run makeindex if Verbose: print "Need to run makeindex for glossary" glofile = suffix_nodes['.glo'] result = MakeGlossaryAction(glofile, glofile, env) if result != 0: + print env['MAKEGLOSSARY']," (glossary) returned an error, check the glg file" + #return result + + # Now decide if latex will need to be run again due to acronyms. + if check_MD5(suffix_nodes['.acn'],'.acn') or (count == 1 and run_acronyms): + # We must run makeindex + if Verbose: + print "Need to run makeindex for acronyms" + acrfile = suffix_nodes['.acn'] + result = MakeAcronymsAction(acrfile, acrfile, env) + if result != 0: + print env['MAKEACRONYMS']," (acronymns) returned an error, check the alg file" return result # Now decide if latex needs to be run yet again to resolve warnings. @@ -374,22 +407,92 @@ def LaTeXAuxAction(target = None, source= None, env=None): LaTeX_re = re.compile("\\\\document(style|class)") -def is_LaTeX(flist): - # Scan a file list to decide if it's TeX- or LaTeX-flavored. +def is_LaTeX(flist,env,abspath): + """Scan a file list to decide if it's TeX- or LaTeX-flavored.""" + + # We need to scan files that are included in case the + # \documentclass command is in them. + + # get path list from both env['TEXINPUTS'] and env['ENV']['TEXINPUTS'] + savedpath = modify_env_var(env, 'TEXINPUTS', abspath) + paths = env['ENV']['TEXINPUTS'] + if SCons.Util.is_List(paths): + pass + else: + # Split at os.pathsep to convert into absolute path + # TODO(1.5) + #paths = paths.split(os.pathsep) + paths = string.split(paths, os.pathsep) + + # now that we have the path list restore the env + if savedpath is _null: + try: + del env['ENV']['TEXINPUTS'] + except KeyError: + pass # was never set + else: + env['ENV']['TEXINPUTS'] = savedpath + if Verbose: + print "is_LaTeX search path ",paths + print "files to search :",flist + + # Now that we have the search path and file list, check each one for f in flist: + if Verbose: + print " checking for Latex source ",str(f) + content = f.get_text_contents() if LaTeX_re.search(content): + if Verbose: + print "file %s is a LaTeX file" % str(f) return 1 + if Verbose: + print "file %s is not a LaTeX file" % str(f) + + # now find included files + inc_files = [ ] + inc_files.extend( include_re.findall(content) ) + if Verbose: + print "files included by '%s': "%str(f),inc_files + # inc_files is list of file names as given. need to find them + # using TEXINPUTS paths. + + # search the included files + for src in inc_files: + srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False) + # make this a list since is_LaTeX takes a list. + fileList = [srcNode,] + if Verbose: + print "FindFile found ",srcNode + if srcNode is not None: + file_test = is_LaTeX(fileList, env, abspath) + + # return on first file that finds latex is needed. + if file_test: + return file_test + + if Verbose: + print " done scanning ",str(f) + return 0 def TeXLaTeXFunction(target = None, source= None, env=None): """A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.""" - if is_LaTeX(source): + + # find these paths for use in is_LaTeX to search for included files + basedir = os.path.split(str(source[0]))[0] + abspath = os.path.abspath(basedir) + + if is_LaTeX(source,env,abspath): result = LaTeXAuxAction(target,source,env) + if result != 0: + print env['LATEX']," returned an error, check the log file" else: result = TeXAction(target,source,env) + if result != 0: + print env['TEX']," returned an error, check the log file" return result def TeXLaTeXStrFunction(target = None, source= None, env=None): @@ -397,7 +500,12 @@ def TeXLaTeXStrFunction(target = None, source= None, env=None): decide the "flavor" of the source and then returns the appropriate command string.""" if env.GetOption("no_exec"): - if is_LaTeX(source): + + # find these paths for use in is_LaTeX to search for included files + basedir = os.path.split(str(source[0]))[0] + abspath = os.path.abspath(basedir) + + if is_LaTeX(source,env,abspath): result = env.subst('$LATEXCOM',0,target,source)+" ..." else: result = env.subst("$TEXCOM",0,target,source)+" ..." @@ -423,17 +531,23 @@ def tex_pdf_emitter(target, source, env): return (target, source) -def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir): - # for theFile (a Node) update any file_tests and search for graphics files - # then find all included files and call ScanFiles for each of them +def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files): + """ For theFile (a Node) update any file_tests and search for graphics files + then find all included files and call ScanFiles recursively for each of them""" + content = theFile.get_text_contents() if Verbose: print " scanning ",str(theFile) for i in range(len(file_tests_search)): - if file_tests[i][0] == None: + if file_tests[i][0] is None: file_tests[i][0] = file_tests_search[i].search(content) + incResult = includeOnly_re.search(content) + if incResult: + aux_files.append(os.path.join(targetdir, incResult.group(1))) + if Verbose: + print "\include file names : ", aux_files # recursively call this on each of the included files inc_files = [ ] inc_files.extend( include_re.findall(content) ) @@ -443,9 +557,9 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi # using TEXINPUTS paths. for src in inc_files: - srcNode = srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False) - if srcNode != None: - file_test = ScanFiles(srcNode, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir) + srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False) + if srcNode is not None: + file_tests = ScanFiles(srcNode, target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files) if Verbose: print " done scanning ",str(theFile) return file_tests @@ -456,32 +570,38 @@ def tex_emitter_core(target, source, env, graphics_extensions): are needed on subsequent runs of latex to finish tables of contents, bibliographies, indices, lists of figures, and hyperlink references. """ - targetbase = SCons.Util.splitext(str(target[0]))[0] basename = SCons.Util.splitext(str(source[0]))[0] basefile = os.path.split(str(basename))[1] + targetdir = os.path.split(str(target[0]))[0] + targetbase = os.path.join(targetdir, basefile) basedir = os.path.split(str(source[0]))[0] - targetdir = os.path.split(str(target[0]))[0] abspath = os.path.abspath(basedir) target[0].attributes.path = abspath - + # # file names we will make use of in searching the sources and log file # - emit_suffixes = ['.aux', '.log', '.ilg', '.blg', '.nls', '.nlg', '.gls', '.glg'] + all_suffixes + emit_suffixes = ['.aux', '.log', '.ilg', '.blg', '.nls', '.nlg', '.gls', '.glg', '.alg'] + all_suffixes auxfilename = targetbase + '.aux' logfilename = targetbase + '.log' + flsfilename = targetbase + '.fls' env.SideEffect(auxfilename,target[0]) env.SideEffect(logfilename,target[0]) + env.SideEffect(flsfilename,target[0]) + if Verbose: + print "side effect :",auxfilename,logfilename,flsfilename env.Clean(target[0],auxfilename) env.Clean(target[0],logfilename) + env.Clean(target[0],flsfilename) content = source[0].get_text_contents() idx_exists = os.path.exists(targetbase + '.idx') nlo_exists = os.path.exists(targetbase + '.nlo') glo_exists = os.path.exists(targetbase + '.glo') + acr_exists = os.path.exists(targetbase + '.acn') # set up list with the regular expressions # we use to find features used @@ -494,6 +614,8 @@ def tex_emitter_core(target, source, env, graphics_extensions): hyperref_re, makenomenclature_re, makeglossary_re, + makeglossaries_re, + makeacronyms_re, beamer_re ] # set up list with the file suffixes that need emitting # when a feature is found @@ -506,6 +628,8 @@ def tex_emitter_core(target, source, env, graphics_extensions): ['.out'], ['.nlo', '.nls', '.nlg'], ['.glo', '.gls', '.glg'], + ['.glo', '.gls', '.glg'], + ['.acn', '.acr', '.alg'], ['.nav', '.snm', '.out', '.toc'] ] # build the list of lists file_tests = [] @@ -537,19 +661,35 @@ def tex_emitter_core(target, source, env, graphics_extensions): if Verbose: print "search path ",paths - file_tests = ScanFiles(source[0], target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir) + aux_files = [] + file_tests = ScanFiles(source[0], target, paths, file_tests, file_tests_search, env, graphics_extensions, targetdir, aux_files) for (theSearch,suffix_list) in file_tests: if theSearch: for suffix in suffix_list: env.SideEffect(targetbase + suffix,target[0]) + if Verbose: + print "side effect :",targetbase + suffix env.Clean(target[0],targetbase + suffix) - # read log file to get all other files that latex creates and will read on the next pass - if os.path.exists(logfilename): - content = open(logfilename, "rb").read() + for aFile in aux_files: + aFile_base = SCons.Util.splitext(aFile)[0] + env.SideEffect(aFile_base + '.aux',target[0]) + if Verbose: + print "side effect :",aFile_base + '.aux' + env.Clean(target[0],aFile_base + '.aux') + # read fls file to get all other files that latex creates and will read on the next pass + # remove files from list that we explicitly dealt with above + if os.path.exists(flsfilename): + content = open(flsfilename, "rb").read() out_files = openout_re.findall(content) + myfiles = [auxfilename, logfilename, flsfilename, targetbase+'.dvi',targetbase+'.pdf'] + for filename in out_files[:]: + if filename in myfiles: + out_files.remove(filename) env.SideEffect(out_files,target[0]) + if Verbose: + print "side effect :",out_files env.Clean(target[0],out_files) return (target, source) @@ -560,6 +700,25 @@ TeXLaTeXAction = None def generate(env): """Add Builders and construction variables for TeX to an Environment.""" + global TeXLaTeXAction + if TeXLaTeXAction is None: + TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction, + strfunction=TeXLaTeXStrFunction) + + env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) + + generate_common(env) + + import dvi + dvi.generate(env) + + bld = env['BUILDERS']['DVI'] + bld.add_action('.tex', TeXLaTeXAction) + bld.add_emitter('.tex', tex_eps_emitter) + +def generate_common(env): + """Add internal Builders and construction variables for LaTeX to an Environment.""" + # A generic tex file Action, sufficient for all tex files. global TeXAction if TeXAction is None: @@ -591,28 +750,28 @@ def generate(env): if MakeGlossaryAction is None: MakeGlossaryAction = SCons.Action.Action("$MAKEGLOSSARYCOM", "$MAKEGLOSSARYCOMSTR") - global TeXLaTeXAction - if TeXLaTeXAction is None: - TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction, - strfunction=TeXLaTeXStrFunction) - - import dvi - dvi.generate(env) - - bld = env['BUILDERS']['DVI'] - bld.add_action('.tex', TeXLaTeXAction) - bld.add_emitter('.tex', tex_eps_emitter) + # Define an action to run MakeIndex on a file for acronyms. + global MakeAcronymsAction + if MakeAcronymsAction is None: + MakeAcronymsAction = SCons.Action.Action("$MAKEACRONYMSCOM", "$MAKEACRONYMSCOMSTR") env['TEX'] = 'tex' - env['TEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') + env['TEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') env['TEXCOM'] = 'cd ${TARGET.dir} && $TEX $TEXFLAGS ${SOURCE.file}' - # Duplicate from latex.py. If latex.py goes away, then this is still OK. + env['PDFTEX'] = 'pdftex' + env['PDFTEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') + env['PDFTEXCOM'] = 'cd ${TARGET.dir} && $PDFTEX $PDFTEXFLAGS ${SOURCE.file}' + env['LATEX'] = 'latex' - env['LATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') + env['LATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') env['LATEXCOM'] = 'cd ${TARGET.dir} && $LATEX $LATEXFLAGS ${SOURCE.file}' env['LATEXRETRIES'] = 3 + env['PDFLATEX'] = 'pdflatex' + env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder') + env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}' + env['BIBTEX'] = 'bibtex' env['BIBTEXFLAGS'] = SCons.Util.CLVar('') env['BIBTEXCOM'] = 'cd ${TARGET.dir} && $BIBTEX $BIBTEXFLAGS ${SOURCE.filebase}' @@ -626,16 +785,16 @@ def generate(env): env['MAKEGLOSSARYFLAGS'] = SCons.Util.CLVar('-s ${MAKEGLOSSARYSTYLE} -t ${SOURCE.filebase}.glg') env['MAKEGLOSSARYCOM'] = 'cd ${TARGET.dir} && $MAKEGLOSSARY ${SOURCE.filebase}.glo $MAKEGLOSSARYFLAGS -o ${SOURCE.filebase}.gls' + env['MAKEACRONYMS'] = 'makeindex' + env['MAKEACRONYMSSTYLE'] = '${SOURCE.filebase}.ist' + env['MAKEACRONYMSFLAGS'] = SCons.Util.CLVar('-s ${MAKEACRONYMSSTYLE} -t ${SOURCE.filebase}.alg') + env['MAKEACRONYMSCOM'] = 'cd ${TARGET.dir} && $MAKEACRONYMS ${SOURCE.filebase}.acn $MAKEACRONYMSFLAGS -o ${SOURCE.filebase}.acr' + env['MAKENCL'] = 'makeindex' - env['MAKENCLSTYLE'] = '$nomencl.ist' + env['MAKENCLSTYLE'] = 'nomencl.ist' env['MAKENCLFLAGS'] = '-s ${MAKENCLSTYLE} -t ${SOURCE.filebase}.nlg' env['MAKENCLCOM'] = 'cd ${TARGET.dir} && $MAKENCL ${SOURCE.filebase}.nlo $MAKENCLFLAGS -o ${SOURCE.filebase}.nls' - # Duplicate from pdflatex.py. If latex.py goes away, then this is still OK. - env['PDFLATEX'] = 'pdflatex' - env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode') - env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}' - def exists(env): return env.Detect('tex') diff --git a/3rdParty/SCons/scons-local/SCons/Tool/textfile.py b/3rdParty/SCons/scons-local/SCons/Tool/textfile.py new file mode 100644 index 0000000..8089246 --- /dev/null +++ b/3rdParty/SCons/scons-local/SCons/Tool/textfile.py @@ -0,0 +1,175 @@ +# -*- python -*- +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__doc__ = """ +Textfile/Substfile builder for SCons. + + Create file 'target' which typically is a textfile. The 'source' + may be any combination of strings, Nodes, or lists of same. A + 'linesep' will be put between any part written and defaults to + os.linesep. + + The only difference between the Textfile builder and the Substfile + builder is that strings are converted to Value() nodes for the + former and File() nodes for the latter. To insert files in the + former or strings in the latter, wrap them in a File() or Value(), + respectively. + + The values of SUBST_DICT first have any construction variables + expanded (its keys are not expanded). If a value of SUBST_DICT is + a python callable function, it is called and the result is expanded + as the value. Values are substituted in a "random" order; if any + substitution could be further expanded by another subsitition, it + is unpredictible whether the expansion will occur. +""" + +__revision__ = "src/engine/SCons/Tool/textfile.py 4761 2010/04/04 14:04:44 bdeegan" + +import SCons + +import os +import re + +from SCons.Node import Node +from SCons.Node.Python import Value +from SCons.Util import is_String, is_Sequence, is_Dict + +def _do_subst(node, subs): + """ + Fetch the node contents and replace all instances of the keys with + their values. For example, if subs is + {'%VERSION%': '1.2345', '%BASE%': 'MyProg', '%prefix%': '/bin'}, + then all instances of %VERSION% in the file will be replaced with + 1.2345 and so forth. + """ + contents = node.get_text_contents() + if not subs: return contents + for (k,v) in subs: + contents = re.sub(k, v, contents) + return contents + +def _action(target, source, env): + # prepare the line separator + linesep = env['LINESEPARATOR'] + if linesep is None: + linesep = os.linesep + elif is_String(linesep): + pass + elif isinstance(linesep, Value): + linesep = linesep.get_text_contents() + else: + raise SCons.Errors.UserError( + 'unexpected type/class for LINESEPARATOR: %s' + % repr(linesep), None) + + # create a dictionary to use for the substitutions + if not env.has_key('SUBST_DICT'): + subs = None # no substitutions + else: + d = env['SUBST_DICT'] + if is_Dict(d): + d = d.items() + elif is_Sequence(d): + pass + else: + raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence') + subs = [] + for (k,v) in d: + if callable(v): + v = v() + if is_String(v): + v = env.subst(v) + else: + v = str(v) + subs.append((k,v)) + + # write the file + try: + fd = open(target[0].get_path(), "wb") + except (OSError,IOError), e: + raise SCons.Errors.UserError("Can't write target file %s" % target[0]) + # separate lines by 'linesep' only if linesep is not empty + lsep = None + for s in source: + if lsep: fd.write(lsep) + fd.write(_do_subst(s, subs)) + lsep = linesep + fd.close() + +def _strfunc(target, source, env): + return "Creating '%s'" % target[0] + +def _convert_list_R(newlist, sources): + for elem in sources: + if is_Sequence(elem): + _convert_list_R(newlist, elem) + elif isinstance(elem, Node): + newlist.append(elem) + else: + newlist.append(Value(elem)) +def _convert_list(target, source, env): + if len(target) != 1: + raise SCons.Errors.UserError("Only one target file allowed") + newlist = [] + _convert_list_R(newlist, source) + return target, newlist + +_common_varlist = ['SUBST_DICT', 'LINESEPARATOR'] + +_text_varlist = _common_varlist + ['TEXTFILEPREFIX', 'TEXTFILESUFFIX'] +_text_builder = SCons.Builder.Builder( + action = SCons.Action.Action(_action, _strfunc, varlist = _text_varlist), + source_factory = Value, + emitter = _convert_list, + prefix = '$TEXTFILEPREFIX', + suffix = '$TEXTFILESUFFIX', + ) + +_subst_varlist = _common_varlist + ['SUBSTFILEPREFIX', 'TEXTFILESUFFIX'] +_subst_builder = SCons.Builder.Builder( + action = SCons.Action.Action(_action, _strfunc, varlist = _subst_varlist), + source_factory = SCons.Node.FS.File, + emitter = _convert_list, + prefix = '$SUBSTFILEPREFIX', + suffix = '$SUBSTFILESUFFIX', + src_suffix = ['.in'], + ) + +def generate(env): + env['LINESEPARATOR'] = os.linesep + env['BUILDERS']['Textfile'] = _text_builder + env['TEXTFILEPREFIX'] = '' + env['TEXTFILESUFFIX'] = '.txt' + env['BUILDERS']['Substfile'] = _subst_builder + env['SUBSTFILEPREFIX'] = '' + env['SUBSTFILESUFFIX'] = '' + +def exists(env): + return 1 + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/3rdParty/SCons/scons-local/SCons/Tool/tlib.py b/3rdParty/SCons/scons-local/SCons/Tool/tlib.py index 3fccc7a..a196447 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/tlib.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/tlib.py @@ -5,7 +5,7 @@ XXX """ # -# 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 @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tlib.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/tlib.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/3rdParty/SCons/scons-local/SCons/Tool/wix.py b/3rdParty/SCons/scons-local/SCons/Tool/wix.py index 7fbb38b..76b9e8a 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/wix.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/wix.py @@ -8,7 +8,7 @@ selection method. """ # -# 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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/wix.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/wix.py 4761 2010/04/04 14:04:44 bdeegan" import SCons.Builder import SCons.Action diff --git a/3rdParty/SCons/scons-local/SCons/Tool/yacc.py b/3rdParty/SCons/scons-local/SCons/Tool/yacc.py index a80ec1e..3fe58ed 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/yacc.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/yacc.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/yacc.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/yacc.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import string diff --git a/3rdParty/SCons/scons-local/SCons/Tool/zip.py b/3rdParty/SCons/scons-local/SCons/Tool/zip.py index f41bc85..0c24fc3 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/zip.py +++ b/3rdParty/SCons/scons-local/SCons/Tool/zip.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/zip.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/zip.py 4761 2010/04/04 14:04:44 bdeegan" import os.path diff --git a/3rdParty/SCons/scons-local/SCons/Util.py b/3rdParty/SCons/scons-local/SCons/Util.py index e7d841f..d91b362 100644 --- a/3rdParty/SCons/scons-local/SCons/Util.py +++ b/3rdParty/SCons/scons-local/SCons/Util.py @@ -5,7 +5,7 @@ Various utility functions go here. """ # -# 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 @@ -27,7 +27,7 @@ Various utility functions go here. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Util.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Util.py 4761 2010/04/04 14:04:44 bdeegan" import copy import os @@ -675,11 +675,11 @@ try: can_read_reg = 1 hkey_mod = _winreg - RegOpenKeyEx = _winreg.OpenKeyEx - RegEnumKey = _winreg.EnumKey - RegEnumValue = _winreg.EnumValue + RegOpenKeyEx = _winreg.OpenKeyEx + RegEnumKey = _winreg.EnumKey + RegEnumValue = _winreg.EnumValue RegQueryValueEx = _winreg.QueryValueEx - RegError = _winreg.error + RegError = _winreg.error except ImportError: try: @@ -688,11 +688,11 @@ except ImportError: can_read_reg = 1 hkey_mod = win32con - RegOpenKeyEx = win32api.RegOpenKeyEx - RegEnumKey = win32api.RegEnumKey - RegEnumValue = win32api.RegEnumValue + RegOpenKeyEx = win32api.RegOpenKeyEx + RegEnumKey = win32api.RegEnumKey + RegEnumValue = win32api.RegEnumValue RegQueryValueEx = win32api.RegQueryValueEx - RegError = win32api.error + RegError = win32api.error except ImportError: class _NoError(Exception): @@ -700,10 +700,10 @@ except ImportError: RegError = _NoError if can_read_reg: - HKEY_CLASSES_ROOT = hkey_mod.HKEY_CLASSES_ROOT + HKEY_CLASSES_ROOT = hkey_mod.HKEY_CLASSES_ROOT HKEY_LOCAL_MACHINE = hkey_mod.HKEY_LOCAL_MACHINE - HKEY_CURRENT_USER = hkey_mod.HKEY_CURRENT_USER - HKEY_USERS = hkey_mod.HKEY_USERS + HKEY_CURRENT_USER = hkey_mod.HKEY_CURRENT_USER + HKEY_USERS = hkey_mod.HKEY_USERS def RegGetValue(root, key): """This utility function returns a value in the registry @@ -754,6 +754,9 @@ else: def RegGetValue(root, key): raise WindowsError + def RegOpenKeyEx(root, key): + raise WindowsError + if sys.platform == 'win32': def WhereIs(file, path=None, pathext=None, reject=[]): @@ -1127,7 +1130,7 @@ class Selector(OrderedDict): # the dictionary before giving up. s_dict = {} for (k,v) in self.items(): - if not k is None: + if k is not None: s_k = env.subst(k) if s_dict.has_key(s_k): # We only raise an error when variables point @@ -1569,6 +1572,27 @@ def MD5collect(signatures): +# Wrap the intern() function so it doesn't throw exceptions if ineligible +# arguments are passed. The intern() function was moved into the sys module in +# Python 3. +try: + intern +except NameError: + from sys import intern + +def silent_intern(x): + """ + Perform intern() on the passed argument and return the result. + If the input is ineligible (e.g. a unicode string) the original argument is + returned and no exception is thrown. + """ + try: + return intern(x) + except TypeError: + return x + + + # From Dinu C. Gherman, # Python Cookbook, second edition, recipe 6.17, p. 277. # Also: diff --git a/3rdParty/SCons/scons-local/SCons/Variables/BoolVariable.py b/3rdParty/SCons/scons-local/SCons/Variables/BoolVariable.py index 4cf20d8..511a2b5 100644 --- a/3rdParty/SCons/scons-local/SCons/Variables/BoolVariable.py +++ b/3rdParty/SCons/scons-local/SCons/Variables/BoolVariable.py @@ -12,7 +12,7 @@ Usage example: """ # -# 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 @@ -34,7 +34,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/BoolVariable.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Variables/BoolVariable.py 4761 2010/04/04 14:04:44 bdeegan" __all__ = ['BoolVariable',] diff --git a/3rdParty/SCons/scons-local/SCons/Variables/EnumVariable.py b/3rdParty/SCons/scons-local/SCons/Variables/EnumVariable.py index bd72d05..edc6e7b 100644 --- a/3rdParty/SCons/scons-local/SCons/Variables/EnumVariable.py +++ b/3rdParty/SCons/scons-local/SCons/Variables/EnumVariable.py @@ -15,7 +15,7 @@ Usage example: """ # -# 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 @@ -37,7 +37,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/EnumVariable.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Variables/EnumVariable.py 4761 2010/04/04 14:04:44 bdeegan" __all__ = ['EnumVariable',] diff --git a/3rdParty/SCons/scons-local/SCons/Variables/ListVariable.py b/3rdParty/SCons/scons-local/SCons/Variables/ListVariable.py index 1051c51..91747e7 100644 --- a/3rdParty/SCons/scons-local/SCons/Variables/ListVariable.py +++ b/3rdParty/SCons/scons-local/SCons/Variables/ListVariable.py @@ -25,7 +25,7 @@ Usage example: """ # -# 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 @@ -47,7 +47,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/ListVariable.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Variables/ListVariable.py 4761 2010/04/04 14:04:44 bdeegan" # Know Bug: This should behave like a Set-Type, but does not really, # since elements can occur twice. diff --git a/3rdParty/SCons/scons-local/SCons/Variables/PackageVariable.py b/3rdParty/SCons/scons-local/SCons/Variables/PackageVariable.py index 66cea0d..91d5bdf 100644 --- a/3rdParty/SCons/scons-local/SCons/Variables/PackageVariable.py +++ b/3rdParty/SCons/scons-local/SCons/Variables/PackageVariable.py @@ -28,7 +28,7 @@ Usage example: """ # -# 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 @@ -50,7 +50,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PackageVariable.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Variables/PackageVariable.py 4761 2010/04/04 14:04:44 bdeegan" __all__ = ['PackageVariable',] diff --git a/3rdParty/SCons/scons-local/SCons/Variables/PathVariable.py b/3rdParty/SCons/scons-local/SCons/Variables/PathVariable.py index 6a44ef6..00f8c43 100644 --- a/3rdParty/SCons/scons-local/SCons/Variables/PathVariable.py +++ b/3rdParty/SCons/scons-local/SCons/Variables/PathVariable.py @@ -46,7 +46,7 @@ Usage example: """ # -# 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 @@ -68,7 +68,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PathVariable.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Variables/PathVariable.py 4761 2010/04/04 14:04:44 bdeegan" __all__ = ['PathVariable',] diff --git a/3rdParty/SCons/scons-local/SCons/Variables/__init__.py b/3rdParty/SCons/scons-local/SCons/Variables/__init__.py index 89ba227..469d3c0 100644 --- a/3rdParty/SCons/scons-local/SCons/Variables/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/Variables/__init__.py @@ -5,7 +5,7 @@ customizable variables to an SCons build. """ # -# 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 @@ -27,7 +27,7 @@ customizable variables to an SCons build. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Variables/__init__.py 4761 2010/04/04 14:04:44 bdeegan" import os.path import string @@ -95,6 +95,14 @@ class Variables: option.converter = converter self.options.append(option) + + # options might be added after the 'unknown' dict has been set up, + # so we remove the key and all its aliases from that dict + for alias in list(option.aliases) + [ option.key ]: + # TODO(1.5) + #if alias in self.unknown: + if alias in self.unknown.keys(): + del self.unknown[alias] def keys(self): """ @@ -166,7 +174,7 @@ class Variables: sys.path.insert(0, dir) try: values['__name__'] = filename - execfile(filename, {}, values) + exec open(filename, 'rU').read() in {}, values finally: if dir: del sys.path[0] @@ -179,7 +187,7 @@ class Variables: for arg, value in args.items(): added = False for option in self.options: - if arg in option.aliases + [ option.key ]: + if arg in list(option.aliases) + [ option.key ]: values[option.key] = value added = True if not added: diff --git a/3rdParty/SCons/scons-local/SCons/Warnings.py b/3rdParty/SCons/scons-local/SCons/Warnings.py index ada4304..7342e35 100644 --- a/3rdParty/SCons/scons-local/SCons/Warnings.py +++ b/3rdParty/SCons/scons-local/SCons/Warnings.py @@ -1,5 +1,5 @@ # -# 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 @@ -27,7 +27,7 @@ This file implements the warnings framework for SCons. """ -__revision__ = "src/engine/SCons/Warnings.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Warnings.py 4761 2010/04/04 14:04:44 bdeegan" import string import sys @@ -115,6 +115,17 @@ class StackSizeWarning(Warning): class TaskmasterNeedsExecuteWarning(FutureDeprecatedWarning): pass +class VisualCMissingWarning(Warning): + pass + +# Used when MSVC_VERSION and MSVS_VERSION do not point to the +# same version (MSVS_VERSION is deprecated) +class VisualVersionMismatch(Warning): + pass + +class VisualStudioMissingWarning(Warning): + pass + class FortranCxxMixWarning(LinkWarning): pass diff --git a/3rdParty/SCons/scons-local/SCons/__init__.py b/3rdParty/SCons/scons-local/SCons/__init__.py index 0893900..8ba78cf 100644 --- a/3rdParty/SCons/scons-local/SCons/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/__init__.py @@ -5,7 +5,7 @@ The main package for the SCons software construction utility. """ # -# 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 @@ -27,17 +27,17 @@ The main package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/__init__.py 4761 2010/04/04 14:04:44 bdeegan" -__version__ = "1.2.0.d20090223" +__version__ = "1.3.0.d20100404" -__build__ = "r4043" +__build__ = "r4761" -__buildsys__ = "scons-dev" +__buildsys__ = "cooldog" -__date__ = "2009/02/23 09:06:45" +__date__ = "2010/04/04 14:04:44" -__developer__ = "scons" +__developer__ = "bdeegan" # make sure compatibility is always in place import SCons.compat diff --git a/3rdParty/SCons/scons-local/SCons/compat/__init__.py b/3rdParty/SCons/scons-local/SCons/compat/__init__.py index f48ae4a..dfedf1d 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/__init__.py +++ b/3rdParty/SCons/scons-local/SCons/compat/__init__.py @@ -1,5 +1,5 @@ # -# 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 @@ -60,7 +60,7 @@ function defined below loads the module as the "real" name (without the rest of our code will find our pre-loaded compatibility module. """ -__revision__ = "src/engine/SCons/compat/__init__.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/compat/__init__.py 4761 2010/04/04 14:04:44 bdeegan" def import_as(module, name): """ @@ -175,6 +175,14 @@ except AttributeError: return os.path.exists(path) or os.path.islink(path) os.path.lexists = lexists + +try: + import platform +except ImportError: + # Pre-2.3 Python has no platform module. + import_as('_scons_platform', 'platform') + + import shlex try: shlex.split @@ -250,6 +258,43 @@ except ImportError: # Pre-1.6 Python has no UserString module. import_as('_scons_UserString', 'UserString') +import tempfile +try: + tempfile.mkstemp +except AttributeError: + # Pre-2.3 Python has no tempfile.mkstemp function, so try to simulate it. + # adapted from the mkstemp implementation in python 3. + import os + import errno + def mkstemp(*args, **kw): + text = False + # TODO (1.5) + #if 'text' in kw : + if 'text' in kw.keys() : + text = kw['text'] + del kw['text'] + elif len( args ) == 4 : + text = args[3] + args = args[:3] + flags = os.O_RDWR | os.O_CREAT | os.O_EXCL + if not text and hasattr( os, 'O_BINARY' ) : + flags = flags | os.O_BINARY + while True: + try : + name = apply(tempfile.mktemp, args, kw) + fd = os.open( name, flags, 0600 ) + return (fd, os.path.abspath(name)) + except OSError, e: + if e.errno == errno.EEXIST: + continue + raise + + tempfile.mkstemp = mkstemp + del mkstemp + + + + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/3rdParty/SCons/scons-local/SCons/compat/_scons_UserString.py b/3rdParty/SCons/scons-local/SCons/compat/_scons_UserString.py index 4b736fd..0310bdd 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/_scons_UserString.py +++ b/3rdParty/SCons/scons-local/SCons/compat/_scons_UserString.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/compat/_scons_UserString.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/compat/_scons_UserString.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ A user-defined wrapper around string objects diff --git a/3rdParty/SCons/scons-local/SCons/compat/_scons_hashlib.py b/3rdParty/SCons/scons-local/SCons/compat/_scons_hashlib.py index 2fc1ce6..0778bdc 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/_scons_hashlib.py +++ b/3rdParty/SCons/scons-local/SCons/compat/_scons_hashlib.py @@ -1,5 +1,5 @@ # -# 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 @@ -31,7 +31,7 @@ purposes, anyway). In fact, this module will raise an ImportError if the underlying md5 module isn't available. """ -__revision__ = "src/engine/SCons/compat/_scons_hashlib.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/compat/_scons_hashlib.py 4761 2010/04/04 14:04:44 bdeegan" import md5 import string diff --git a/3rdParty/SCons/scons-local/SCons/compat/_scons_itertools.py b/3rdParty/SCons/scons-local/SCons/compat/_scons_itertools.py index d2289d3..ac16f3d 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/_scons_itertools.py +++ b/3rdParty/SCons/scons-local/SCons/compat/_scons_itertools.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/compat/_scons_itertools.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/compat/_scons_itertools.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ Implementations of itertools functions for Python versions that don't diff --git a/3rdParty/SCons/scons-local/SCons/compat/_scons_optparse.py b/3rdParty/SCons/scons-local/SCons/compat/_scons_optparse.py index 386dfea..219adba 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/_scons_optparse.py +++ b/3rdParty/SCons/scons-local/SCons/compat/_scons_optparse.py @@ -920,7 +920,7 @@ class Values: def read_file(self, filename, mode="careful"): vars = {} - execfile(filename, vars) + exec open(filename, 'rU').read() in vars self._update(vars, mode) def ensure_value(self, attr, value): diff --git a/3rdParty/SCons/scons-local/SCons/compat/_scons_subprocess.py b/3rdParty/SCons/scons-local/SCons/compat/_scons_subprocess.py index 4968825..ccd403a 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/_scons_subprocess.py +++ b/3rdParty/SCons/scons-local/SCons/compat/_scons_subprocess.py @@ -381,7 +381,21 @@ if mswindows: # can't import it. pass import msvcrt - if 0: # <-- change this to use pywin32 instead of the _subprocess driver + try: + # Try to get _subprocess + from _subprocess import * + class STARTUPINFO: + dwFlags = 0 + hStdInput = None + hStdOutput = None + hStdError = None + wShowWindow = 0 + class pywintypes: + error = IOError + except ImportError: + # If not there, then drop back to requiring pywin32 + # TODO: Should this be wrapped in try as well? To notify user to install + # pywin32 ? With URL to it? import pywintypes from win32api import GetStdHandle, STD_INPUT_HANDLE, \ STD_OUTPUT_HANDLE, STD_ERROR_HANDLE @@ -393,20 +407,8 @@ if mswindows: GetExitCodeProcess, STARTF_USESTDHANDLES, \ STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0 - else: - # SCons: don't die on Python versions that don't have _subprocess. - try: - from _subprocess import * - except ImportError: - pass - class STARTUPINFO: - dwFlags = 0 - hStdInput = None - hStdOutput = None - hStdError = None - wShowWindow = 0 - class pywintypes: - error = IOError + + else: import select import errno diff --git a/3rdParty/SCons/scons-local/SCons/compat/builtins.py b/3rdParty/SCons/scons-local/SCons/compat/builtins.py index f7267ca..e56e1ed 100644 --- a/3rdParty/SCons/scons-local/SCons/compat/builtins.py +++ b/3rdParty/SCons/scons-local/SCons/compat/builtins.py @@ -1,5 +1,5 @@ # -# 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 @@ -55,7 +55,7 @@ the FUNCTIONS or DATA output, that means those names are already built in to this version of Python and we don't need to add them from this module. """ -__revision__ = "src/engine/SCons/compat/builtins.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/compat/builtins.py 4761 2010/04/04 14:04:44 bdeegan" import __builtin__ diff --git a/3rdParty/SCons/scons-local/SCons/cpp.py b/3rdParty/SCons/scons-local/SCons/cpp.py index 006a9b4..30227d2 100644 --- a/3rdParty/SCons/scons-local/SCons/cpp.py +++ b/3rdParty/SCons/scons-local/SCons/cpp.py @@ -1,5 +1,5 @@ # -# 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 @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/cpp.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/cpp.py 4761 2010/04/04 14:04:44 bdeegan" __doc__ = """ SCons C Pre-Processor module @@ -66,10 +66,10 @@ cpp_lines_dict = { # 2) The optional parentheses and arguments (if it's a function-like # macro, '' if it's not). # 3) The expansion value. - ('define',) : '\s+([_A-Za-z][_A-Za-z0-9_]+)(\([^)]*\))?\s*(.*)', + ('define',) : '\s+([_A-Za-z][_A-Za-z0-9_]*)(\([^)]*\))?\s*(.*)', # Fetch the #undefed keyword from a #undef line. - ('undef',) : '\s+([_A-Za-z][A-Za-z0-9_]+)', + ('undef',) : '\s+([_A-Za-z][A-Za-z0-9_]*)', } # Create a table that maps each individual C preprocessor directive to diff --git a/3rdParty/SCons/scons-local/SCons/dblite.py b/3rdParty/SCons/scons-local/SCons/dblite.py index 6d4cfd5..bcb2aa0 100644 --- a/3rdParty/SCons/scons-local/SCons/dblite.py +++ b/3rdParty/SCons/scons-local/SCons/dblite.py @@ -45,6 +45,10 @@ class dblite: _open = __builtin__.open _cPickle_dump = cPickle.dump _os_chmod = os.chmod + try: + _os_chown = os.chown + except AttributeError: + _os_chown = None _os_rename = os.rename _os_unlink = os.unlink _shutil_copyfile = shutil.copyfile @@ -65,6 +69,20 @@ class dblite: self._mode = mode self._dict = {} self._needs_sync = 00000 + if self._os_chown is not None and (os.geteuid()==0 or os.getuid()==0): + # running as root; chown back to current owner/group when done + try: + statinfo = os.stat(self._file_name) + self._chown_to = statinfo.st_uid + self._chgrp_to = statinfo.st_gid + except OSError, e: + # db file doesn't exist yet. + # Check os.environ for SUDO_UID, use if set + self._chown_to = int(os.environ.get('SUDO_UID', -1)) + self._chgrp_to = int(os.environ.get('SUDO_GID', -1)) + else: + self._chown_to = -1 # don't chown + self._chgrp_to = -1 # don't chgrp if (self._flag == "n"): self._open(self._file_name, "wb", self._mode) else: @@ -103,6 +121,11 @@ class dblite: except OSError: pass self._os_unlink(self._file_name) self._os_rename(self._tmp_name, self._file_name) + if self._os_chown is not None and self._chown_to > 0: # don't chown to root or -1 + try: + self._os_chown(self._file_name, self._chown_to, self._chgrp_to) + except OSError: + pass self._needs_sync = 00000 if (keep_all_files): self._shutil_copyfile( diff --git a/3rdParty/SCons/scons-local/SCons/exitfuncs.py b/3rdParty/SCons/scons-local/SCons/exitfuncs.py index ef244b5..89a5d2c 100644 --- a/3rdParty/SCons/scons-local/SCons/exitfuncs.py +++ b/3rdParty/SCons/scons-local/SCons/exitfuncs.py @@ -5,7 +5,7 @@ Register functions which are executed when SCons exits for any reason. """ # -# 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 @@ -27,7 +27,7 @@ Register functions which are executed when SCons exits for any reason. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/exitfuncs.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/exitfuncs.py 4761 2010/04/04 14:04:44 bdeegan" diff --git a/3rdParty/SCons/scons-time.py b/3rdParty/SCons/scons-time.py index cbe8c42..798b675 100755 --- a/3rdParty/SCons/scons-time.py +++ b/3rdParty/SCons/scons-time.py @@ -9,7 +9,7 @@ # # -# 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 @@ -33,7 +33,7 @@ from __future__ import nested_scopes -__revision__ = "src/script/scons-time.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/script/scons-time.py 4761 2010/04/04 14:04:44 bdeegan" import getopt import glob @@ -79,6 +79,17 @@ def make_temp_file(**kw): tempfile.template = save_template return result +def HACK_for_exec(cmd, *args): + ''' + For some reason, Python won't allow an exec() within a function + that also declares an internal function (including lambda functions). + This function is a hack that calls exec() in a function with no + internal functions. + ''' + if not args: exec(cmd) + elif len(args) == 1: exec cmd in args[0] + else: exec cmd in args[0], args[1] + class Plotter: def increment_size(self, largest): """ @@ -704,7 +715,7 @@ class SConsTimer: lines = open(file).readlines() line = [ l for l in lines if l.endswith(object_string) ][0] result = [ int(field) for field in line.split()[:4] ] - if not index is None: + if index is not None: result = result[index] return result @@ -830,7 +841,7 @@ class SConsTimer: self.title = a if self.config_file: - execfile(self.config_file, self.__dict__) + exec open(self.config_file, 'rU').read() in self.__dict__ if self.chdir: os.chdir(self.chdir) @@ -859,19 +870,18 @@ class SConsTimer: if format == 'ascii': - def print_function_timing(file, func): + for file in args: try: - f, line, func, time = self.get_function_profile(file, func) + f, line, func, time = \ + self.get_function_profile(file, function_name) except ValueError, e: - sys.stderr.write("%s: func: %s: %s\n" % (self.name, file, e)) + sys.stderr.write("%s: func: %s: %s\n" % + (self.name, file, e)) else: if f.startswith(cwd_): f = f[len(cwd_):] print "%.3f %s:%d(%s)" % (time, f, line, func) - for file in args: - print_function_timing(file, function_name) - elif format == 'gnuplot': results = self.collect_results(args, self.get_function_time, @@ -950,7 +960,7 @@ class SConsTimer: self.title = a if self.config_file: - execfile(self.config_file, self.__dict__) + HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) @@ -1070,7 +1080,7 @@ class SConsTimer: object_name = args.pop(0) if self.config_file: - execfile(self.config_file, self.__dict__) + HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) @@ -1208,7 +1218,7 @@ class SConsTimer: sys.exit(1) if self.config_file: - execfile(self.config_file, self.__dict__) + exec open(self.config_file, 'rU').read() in self.__dict__ if args: self.archive_list = args @@ -1448,7 +1458,7 @@ class SConsTimer: which = a if self.config_file: - execfile(self.config_file, self.__dict__) + HACK_for_exec(open(self.config_file, 'rU').read(), self.__dict__) if self.chdir: os.chdir(self.chdir) diff --git a/3rdParty/SCons/scons.py b/3rdParty/SCons/scons.py index 73aa0b5..d89b7e0 100755 --- a/3rdParty/SCons/scons.py +++ b/3rdParty/SCons/scons.py @@ -2,7 +2,7 @@ # # SCons - a Software Constructor # -# 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 @@ -24,17 +24,17 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/script/scons.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/script/scons.py 4761 2010/04/04 14:04:44 bdeegan" -__version__ = "1.2.0.d20090223" +__version__ = "1.3.0.d20100404" -__build__ = "r4043" +__build__ = "r4761" -__buildsys__ = "scons-dev" +__buildsys__ = "cooldog" -__date__ = "2009/02/23 09:06:45" +__date__ = "2010/04/04 14:04:44" -__developer__ = "scons" +__developer__ = "bdeegan" import os import os.path @@ -56,6 +56,19 @@ import sys # followed by generic) so we pick up the right version of the build # engine modules if they're in either directory. + +# Check to see if the python version is > 3.0 which is currently unsupported +# If so exit with error message +try: + if sys.version_info >= (3,0,0): + msg = "scons: *** SCons version %s does not run under Python version %s.\n" + sys.stderr.write(msg % (__version__, sys.version.split()[0])) + sys.exit(1) +except AttributeError: + # Pre-1.6 Python has no sys.version_info + # No need to check version as we then know the version is < 3.0.0 and supported + pass + script_dir = sys.path[0] if script_dir in sys.path: @@ -147,6 +160,19 @@ else: # Check /usr/libfoo/scons*. prefs.append(libpath) + try: + import pkg_resources + except ImportError: + pass + else: + # when running from an egg add the egg's directory + try: + d = pkg_resources.get_distribution('scons') + except pkg_resources.DistributionNotFound: + pass + else: + prefs.append(d.location) + # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. libs.extend(map(lambda x: os.path.join(x, scons_version), prefs)) diff --git a/3rdParty/SCons/sconsign.py b/3rdParty/SCons/sconsign.py index 9a97b75..c0d33d6 100755 --- a/3rdParty/SCons/sconsign.py +++ b/3rdParty/SCons/sconsign.py @@ -2,7 +2,7 @@ # # SCons - a Software Constructor # -# 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 @@ -24,17 +24,17 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/script/sconsign.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/script/sconsign.py 4761 2010/04/04 14:04:44 bdeegan" -__version__ = "1.2.0.d20090223" +__version__ = "1.3.0.d20100404" -__build__ = "r4043" +__build__ = "r4761" -__buildsys__ = "scons-dev" +__buildsys__ = "cooldog" -__date__ = "2009/02/23 09:06:45" +__date__ = "2010/04/04 14:04:44" -__developer__ = "scons" +__developer__ = "bdeegan" import os import os.path @@ -148,6 +148,19 @@ else: # Check /usr/libfoo/scons*. prefs.append(libpath) + try: + import pkg_resources + except ImportError: + pass + else: + # when running from an egg add the egg's directory + try: + d = pkg_resources.get_distribution('scons') + except pkg_resources.DistributionNotFound: + pass + else: + prefs.append(d.location) + # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. libs.extend(map(lambda x: os.path.join(x, scons_version), prefs)) diff --git a/BuildTools/Copyrighter.py b/BuildTools/Copyrighter.py index b6f7fa2..7f4d9f9 100755 --- a/BuildTools/Copyrighter.py +++ b/BuildTools/Copyrighter.py @@ -134,7 +134,7 @@ if sys.argv[1] == "check-copyright" : elif sys.argv[1] == "check-all-copyrights" : ok = True for (path, dirs, files) in os.walk(".") : - if "3rdParty" in path or ".sconf" in path : + if "3rdParty" in path or ".sconf" in path or "Swift.app" in path : continue for filename in [os.path.join(path, file) for file in files if (file.endswith(".cpp") or file.endswith(".h")) and not "ui_" in file and not "moc_" in file and not "qrc_" in file and not "BuildVersion.h" in file] : ok &= check_copyright(filename) @@ -148,7 +148,7 @@ elif sys.argv[1] == "set-all-copyrights" : (username, email) = get_userinfo() copyright = get_copyright(username, email) for (path, dirs, files) in os.walk(".") : - if "3rdParty" in path or ".sconf" in path : + if "3rdParty" in path or ".sconf" in path or "Swift.app" in path : continue for filename in [os.path.join(path, file) for file in files if (file.endswith(".cpp") or file.endswith(".h")) and not "ui_" in file and not "moc_" in file and not "qrc_" in file and not "BuildVersion.h" in file] : set_copyright(filename, copyright) |