diff options
author | Steven Knight <knight@baldmt.com> | 2003-06-17 20:54:43 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-06-17 20:54:43 (GMT) |
commit | 9789be004e64007438c3dae0669ef8f08f2e5adb (patch) | |
tree | d9fb46f32d60eeb787fba06be3aa958ef4621b0d /src/engine/SCons/Platform | |
parent | ba5e0ae491d9078daa733ab0de6732db11a5c852 (diff) | |
download | SCons-9789be004e64007438c3dae0669ef8f08f2e5adb.zip SCons-9789be004e64007438c3dae0669ef8f08f2e5adb.tar.gz SCons-9789be004e64007438c3dae0669ef8f08f2e5adb.tar.bz2 |
When linking long command lines, use a '.lnk' suffix on the temporary file name. (Charles Crain)
Diffstat (limited to 'src/engine/SCons/Platform')
-rw-r--r-- | src/engine/SCons/Platform/win32.py | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py index 6aafa95..6874d01 100644 --- a/src/engine/SCons/Platform/win32.py +++ b/src/engine/SCons/Platform/win32.py @@ -68,7 +68,11 @@ class TempFileMunge: # a bug in Win32 that will use a forward slash as a path # delimiter. Win32's link mistakes that for a command line # switch and barfs. - tmp = os.path.normpath(tempfile.mktemp()) + # + # 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) # The sh shell will try to escape the backslashes in the @@ -156,8 +160,9 @@ def spawn(sh, escape, cmd, args, env): sys.stderr.write("scons: %s: %s\n" % (cmd, e[1])) return ret -# Windows does not allow special characters in file names anyway, so -# no need for a complex escape function, we will just quote the arg. +# Windows does not allow special characters in file names +# anyway, so no need for an escape function, we will just quote +# the arg. escape = lambda x: '"' + x + '"' # Get the windows system directory name @@ -228,30 +233,10 @@ def generate(env): cmd_interp = os.path.join(val, 'command.com') except: pass - - # For the special case of not having access to the registry, we - # use a temporary path and pathext to attempt to find the command - # interpreter. If we fail, we try to find the interpreter through - # the env's PATH. The problem with that is that it might not - # contain an ENV and a PATH. - if not cmd_interp: - systemroot = r'C:\Windows' - if os.environ.has_key('SYSTEMROOT'): - systemroot = os.environ['SYSTEMROOT'] - tmp_path = systemroot + os.pathsep + \ - os.path.join(systemroot,'System32') - tmp_pathext = '.com;.exe;.bat;.cmd' - if os.environ.has_key('PATHEXT'): - tmp_pathext = os.environ['PATHEXT'] - cmd_interp = SCons.Util.WhereIs('cmd', tmp_path, tmp_pathext) - if not cmd_interp: - cmd_interp = SCons.Util.WhereIs('command', tmp_path, tmp_pathext) - if not cmd_interp: cmd_interp = env.Detect('cmd') if not cmd_interp: cmd_interp = env.Detect('command') - if not env.has_key('ENV'): env['ENV'] = {} |