summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussel Winder <russel@winder.org.uk>2017-06-08 09:08:09 (GMT)
committerRussel Winder <russel@winder.org.uk>2017-06-08 09:08:09 (GMT)
commita057ea49ae3c10c5ddd2be6232a38b110fe7159c (patch)
tree8ce8fd3e20117c75feaf4f4d0cab7a1e3838392b
parentbd8074e30b1fdd8837e6958609c76a919569c65c (diff)
parent10e94d6ef13b7b336d6edada3864c58ddeb1b114 (diff)
downloadSCons-a057ea49ae3c10c5ddd2be6232a38b110fe7159c.zip
SCons-a057ea49ae3c10c5ddd2be6232a38b110fe7159c.tar.gz
SCons-a057ea49ae3c10c5ddd2be6232a38b110fe7159c.tar.bz2
Merge new changesets to this bookmark.
-rw-r--r--src/CHANGES.txt1
-rw-r--r--src/engine/SCons/Node/__init__.py42
-rw-r--r--src/engine/SCons/Tool/gdc.py2
-rw-r--r--test/D/SharedObjects/Common/common.py7
4 files changed, 21 insertions, 31 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/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index f7d2082..0409d3b 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -1136,38 +1136,22 @@ class Node(object, with_metaclass(NoSlotsPyPy)):
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
if self._specific_sources:
- sources = []
- for s in self.sources:
- if s not in ignore_set:
- sources.append(s)
+ sources = [ s for s in self.sources if not s in ignore_set]
+
else:
sources = executor.get_unignored_sources(self, self.ignore)
+
seen = set()
- bsources = []
- bsourcesigs = []
- for s in sources:
- if not s in seen:
- seen.add(s)
- bsources.append(s)
- bsourcesigs.append(s.get_ninfo())
- binfo.bsources = bsources
- binfo.bsourcesigs = bsourcesigs
-
- depends = self.depends
- dependsigs = []
- for d in depends:
- if d not in ignore_set:
- dependsigs.append(d.get_ninfo())
- binfo.bdepends = depends
- binfo.bdependsigs = dependsigs
-
- implicit = self.implicit or []
- implicitsigs = []
- for i in implicit:
- if i not in ignore_set:
- implicitsigs.append(i.get_ninfo())
- binfo.bimplicit = implicit
- binfo.bimplicitsigs = implicitsigs
+ binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)]
+ binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources]
+
+
+ binfo.bdepends = self.depends
+ binfo.bdependsigs = [d.get_ninfo() for d in self.depends if d not in ignore_set]
+
+ binfo.bimplicit = self.implicit or []
+ binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit if i not in ignore_set]
+
return binfo
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')