diff options
author | Russel Winder <russel@winder.org.uk> | 2014-04-23 18:00:51 (GMT) |
---|---|---|
committer | Russel Winder <russel@winder.org.uk> | 2014-04-23 18:00:51 (GMT) |
commit | 1da3ba42c01c41d85c33a5025068e09c4e97219c (patch) | |
tree | 62ee189cae943f3b1ac23a1fbca397eb97a89a85 /src | |
parent | b5c114714edc311f750bdc2730315e905b8f4fa9 (diff) | |
download | SCons-1da3ba42c01c41d85c33a5025068e09c4e97219c.zip SCons-1da3ba42c01c41d85c33a5025068e09c4e97219c.tar.gz SCons-1da3ba42c01c41d85c33a5025068e09c4e97219c.tar.bz2 |
Fix Issue 2939.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Tool/dmd.py | 29 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.xml | 19 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.py | 19 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.xml | 10 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.py | 27 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.xml | 40 |
6 files changed, 97 insertions, 47 deletions
diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py index dafb5b9..4279184 100644 --- a/src/engine/SCons/Tool/dmd.py +++ b/src/engine/SCons/Tool/dmd.py @@ -95,8 +95,6 @@ def generate(env): env['DVERSIONS'] = [] env['DDEBUG'] = [] - #env['SHOBJSUFFIX'] = '.os' - #env['OBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 0 if env['DC']: @@ -113,21 +111,30 @@ def generate(env): env['DFILESUFFIX'] = '.d' env['DLINK'] = '$DC' - env['DLINKCOM'] = '$DLINK -of$TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS' - env['SHDLINKCOM'] = '$DLINK -shared -defaultlib=libphobos2.so -of$TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS' + env['DLINKFLAGS'] = SCons.Util.CLVar('') + env['DLINKCOM'] = '$DLINK -of$TARGET $DLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' - env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' - env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '') + env['DSHLINK'] = '$DC' + env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared -defaultlib=libphobos2.so') + env['SHDLINKCOM'] = '$DLINK -of$TARGET $DSHLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' - env['_DLINKLIBFLAGS'] = '$( ${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' - env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)' - env['DLINKFLAGS'] = ['-L-L.'] 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' + env['DLIBDIRSUFFIX'] = '' + env['_DLIBDIRFLAGS'] = '$( ${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' + + + env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' + env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '') + + #env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)' + env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' - env['DLINKFLAGPREFIX'] = '-' - env['DLINKFLAGSUFFIX'] = '' SCons.Tool.createStaticLibBuilder(env) diff --git a/src/engine/SCons/Tool/dmd.xml b/src/engine/SCons/Tool/dmd.xml index 7cda2a8..b42791e 100644 --- a/src/engine/SCons/Tool/dmd.xml +++ b/src/engine/SCons/Tool/dmd.xml @@ -26,8 +26,7 @@ See its __doc__ string for a discussion of the format. <tool name="dmd"> <summary> <para> -Sets construction variables for D language compilers -(the Digital Mars D compiler, or GDC). +Sets construction variables for D language compiler DMD. </para> </summary> <sets> @@ -54,19 +53,21 @@ Sets construction variables for D language compilers <item>DFLAGSUFFIX</item> <item>DFLESUFFIX</item> <item>DLINK</item> +<item>DLINKFLAGS</item> <item>DLINKCOM</item> +<item>SHDLINK</item> +<item>SHDLINKFLAGS</item> <item>SHDLINKCOM</item> -<item>DLIB</item> -<item>DLIBCOM</item> -<item>_DLINKLIBFLAGS</item> -<item>_DLIBFLAGS</item> -<item>DLINKFLAGS</item> <item>DLIBLINKPREFIX</item> <item>DLIBLINKSUFFIX</item> +<item>_DLIBFLAGS</item> +<item>DLIBDIRPREFIX</item> +<item>DLIBDIRSUFFIX</item> +<item>_DLIBDIRFLAGS</item> +<item>DLIB</item> +<item>DLIBCOM</item> <item>DLIBFLAGPREFIX</item> <item>DLIBFLAGSUFFIX</item> -<item>DLINKFLAGPREFIX</item> -<item>DLINKFLAGSUFFIX</item> </sets> <uses> </uses> diff --git a/src/engine/SCons/Tool/gdc.py b/src/engine/SCons/Tool/gdc.py index 458b10e..7c8649b 100644 --- a/src/engine/SCons/Tool/gdc.py +++ b/src/engine/SCons/Tool/gdc.py @@ -94,22 +94,29 @@ def generate(env): env['DFILESUFFIX'] = '.d' env['DLINK'] = '$DC' - env['DLINKCOM'] = '$DLINK -o $TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS' - env['SHDLINKCOM'] = '$DLINK -o $TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS' + env['DLINKFLAGS'] = SCons.Util.CLVar('') + env['DLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + + env['SHDLINK'] = '$DC' + env['SHDLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared') + env['SHDLINKCOM'] = '$DLINK -o $TARGET $DLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '') - env['_DLINKLIBFLAGS'] = '$( ${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)' - env['DLINKFLAGS'] = ['-L.'] - env['DLIBLINKPREFIX'] = '' if env['PLATFORM'] == 'win32' else '-l' - env['DLIBLINKSUFFIX'] = '.lib' if env['PLATFORM'] == 'win32' else '' + env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' env['DLINKFLAGPREFIX'] = '-' env['DLINKFLAGSUFFIX'] = '' + # __RPATH is set to $_RPATH in the platform specification if that + # platform supports it. + env['RPATHPREFIX'] = '-Wl,-rpath=' + env['RPATHSUFFIX'] = '' + env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}' + SCons.Tool.createStaticLibBuilder(env) diff --git a/src/engine/SCons/Tool/gdc.xml b/src/engine/SCons/Tool/gdc.xml index 1fd95df..818c7d2 100644 --- a/src/engine/SCons/Tool/gdc.xml +++ b/src/engine/SCons/Tool/gdc.xml @@ -53,19 +53,21 @@ Sets construction variables for the D language compiler GDC. <item>DFLAGSUFFIX</item> <item>DFLESUFFIX</item> <item>DLINK</item> +<item>DLINKFLAGS</item> <item>DLINKCOM</item> +<item>SHDLINK</item> +<item>SHDLINKFLAGS</item> <item>SHDLINKCOM</item> <item>DLIB</item> <item>DLIBCOM</item> -<item>_DLINKLIBFLAGS</item> <item>_DLIBFLAGS</item> -<item>DLINKFLAGS</item> -<item>DLIBLINKPREFIX</item> -<item>DLIBLINKSUFFIX</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> diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py index aee6701..2531064 100644 --- a/src/engine/SCons/Tool/ldc.py +++ b/src/engine/SCons/Tool/ldc.py @@ -99,21 +99,30 @@ def generate(env): env['DFILESUFFIX'] = '.d' env['DLINK'] = '$DC' - env['DLINKCOM'] = '$DLINK -of=$TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS' - env['SHDLINKCOM'] = '$DLINK -shared -of=$TARGET $SOURCES $DFLAGS $DLINKFLAGS $_DLINKLIBFLAGS' + env['DLINKFLAGS'] = SCons.Util.CLVar('') + env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' - env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' - env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '') + env['DSHLINK'] = '$DC' + env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared') + env['SHDLINKCOM'] = '$DLINK -of=$TARGET $DSHLINKFLAGS $__RPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS' - env['_DLINKLIBFLAGS'] = '$( ${_concat(DLIBLINKPREFIX, LIBS, DLIBLINKSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' - env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)' - env['DLINKFLAGS'] = ['-L-L.'] 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' + env['DLIBDIRSUFFIX'] = '' + env['_DLIBDIRFLAGS'] = '$( ${_concat(DLIBDIRPREFIX, LIBPATH, DLIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' + + + env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr' + env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {} $TARGET $SOURCES $_DLIBFLAGS'.format('-c' if env['PLATFORM'] == 'win32' else '') + + #env['_DLIBFLAGS'] = '$( ${_concat(DLIBFLAGPREFIX, DLIBFLAGS, DLIBFLAGSUFFIX, __env__)} $)' + env['DLIBFLAGPREFIX'] = '-' env['DLIBFLAGSUFFIX'] = '' - env['DLINKFLAGPREFIX'] = '-' - env['DLINKFLAGSUFFIX'] = '' SCons.Tool.createStaticLibBuilder(env) diff --git a/src/engine/SCons/Tool/ldc.xml b/src/engine/SCons/Tool/ldc.xml index e8879f8..cfa38a9 100644 --- a/src/engine/SCons/Tool/ldc.xml +++ b/src/engine/SCons/Tool/ldc.xml @@ -5,9 +5,29 @@ __COPYRIGHT__ This file is processed by the bin/SConsDoc.py module. See its __doc__ string for a discussion of the format. --> -<tool name="dmd"> + +<!DOCTYPE sconsdoc [ +<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'> +%scons; +<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'> +%builders-mod; +<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'> +%functions-mod; +<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'> +%tools-mod; +<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'> +%variables-mod; +]> + +<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"> + +<tool name="ldc"> <summary> +<para> Sets construction variables for the D language compiler LDC2. +</para> </summary> <sets> <item>DC</item> @@ -33,20 +53,24 @@ Sets construction variables for the D language compiler LDC2. <item>DFLAGSUFFIX</item> <item>DFLESUFFIX</item> <item>DLINK</item> +<item>DLINKFLAGS</item> <item>DLINKCOM</item> +<item>SHDLINK</item> +<item>SHDLINKFLAGS</item> <item>SHDLINKCOM</item> -<item>DLIB</item> -<item>DLIBCOM</item> -<item>_DLINKLIBFLAGS</item> -<item>_DLIBFLAGS</item> -<item>DLINKFLAGS</item> <item>DLIBLINKPREFIX</item> <item>DLIBLINKSUFFIX</item> +<item>_DLIBFLAGS</item> +<item>DLIBDIRPREFIX</item> +<item>DLIBDIRSUFFIX</item> +<item>_DLIBDIRFLAGS</item> +<item>DLIB</item> +<item>DLIBCOM</item> <item>DLIBFLAGPREFIX</item> <item>DLIBFLAGSUFFIX</item> -<item>DLINKFLAGPREFIX</item> -<item>DLINKFLAGSUFFIX</item> </sets> <uses> </uses> </tool> + +</sconsdoc> |