From 56eec3c90ca231cc7b50d6f60266f77917b3ea1e Mon Sep 17 00:00:00 2001 From: Russel Winder Date: Tue, 6 Jun 2017 19:21:55 +0100 Subject: Update gdc tool and test now that it can deal wth shared object building. --- src/CHANGES.txt | 1 + src/engine/SCons/Tool/gdc.py | 2 +- test/D/SharedObjects/Common/common.py | 7 ++++++- 3 files changed, 8 insertions(+), 2 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/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') -- cgit v0.12