diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-06-14 14:31:37 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-06-14 14:31:37 (GMT) |
commit | d5f80e5880c1d541b11797b4f83a93d975f3f513 (patch) | |
tree | 35a13fca8a13da39d70992e1f5618fe488505dcf | |
parent | 06eb0b02185a061e8fb43fe7763a8cf3650ca088 (diff) | |
parent | a057ea49ae3c10c5ddd2be6232a38b110fe7159c (diff) | |
download | SCons-d5f80e5880c1d541b11797b4f83a93d975f3f513.zip SCons-d5f80e5880c1d541b11797b4f83a93d975f3f513.tar.gz SCons-d5f80e5880c1d541b11797b4f83a93d975f3f513.tar.bz2 |
merge
-rw-r--r-- | src/CHANGES.txt | 1 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.py | 2 | ||||
-rw-r--r-- | test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py | 2 | ||||
-rw-r--r-- | test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py | 2 | ||||
-rw-r--r-- | test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py | 62 | ||||
-rw-r--r-- | test/D/Issues/2994/Common/__init__.py | 0 | ||||
-rw-r--r-- | test/D/Issues/2994/Common/sconstest.skip | 0 | ||||
-rw-r--r-- | test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py | 23 | ||||
-rw-r--r-- | test/D/Issues/2994/Project/SConstruct_template (renamed from test/D/Issues/2994/image/SConstruct) | 2 | ||||
-rw-r--r-- | test/D/Issues/2994/Project/main.d (renamed from test/D/Issues/2994/image/main.d) | 0 | ||||
-rw-r--r-- | test/D/SharedObjects/Common/common.py | 7 |
11 files changed, 73 insertions, 28 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 93b1512..ada66b0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -33,6 +33,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Reordered the default D tools from "dmd, gdc, ldc" to "dmd, ldc, gdc". - Add a ProgramAllAtOnce builder to the dmd, ldc, and gdc tools. (PR #448) - Deprecate a file name exception for very old Fedora LDC installation. + - gdc can now handle building shared objects (tested for version 6.3.0). From William Blevins: - Updated D language scanner support to latest: 2.071.1. (PR #1924) diff --git a/src/engine/SCons/Tool/gdc.py b/src/engine/SCons/Tool/gdc.py index 20903f7..fdfe867 100644 --- a/src/engine/SCons/Tool/gdc.py +++ b/src/engine/SCons/Tool/gdc.py @@ -98,7 +98,7 @@ def generate(env): env['DLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['DSHLINK'] = '$DC' - env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared') + env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -shared-libphobos') env['SHDLINKCOM'] = '$DLINK -o $TARGET $DSHLINKFLAGS $__DSHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' diff --git a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py index 2446a28..e248cb6 100644 --- a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py +++ b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_dmd.py @@ -1,5 +1,5 @@ """ -Test compiling and executing using the gdc tool. +Test compiling and executing using the dmd tool. """ # diff --git a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py index a61a94b..6c524df 100644 --- a/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py +++ b/test/D/Issues/2939_Ariovistus/sconstest-correctLinkOptions_ldc.py @@ -1,5 +1,5 @@ """ -Test compiling and executing using the gdc tool. +Test compiling and executing using the ldc tool. """ # diff --git a/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py new file mode 100644 index 0000000..7e69f50 --- /dev/null +++ b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py @@ -0,0 +1,62 @@ +""" +Test to check for issue reported in tigris bug 2994 +http://scons.tigris.org/issues/show_bug.cgi?id=2994 +""" + +# +# __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__" + +import TestSCons + +from os.path import abspath, dirname, join + +import sys +sys.path.insert(1, abspath(dirname(__file__) + '/../../../Support')) + +from executablesSearch import isExecutableOfToolAvailable + + +def testForTool(tool): + + test = TestSCons.TestSCons() + + if not isExecutableOfToolAvailable(test, tool) : + test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) + + test.dir_fixture('Project') + test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "link"]'.format(tool))) + + test.run() + test.fail_test('main.o' not in test.stdout()) + test.run(arguments='change=1') + test.fail_test('is up to date' in test.stdout()) + + test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/D/Issues/2994/Common/__init__.py b/test/D/Issues/2994/Common/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/D/Issues/2994/Common/__init__.py diff --git a/test/D/Issues/2994/Common/sconstest.skip b/test/D/Issues/2994/Common/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/D/Issues/2994/Common/sconstest.skip diff --git a/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py deleted file mode 100644 index 1d9854f..0000000 --- a/test/D/Issues/2994/D_changed_DFLAGS_not_rebuilding.py +++ /dev/null @@ -1,23 +0,0 @@ -# Test to check for issue reported in tigris bug 2994 -# http://scons.tigris.org/issues/show_bug.cgi?id=2994 -# - -import TestSCons - -test = TestSCons.TestSCons() - -dmd_present = test.detect_tool('dmd', prog='dmd') -ldc_present = test.detect_tool('ldc',prog='ldc2') -gdc_present = test.detect_tool('gdc',prog='gdc') - -if not (dmd_present or ldc_present or gdc_present): - test.skip_test("Could not load dmd ldc or gdc Tool; skipping test(s).\n") - - -test.dir_fixture('image') -test.run() -test.fail_test('main.o' not in test.stdout()) -test.run(arguments='change=1') -test.fail_test('is up to date' in test.stdout()) - -test.pass_test() diff --git a/test/D/Issues/2994/image/SConstruct b/test/D/Issues/2994/Project/SConstruct_template index 92f76c2..555b1b0 100644 --- a/test/D/Issues/2994/image/SConstruct +++ b/test/D/Issues/2994/Project/SConstruct_template @@ -1,6 +1,6 @@ # -*- mode:python; coding:utf-8; -*- -env=Environment() +env=Environment({}) change = ARGUMENTS.get('change', 0) if int(change): diff --git a/test/D/Issues/2994/image/main.d b/test/D/Issues/2994/Project/main.d index f0aa23a..f0aa23a 100644 --- a/test/D/Issues/2994/image/main.d +++ b/test/D/Issues/2994/Project/main.d diff --git a/test/D/SharedObjects/Common/common.py b/test/D/SharedObjects/Common/common.py index 280c6f2..0322385 100644 --- a/test/D/SharedObjects/Common/common.py +++ b/test/D/SharedObjects/Common/common.py @@ -32,6 +32,7 @@ import TestSCons from SCons.Environment import Base from os.path import abspath, dirname +from subprocess import check_output import sys sys.path.insert(1, abspath(dirname(__file__) + '/../../Support')) @@ -46,7 +47,11 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) if tool == 'gdc': - test.skip_test('gdc in GCC distribution does not, as at version 5.3.1, support shared libraries.\n') + result = check_output(('gdc', '--version')) + version = result.decode().splitlines()[0].split()[3] + major, minor, debug = [int(x) for x in version.split('.')] + if (major < 6) or (major == 6 and minor < 3): + test.skip_test('gdc prior to version 6.0.0 does not support shared libraries.\n') if tool == 'dmd' and Base()['DC'] == 'gdmd': test.skip_test('gdmd does not recognize the -shared option so cannot support linking of shared objects.\n') |