diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-03-11 19:54:16 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2019-03-11 19:54:16 (GMT) |
commit | df613e42c8cdd9f257dfdce157be140a519f6bd1 (patch) | |
tree | b92b9b6a48b9081e62e003424f75680551e30899 | |
parent | 6a0f197c4540d11f5edaf216c4300347eea957ed (diff) | |
download | SCons-df613e42c8cdd9f257dfdce157be140a519f6bd1.zip SCons-df613e42c8cdd9f257dfdce157be140a519f6bd1.tar.gz SCons-df613e42c8cdd9f257dfdce157be140a519f6bd1.tar.bz2 |
Fix issue #2799 - Get mingw tool to respect SHCCCOMSTR, SHLINKCOMSTR and LDMODULECOMSTR
-rw-r--r-- | src/engine/SCons/Tool/mingw.py | 5 | ||||
-rw-r--r-- | test/MinGW/bug_2799/SConstruct | 14 | ||||
-rw-r--r-- | test/MinGW/bug_2799/module.c | 3 | ||||
-rw-r--r-- | test/MinGW/bug_2799/sconstest.skip | 0 | ||||
-rw-r--r-- | test/MinGW/bug_2799/shlib.c | 4 | ||||
-rw-r--r-- | test/MinGW/mingw_uses_comstr_issue_2799.py | 55 |
6 files changed, 79 insertions, 2 deletions
diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index ce31f88..311a955 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -107,7 +107,8 @@ def shlib_emitter(target, source, env): return (target, source) -shlib_action = SCons.Action.Action(shlib_generator, generator=1) +shlib_action = SCons.Action.Action(shlib_generator, '$SHLINKCOMSTR', generator=1) +ldmodule_action = SCons.Action.Action(shlib_generator, '$LDMODULECOMSTR', generator=1) res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') @@ -161,7 +162,7 @@ def generate(env): env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') env['SHLINKCOM'] = shlib_action - env['LDMODULECOM'] = shlib_action + env['LDMODULECOM'] = ldmodule_action env.Append(SHLIBEMITTER = [shlib_emitter]) env.Append(LDMODULEEMITTER = [shlib_emitter]) env['AS'] = 'as' diff --git a/test/MinGW/bug_2799/SConstruct b/test/MinGW/bug_2799/SConstruct new file mode 100644 index 0000000..a1832f1 --- /dev/null +++ b/test/MinGW/bug_2799/SConstruct @@ -0,0 +1,14 @@ +env = Environment( + tools = ['mingw'], + SHCCCOMSTR = 'SHCC $TARGET', + SHLINKCOMSTR = 'SHLINK $TARGET', + LDMODULECOMSTR = 'LDMODULE $TARGET', + SHOBSUFFIX='.o', + SHLIBSUFFIX='.so', + SHLIBPREFIX='lib', + LDMODULESUFFIX='.so', +) + +env.SharedLibrary('testlib', 'shlib.c') + +env.LoadableModule('testmodule', 'module.c') diff --git a/test/MinGW/bug_2799/module.c b/test/MinGW/bug_2799/module.c new file mode 100644 index 0000000..3cf5ace --- /dev/null +++ b/test/MinGW/bug_2799/module.c @@ -0,0 +1,3 @@ +extern void bar(void) +{ +} diff --git a/test/MinGW/bug_2799/sconstest.skip b/test/MinGW/bug_2799/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/MinGW/bug_2799/sconstest.skip diff --git a/test/MinGW/bug_2799/shlib.c b/test/MinGW/bug_2799/shlib.c new file mode 100644 index 0000000..efe6b3f --- /dev/null +++ b/test/MinGW/bug_2799/shlib.c @@ -0,0 +1,4 @@ +extern int foo(void) +{ + return 0; +} diff --git a/test/MinGW/mingw_uses_comstr_issue_2799.py b/test/MinGW/mingw_uses_comstr_issue_2799.py new file mode 100644 index 0000000..cc92446 --- /dev/null +++ b/test/MinGW/mingw_uses_comstr_issue_2799.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test that mingw respects SHLINKCOMSTR, SHCCCOMSTR, and LDMODULECOMSTR +""" + +import sys +import TestSCons + +_python_ = TestSCons._python_ + +test = TestSCons.TestSCons() + +test.dir_fixture('bug_2799') + +test.run('-n -Q') +test.must_contain_all_lines(test.stdout(), + [ + 'SHCC shlib.o', + 'SHLINK libtestlib.so', + 'SHCC module.o', + 'LDMODULE libtestmodule.so',''], + ) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: |