diff options
author | Russel Winder <russel@winder.org.uk> | 2014-04-24 11:16:44 (GMT) |
---|---|---|
committer | Russel Winder <russel@winder.org.uk> | 2014-04-24 11:16:44 (GMT) |
commit | 39ef5817b09766f7381cfa19d6775d05fbb5902f (patch) | |
tree | 93a4cf92d73f6ea9f40f961ddb77e1064664426c /src | |
parent | 1da3ba42c01c41d85c33a5025068e09c4e97219c (diff) | |
download | SCons-39ef5817b09766f7381cfa19d6775d05fbb5902f.zip SCons-39ef5817b09766f7381cfa19d6775d05fbb5902f.tar.gz SCons-39ef5817b09766f7381cfa19d6775d05fbb5902f.tar.bz2 |
Fix Issue 2940, generating the wrong rpath flags for DMD and LDC.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Platform/posix.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.py | 11 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.xml | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.xml | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.py | 10 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.xml | 10 |
6 files changed, 38 insertions, 11 deletions
diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py index 2e21e5a..7e69a7c 100644 --- a/src/engine/SCons/Platform/posix.py +++ b/src/engine/SCons/Platform/posix.py @@ -113,6 +113,10 @@ def generate(env): # This platform supports RPATH specifications. env['__RPATH'] = '$_RPATH' + # GDC is GCC family, but DMD and LDC have different options. + # Must be able to have GCC and DMD work in the same build, so: + env['__DRPATH'] = '$_DRPATH' + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py index 4279184..f1afc79 100644 --- a/src/engine/SCons/Tool/dmd.py +++ b/src/engine/SCons/Tool/dmd.py @@ -112,15 +112,14 @@ def generate(env): env['DLINK'] = '$DC' env['DLINKFLAGS'] = SCons.Util.CLVar('') - env['DLINKCOM'] = '$DLINK -of$TARGET $DLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' + env['DLINKCOM'] = '$DLINK -of$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['DSHLINK'] = '$DC' env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=libphobos2.so') - env['SHDLINKCOM'] = '$DLINK -of$TARGET $DSHLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' + env['SHDLINKCOM'] = '$DLINK -of$TARGET $DSHLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l' env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else '' - #env['_DLIBFLAGS'] = '$( ${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' env['_DLIBFLAGS'] = '${_stripixes(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}' env['DLIBDIRPREFIX'] = '-L-L' @@ -136,6 +135,12 @@ def generate(env): env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' + # __RPATH is set to $_RPATH in the platform specification if that + # platform supports it. + env['DRPATHPREFIX'] = '-L-rpath=' + env['DRPATHSUFFIX'] = '' + env['_DRPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}' + SCons.Tool.createStaticLibBuilder(env) diff --git a/src/engine/SCons/Tool/dmd.xml b/src/engine/SCons/Tool/dmd.xml index b42791e..65ef75c 100644 --- a/src/engine/SCons/Tool/dmd.xml +++ b/src/engine/SCons/Tool/dmd.xml @@ -21,7 +21,7 @@ See its __doc__ string for a discussion of the format. <sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd"> + xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd"> <tool name="dmd"> <summary> @@ -51,7 +51,7 @@ Sets construction variables for D language compiler DMD. <item>DDEBUGSUFFIX</item> <item>DFLAGPREFIX</item> <item>DFLAGSUFFIX</item> -<item>DFLESUFFIX</item> +<item>DFILESUFFIX</item> <item>DLINK</item> <item>DLINKFLAGS</item> <item>DLINKCOM</item> @@ -66,8 +66,12 @@ Sets construction variables for D language compiler DMD. <item>_DLIBDIRFLAGS</item> <item>DLIB</item> <item>DLIBCOM</item> +<item>_DLIBFLAGS</item> <item>DLIBFLAGPREFIX</item> <item>DLIBFLAGSUFFIX</item> +<item>RPATHPREFIX</item> +<item>RPATHSUFFIX</item> +<item>_RPATH</item> </sets> <uses> </uses> diff --git a/src/engine/SCons/Tool/gdc.xml b/src/engine/SCons/Tool/gdc.xml index 818c7d2..df568b4 100644 --- a/src/engine/SCons/Tool/gdc.xml +++ b/src/engine/SCons/Tool/gdc.xml @@ -21,7 +21,7 @@ See its __doc__ string for a discussion of the format. <sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd"> + xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd"> <tool name="gdc"> <summary> @@ -51,7 +51,7 @@ Sets construction variables for the D language compiler GDC. <item>DDEBUGSUFFIX</item> <item>DFLAGPREFIX</item> <item>DFLAGSUFFIX</item> -<item>DFLESUFFIX</item> +<item>DFILESUFFIX</item> <item>DLINK</item> <item>DLINKFLAGS</item> <item>DLINKCOM</item> @@ -72,3 +72,5 @@ Sets construction variables for the D language compiler GDC. <uses> </uses> </tool> + +</sconsdoc> diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py index 2531064..ca873b5 100644 --- a/src/engine/SCons/Tool/ldc.py +++ b/src/engine/SCons/Tool/ldc.py @@ -100,11 +100,11 @@ def generate(env): env['DLINK'] = '$DC' env['DLINKFLAGS'] = SCons.Util.CLVar('') - env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' + env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['DSHLINK'] = '$DC' env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared') - env['SHDLINKCOM'] = '$DLINK -of=$TARGET $DSHLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' + env['SHDLINKCOM'] = '$DLINK -of=$TARGET $DSHLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-L-l' env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else '' @@ -124,6 +124,12 @@ def generate(env): env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' + # __RPATH is set to $_RPATH in the platform specification if that + # platform supports it. + env['DRPATHPREFIX'] = '-L-rpath=' + env['DRPATHSUFFIX'] = '' + env['_RPATH'] = '${_concat(DRPATHPREFIX, RPATH, DRPATHSUFFIX, __env__)}' + SCons.Tool.createStaticLibBuilder(env) diff --git a/src/engine/SCons/Tool/ldc.xml b/src/engine/SCons/Tool/ldc.xml index cfa38a9..18f676d 100644 --- a/src/engine/SCons/Tool/ldc.xml +++ b/src/engine/SCons/Tool/ldc.xml @@ -21,7 +21,7 @@ See its __doc__ string for a discussion of the format. <sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd"> + xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd"> <tool name="ldc"> <summary> @@ -51,7 +51,7 @@ Sets construction variables for the D language compiler LDC2. <item>DDEBUGSUFFIX</item> <item>DFLAGPREFIX</item> <item>DFLAGSUFFIX</item> -<item>DFLESUFFIX</item> +<item>DFILESUFFIX</item> <item>DLINK</item> <item>DLINKFLAGS</item> <item>DLINKCOM</item> @@ -66,8 +66,14 @@ Sets construction variables for the D language compiler LDC2. <item>_DLIBDIRFLAGS</item> <item>DLIB</item> <item>DLIBCOM</item> +<item>_DLIBFLAGS</item> <item>DLIBFLAGPREFIX</item> <item>DLIBFLAGSUFFIX</item> +<item>DLINKFLAGPREFIX</item> +<item>DLINKFLAGSUFFIX</item> +<item>RPATHPREFIX</item> +<item>RPATHSUFFIX</item> +<item>_RPATH</item> </sets> <uses> </uses> |