diff options
| author | Steven Knight <knight@baldmt.com> | 2002-09-25 16:56:41 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2002-09-25 16:56:41 (GMT) |
| commit | d23e503a2499c58c9826b3b341ff33f79bc20b10 (patch) | |
| tree | f9827472eb38e3d2df1af48fae50cfa3043ef4e2 /src | |
| parent | 72042342ebcbc24c523fb4e1413821c73e585a2a (diff) | |
| download | SCons-d23e503a2499c58c9826b3b341ff33f79bc20b10.zip SCons-d23e503a2499c58c9826b3b341ff33f79bc20b10.tar.gz SCons-d23e503a2499c58c9826b3b341ff33f79bc20b10.tar.bz2 | |
Windows portability
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 55 | ||||
| -rw-r--r-- | src/engine/SCons/Script/__init__.py | 2 | ||||
| -rw-r--r-- | src/engine/SCons/Tool/__init__.py | 2 |
3 files changed, 43 insertions, 16 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 33c14e5..1b2cd3b 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -586,27 +586,52 @@ class EnvironmentTestCase(unittest.TestCase): """Test Detect()ing tools""" test = TestCmd.TestCmd(workdir = '') test.subdir('sub1', 'sub2') - test.write(['sub1', 'xxx.exe'], "sub1/xxx.exe\n") - test.write(['sub2', 'xxx.exe'], "sub2/xxx.exe\n") - sub1 = test.workpath('sub1') sub2 = test.workpath('sub2') - env = Environment(ENV = { 'PATH' : [sub1, sub2] }) - x = env.Detect('xxx.exe') - assert x is None, x - sub2_xxx_exe = test.workpath('sub2', 'xxx.exe') - os.chmod(sub2_xxx_exe, 0755) + if sys.platform == 'win32': + test.write(['sub1', 'xxx'], "sub1/xxx\n") + test.write(['sub2', 'xxx'], "sub2/xxx\n") - env = Environment(ENV = { 'PATH' : [sub1, sub2] }) - x = env.Detect('xxx.exe') - assert x == 'xxx.exe' + env = Environment(ENV = { 'PATH' : [sub1, sub2] }) - sub1_xxx_exe = test.workpath('sub1', 'xxx.exe') - os.chmod(sub1_xxx_exe, 0755) + x = env.Detect('xxx.exe') + assert x is None, x - x = env.Detect('xxx.exe') - assert x == 'xxx.exe' + test.write(['sub2', 'xxx.exe'], "sub2/xxx.exe\n") + + env = Environment(ENV = { 'PATH' : [sub1, sub2] }) + + x = env.Detect('xxx.exe') + assert x == 'xxx.exe', x + + test.write(['sub1', 'xxx.exe'], "sub1/xxx.exe\n") + + x = env.Detect('xxx.exe') + assert x == 'xxx.exe', x + + else: + test.write(['sub1', 'xxx.exe'], "sub1/xxx.exe\n") + test.write(['sub2', 'xxx.exe'], "sub2/xxx.exe\n") + + env = Environment(ENV = { 'PATH' : [sub1, sub2] }) + + x = env.Detect('xxx.exe') + assert x is None, x + + sub2_xxx_exe = test.workpath('sub2', 'xxx.exe') + os.chmod(sub2_xxx_exe, 0755) + + env = Environment(ENV = { 'PATH' : [sub1, sub2] }) + + x = env.Detect('xxx.exe') + assert x == 'xxx.exe', x + + sub1_xxx_exe = test.workpath('sub1', 'xxx.exe') + os.chmod(sub1_xxx_exe, 0755) + + x = env.Detect('xxx.exe') + assert x == 'xxx.exe', x env = Environment(ENV = { 'PATH' : [] }) x = env.Detect('xxx.exe') diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 365a0b1..f0ac039 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -992,6 +992,8 @@ def _main(): sys.stderr.write(string + " Stop.\n") sys.exit(2) sys.stderr.write(string + "\n") + global exit_status + exit_status = 2 node = None if top and not node.is_under(top): if isinstance(node, SCons.Node.FS.Dir) and top.is_under(node): diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 6b78faf..661ea96 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -144,7 +144,7 @@ def tool_list(platform, env): "prefer Microsoft tools on Windows" linkers = ['mslink', 'gnulink', 'ilink'] c_compilers = ['msvc', 'gcc', 'icc'] - assemblers = ['nasm', 'masm', 'gas'] + assemblers = ['masm', 'nasm', 'gas'] fortran_compilers = ['g77', 'ifl'] ars = ['lib', 'ar'] elif str(platform) == 'os2': |
