summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2012-07-22 23:50:33 +0100
committerGary Oberbrunner <garyo@oberbrunner.com>2012-07-22 23:50:33 +0100
commit859b48366134e3df4300b93e2febeae43487401c (patch)
tree7411e229d862609f8cf7b0748ef4afdf67905522
parent49b65cbd06362013405f5f19304639aa8c207354 (diff)
downloadscons-859b48366134e3df4300b93e2febeae43487401c.tar.gz
Fix issue 2833 (LINKCOMSTR etc. on Windows).
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Tool/mslink.py6
-rw-r--r--test/LINK/LINKCOMSTR.py14
-rw-r--r--test/LINK/SHLINKCOMSTR.py16
4 files changed, 36 insertions, 3 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 9df2d344..6b8cf5f6 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -6,6 +6,9 @@
RELEASE 2.X.X -
+ From smallbub on Bitbucket:
+ - Fix LINKCOMSTR, SHLINKCOMSTR, and LDMODULECOMSTR on Windows (#2833).
+
From Mortoray:
- Make -s (silent mode) be silent about entering subdirs (#2976).
- Fix cloning of builders when cloning environment (#2821).
diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py
index 35c9de6f..40f112b6 100644
--- a/src/engine/SCons/Tool/mslink.py
+++ b/src/engine/SCons/Tool/mslink.py
@@ -237,11 +237,11 @@ embedManifestExeCheckAction = SCons.Action.Action(embedManifestExeCheck, None)
regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
regServerCheck = SCons.Action.Action(RegServerFunc, None)
-shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
+shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}', '$SHLINKCOMSTR')
compositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction
-ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}')
+ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}', '$LDMODULECOMSTR')
compositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction
-exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}')
+exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}', '$LINKCOMSTR')
compositeLinkAction = exeLinkAction + embedManifestExeCheckAction
def generate(env):
diff --git a/test/LINK/LINKCOMSTR.py b/test/LINK/LINKCOMSTR.py
index 113bdcdc..8fd8adcf 100644
--- a/test/LINK/LINKCOMSTR.py
+++ b/test/LINK/LINKCOMSTR.py
@@ -72,7 +72,21 @@ Linking test1.exe from test1.obj test2.obj
test.must_match('test1.exe', "test1.obj\ntest2.obj\n")
+# Now test an actual compile and link. Since MS Windows
+# resets the link actions, this could fail even if the above
+# test passed.
+test.write('SConstruct', """
+env = Environment(CXXCOMSTR = 'Compiling $TARGET ...',
+ LINKCOMSTR = 'Linking $TARGET ...')
+env.Program('test', 'test.cpp')
+""")
+test.write('test.cpp', """
+int main(int argc, char **argv) {}
+""")
+test.run()
+if ("Linking" not in test.stdout()):
+ test.fail_test()
test.pass_test()
diff --git a/test/LINK/SHLINKCOMSTR.py b/test/LINK/SHLINKCOMSTR.py
index dd6f22b4..f97040a6 100644
--- a/test/LINK/SHLINKCOMSTR.py
+++ b/test/LINK/SHLINKCOMSTR.py
@@ -91,6 +91,22 @@ Linking shared test3.dll from test1.obj test2.obj
test.must_match('test3.dll', "test1.c\ntest2.c\n")
+# Now test an actual compile and link. Since MS Windows
+# resets the link actions, this could fail even if the above
+# test passed.
+test.write('SConstruct', """
+env = Environment(CXXCOMSTR = 'Compiling $TARGET ...',
+ SHLINKCOMSTR = 'Shared-Linking $TARGET ...')
+env.SharedLibrary('test', 'test.cpp')
+""")
+test.write('test.cpp', """
+int i;
+""")
+
+test.run()
+if ("Shared-Linking" not in test.stdout()):
+ test.fail_test()
+
test.pass_test()