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:
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()
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,
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....
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'], """\