summaryrefslogtreecommitdiff
path: root/engine/SCons/Platform
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Platform')
-rw-r--r--engine/SCons/Platform/__init__.py36
-rw-r--r--engine/SCons/Platform/aix.py4
-rw-r--r--engine/SCons/Platform/cygwin.py4
-rw-r--r--engine/SCons/Platform/darwin.py4
-rw-r--r--engine/SCons/Platform/hpux.py4
-rw-r--r--engine/SCons/Platform/irix.py4
-rw-r--r--engine/SCons/Platform/os2.py4
-rw-r--r--engine/SCons/Platform/posix.py4
-rw-r--r--engine/SCons/Platform/sunos.py4
-rw-r--r--engine/SCons/Platform/win32.py4
10 files changed, 47 insertions, 25 deletions
diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py
index 679191e..7c1b9d5 100644
--- a/engine/SCons/Platform/__init__.py
+++ b/engine/SCons/Platform/__init__.py
@@ -20,7 +20,7 @@ their own platform definition.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 @@ their own platform definition.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Platform/__init__.py 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/__init__.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import SCons.compat
@@ -139,7 +139,7 @@ class TempFileMunge(object):
Example usage:
env["TEMPFILE"] = TempFileMunge
- env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES')}"
+ env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
By default, the name of the temporary file used begins with a
prefix of '@'. This may be configred for other tool chains by
@@ -148,8 +148,9 @@ class TempFileMunge(object):
env["TEMPFILEPREFIX"] = '-@' # diab compiler
env["TEMPFILEPREFIX"] = '-via' # arm tool chain
"""
- def __init__(self, cmd):
+ def __init__(self, cmd, cmdstr = None):
self.cmd = cmd
+ self.cmdstr = cmdstr
def __call__(self, target, source, env, for_signature):
if for_signature:
@@ -177,6 +178,14 @@ class TempFileMunge(object):
if length <= maxline:
return self.cmd
+ # Check if we already created the temporary file for this target
+ # It should have been previously done by Action.strfunction() call
+ node = target[0] if SCons.Util.is_List(target) else target
+ cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \
+ if node is not None else None
+ if cmdlist is not None :
+ return cmdlist
+
# We do a normpath because mktemp() has what appears to be
# a bug in Windows that will use a forward slash as a path
# delimiter. Windows's link mistakes that for a command line
@@ -224,9 +233,22 @@ class TempFileMunge(object):
# purity get in the way of just being helpful, so we'll
# reach into SCons.Action directly.
if SCons.Action.print_actions:
- print("Using tempfile "+native_tmp+" for command line:\n"+
- str(cmd[0]) + " " + " ".join(args))
- return [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
+ cmdstr = env.subst(self.cmdstr, SCons.Subst.SUBST_RAW, target,
+ source) if self.cmdstr is not None else ''
+ # Print our message only if XXXCOMSTR returns an empty string
+ if len(cmdstr) == 0 :
+ print("Using tempfile "+native_tmp+" for command line:\n"+
+ str(cmd[0]) + " " + " ".join(args))
+
+ # Store the temporary file command list into the target Node.attributes
+ # to avoid creating two temporary files one for print and one for execute.
+ cmdlist = [ cmd[0], prefix + native_tmp + '\n' + rm, native_tmp ]
+ if node is not None:
+ try :
+ setattr(node.attributes, 'tempfile_cmdlist', cmdlist)
+ except AttributeError:
+ pass
+ return cmdlist
def Platform(name = platform_default()):
"""Select a canned Platform specification.
diff --git a/engine/SCons/Platform/aix.py b/engine/SCons/Platform/aix.py
index f4f1d6e..5527b27 100644
--- a/engine/SCons/Platform/aix.py
+++ b/engine/SCons/Platform/aix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/aix.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import os
import subprocess
diff --git a/engine/SCons/Platform/cygwin.py b/engine/SCons/Platform/cygwin.py
index d88eba6..e867085 100644
--- a/engine/SCons/Platform/cygwin.py
+++ b/engine/SCons/Platform/cygwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/cygwin.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import posix
from SCons.Platform import TempFileMunge
diff --git a/engine/SCons/Platform/darwin.py b/engine/SCons/Platform/darwin.py
index 7a98c3c..f89db72 100644
--- a/engine/SCons/Platform/darwin.py
+++ b/engine/SCons/Platform/darwin.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/darwin.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import posix
import os
diff --git a/engine/SCons/Platform/hpux.py b/engine/SCons/Platform/hpux.py
index 16def79..8dcdea3 100644
--- a/engine/SCons/Platform/hpux.py
+++ b/engine/SCons/Platform/hpux.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/hpux.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import posix
diff --git a/engine/SCons/Platform/irix.py b/engine/SCons/Platform/irix.py
index 28af571..0819cb1 100644
--- a/engine/SCons/Platform/irix.py
+++ b/engine/SCons/Platform/irix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/irix.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import posix
diff --git a/engine/SCons/Platform/os2.py b/engine/SCons/Platform/os2.py
index a65511a..d394b72 100644
--- a/engine/SCons/Platform/os2.py
+++ b/engine/SCons/Platform/os2.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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/os2.py 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/os2.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import win32
def generate(env):
diff --git a/engine/SCons/Platform/posix.py b/engine/SCons/Platform/posix.py
index 86c08b9..3bca213 100644
--- a/engine/SCons/Platform/posix.py
+++ b/engine/SCons/Platform/posix.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/posix.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import errno
import os
diff --git a/engine/SCons/Platform/sunos.py b/engine/SCons/Platform/sunos.py
index 466e0d1..edbec63 100644
--- a/engine/SCons/Platform/sunos.py
+++ b/engine/SCons/Platform/sunos.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/sunos.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import posix
diff --git a/engine/SCons/Platform/win32.py b/engine/SCons/Platform/win32.py
index 2416802..cbe3040 100644
--- a/engine/SCons/Platform/win32.py
+++ b/engine/SCons/Platform/win32.py
@@ -8,7 +8,7 @@ selection method.
"""
#
-# Copyright (c) 2001 - 2014 The SCons Foundation
+# Copyright (c) 2001 - 2015 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 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Platform/win32.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import os
import os.path