diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2014-04-26 14:36:55 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2014-04-26 14:36:55 (GMT) |
commit | 01cfadf64fb41ef93bdb966a38b2a2c18bfb2324 (patch) | |
tree | ea946de0b370a81cda5834d66994f68a2412ce8f /src | |
parent | 320e2cdff17970f826ce6f20d64b24a1aafdbfe8 (diff) | |
parent | 39ef5817b09766f7381cfa19d6775d05fbb5902f (diff) | |
download | SCons-01cfadf64fb41ef93bdb966a38b2a2c18bfb2324.zip SCons-01cfadf64fb41ef93bdb966a38b2a2c18bfb2324.tar.gz SCons-01cfadf64fb41ef93bdb966a38b2a2c18bfb2324.tar.bz2 |
Merged in russel/scons (pull request #130) - D language fixes
Fix Issues 2939 and 2940
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Platform/posix.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.py | 34 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.xml | 25 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.py | 19 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.xml | 16 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.py | 33 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.xml | 42 |
7 files changed, 125 insertions, 48 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 dafb5b9..f1afc79 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,35 @@ 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 $__DRPATH $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 $__DRPATH $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'] = '${_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'] = '' + + # __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 7cda2a8..65ef75c 100644 --- a/src/engine/SCons/Tool/dmd.xml +++ b/src/engine/SCons/Tool/dmd.xml @@ -21,13 +21,12 @@ 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> <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> @@ -52,21 +51,27 @@ Sets construction variables for D language compilers <item>DDEBUGSUFFIX</item> <item>DFLAGPREFIX</item> <item>DFLAGSUFFIX</item> -<item>DFLESUFFIX</item> +<item>DFILESUFFIX</item> <item>DLINK</item> +<item>DLINKFLAGS</item> <item>DLINKCOM</item> +<item>SHDLINK</item> +<item>SHDLINKFLAGS</item> <item>SHDLINKCOM</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>_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/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..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,22 +51,26 @@ 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> +<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> </tool> + +</sconsdoc> diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py index aee6701..ca873b5 100644 --- a/src/engine/SCons/Tool/ldc.py +++ b/src/engine/SCons/Tool/ldc.py @@ -99,21 +99,36 @@ 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 $__DRPATH $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 $__DRPATH $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'] = '' + + # __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 e8879f8..18f676d 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/scons.xsd"> + +<tool name="ldc"> <summary> +<para> Sets construction variables for the D language compiler LDC2. +</para> </summary> <sets> <item>DC</item> @@ -31,22 +51,32 @@ 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> +<item>SHDLINK</item> +<item>SHDLINKFLAGS</item> <item>SHDLINKCOM</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>_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> </tool> + +</sconsdoc> |