From: stevenknight Date: Thu, 30 Jan 2003 15:21:58 +0000 (+0000) Subject: Win32 portability. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d9f0480288dd028b7da80ad5fe502db942f0d2e;p=scons.git Win32 portability. git-svn-id: http://scons.tigris.org/svn/scons/trunk@569 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index afabea64..2d1c5008 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -137,7 +137,9 @@ def generate(env, platform): env['RCINCPREFIX'] = '--include-dir ' env['RCINCSUFFIX'] = '' env['RCCOM'] = '$RC $RCINCFLAGS $RCFLAGS -i $SOURCE -o $TARGET' - env.CScan.add_skey('.rc') + CScan = env.get_scanner('.c') + if CScan: + CScan.add_skey('.rc') env['BUILDERS']['RES'] = res_builder # Some setting from the platform also have to be overridden: diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index dbb7a85c..3bae021b 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -275,7 +275,9 @@ def generate(env, platform): env['RC'] = 'rc' env['RCFLAGS'] = '' env['RCCOM'] = '$RC $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES' - env.CScan.add_skey('.rc') + CScan = env.get_scanner('.c') + if CScan: + CScan.add_skey('.rc') env['BUILDERS']['RES'] = res_builder include_path, lib_path, exe_path = get_msdev_paths() diff --git a/test/BuildDir-errors.py b/test/BuildDir-errors.py index dcfce09e..f6646a7e 100644 --- a/test/BuildDir-errors.py +++ b/test/BuildDir-errors.py @@ -76,15 +76,18 @@ test.run(chdir = 'normal', arguments = ".") test.fail_test(test.read(['normal', 'build', 'file.out']) != "normal/src/file.in\n") -# Verify the error when the BuildDir itself is read-only. -dir = os.path.join('ro-dir', 'build') -test.subdir(dir) -os.chmod(dir, os.stat(dir)[stat.ST_MODE] & ~stat.S_IWUSR) - -test.run(chdir = 'ro-dir', - arguments = ".", - status = 2, - stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied.\n" % os.path.join('src', 'SConscript')) +# Verify the error when the BuildDir itself is read-only. Don't bother +# to test this on Win32, because the ACL (I think) still allows the +# owner to create files in the directory even when it's read-only. +if sys.platform != 'win32': + dir = os.path.join('ro-dir', 'build') + test.subdir(dir) + os.chmod(dir, os.stat(dir)[stat.ST_MODE] & ~stat.S_IWUSR) + + test.run(chdir = 'ro-dir', + arguments = ".", + status = 2, + stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied.\n" % os.path.join('src', 'SConscript')) # Verify the error when the SConscript file within the BuildDir is # read-only. Note that we have to make the directory read-only too, diff --git a/test/scan-once.py b/test/scan-once.py index 35bb2d7d..4355998f 100644 --- a/test/scan-once.py +++ b/test/scan-once.py @@ -287,6 +287,12 @@ env = env.Copy() # Yes, clobber intentionally Mylib.AddCFlags(env, "-DGOOFY_DEMO") Mylib.AddIncludeDirs(env, ".") +# Not part of SLF's original stuff: On Win32, it's import to use the +# original test environment when we invoke SCons recursively. +import os +recurse_env = env.Copy() +recurse_env["ENV"] = os.environ + # Icky code to set up process environment for "make" # I really ought to drop this into Mylib.... @@ -336,9 +342,9 @@ cmd_justlib = "%s %s -C %s" % (sys.executable, sys.argv[0], Dir(".")) env.Command(string.split(generated_hdrs), ["MAKE-HEADER.py"], cmd_generated) -env.Command([lib_fullname] + lib_objs, - lib_srcs + string.split(generated_hdrs + " " + static_hdrs), - cmd_justlib) +recurse_env.Command([lib_fullname] + lib_objs, + lib_srcs + string.split(generated_hdrs + " " + static_hdrs), + cmd_justlib) """) test.write(['SLF', 'src', 'lib_geng', 'MAKE-HEADER.py'], """\