summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-06-17 23:00:21 (GMT)
committerSteven Knight <knight@baldmt.com>2003-06-17 23:00:21 (GMT)
commitdee58bfc0ca86f020b3d5c65b66d3d939828e244 (patch)
tree9283acd41664ab1477b9bc2050da6ff424fbe16b
parent9789be004e64007438c3dae0669ef8f08f2e5adb (diff)
downloadSCons-dee58bfc0ca86f020b3d5c65b66d3d939828e244.zip
SCons-dee58bfc0ca86f020b3d5c65b66d3d939828e244.tar.gz
SCons-dee58bfc0ca86f020b3d5c65b66d3d939828e244.tar.bz2
Restore the PharLap .lnk patch that got wiped out.
-rw-r--r--src/engine/SCons/Platform/win32.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py
index 6874d01..5303f32 100644
--- a/src/engine/SCons/Platform/win32.py
+++ b/src/engine/SCons/Platform/win32.py
@@ -160,9 +160,8 @@ 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 an escape function, we will just quote
-# the arg.
+# Windows does not allow special characters in file names anyway, so
+# no need for a complex escape function, we will just quote the arg.
escape = lambda x: '"' + x + '"'
# Get the windows system directory name
@@ -233,10 +232,30 @@ 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'] = {}