diff options
author | Russel Winder <russel@winder.org.uk> | 2012-09-06 07:25:29 +0100 |
---|---|---|
committer | Russel Winder <russel@winder.org.uk> | 2012-09-06 07:25:29 +0100 |
commit | a4267404e56ef4ecdf1c19f42b375f45ccb94b75 (patch) | |
tree | 449bfded1fce8a4d557fa41e8ab7da055c078faf | |
parent | cfe8d1be98c2fc0c72938238b9994d9149605b9a (diff) | |
download | scons-a4267404e56ef4ecdf1c19f42b375f45ccb94b75.tar.gz |
Fix a few bugs. Integrate D better into the selection system, and defaulting system.
-rw-r--r-- | src/engine/MANIFEST-xml.in | 2 | ||||
-rw-r--r-- | src/engine/MANIFEST.in | 3 | ||||
-rw-r--r-- | src/engine/SCons/Tool/DCommon.py | 33 | ||||
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.xml | 3 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gdc.xml | 52 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/ldc.xml | 52 |
10 files changed, 156 insertions, 15 deletions
diff --git a/src/engine/MANIFEST-xml.in b/src/engine/MANIFEST-xml.in index d2df7514..4a39c7d1 100644 --- a/src/engine/MANIFEST-xml.in +++ b/src/engine/MANIFEST-xml.in @@ -41,6 +41,7 @@ SCons/Tool/g++.xml SCons/Tool/g77.xml SCons/Tool/gas.xml SCons/Tool/gcc.xml +SCons/Tool/gdc.xml SCons/Tool/gfortran.xml SCons/Tool/gnulink.xml SCons/Tool/gs.xml @@ -59,6 +60,7 @@ SCons/Tool/jar.xml SCons/Tool/javac.xml SCons/Tool/javah.xml SCons/Tool/latex.xml +SCons/Tool/ldc.xml SCons/Tool/lex.xml SCons/Tool/link.xml SCons/Tool/linkloc.xml diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in index 4f175bd8..fedb8dd0 100644 --- a/src/engine/MANIFEST.in +++ b/src/engine/MANIFEST.in @@ -76,6 +76,7 @@ SCons/Tool/c++.py SCons/Tool/cc.py SCons/Tool/cvf.py SCons/Tool/CVS.py +SCons/Tool/DCommon.py SCons/Tool/default.py SCons/Tool/dmd.py SCons/Tool/dvi.py @@ -92,6 +93,7 @@ SCons/Tool/g++.py SCons/Tool/g77.py SCons/Tool/gas.py SCons/Tool/gcc.py +SCons/Tool/gdc.py SCons/Tool/gfortran.py SCons/Tool/gnulink.py SCons/Tool/gs.py @@ -112,6 +114,7 @@ SCons/Tool/JavaCommon.py SCons/Tool/javac.py SCons/Tool/javah.py SCons/Tool/latex.py +SCons/Tool/ldc.py SCons/Tool/lex.py SCons/Tool/link.py SCons/Tool/linkloc.py diff --git a/src/engine/SCons/Tool/DCommon.py b/src/engine/SCons/Tool/DCommon.py index b00d9fb2..10baa1f6 100644 --- a/src/engine/SCons/Tool/DCommon.py +++ b/src/engine/SCons/Tool/DCommon.py @@ -1,9 +1,35 @@ -""" +"""SCons.Tool.DCommon + Common code for the various D tools. Coded by Russel Winder (russel@winder.org.uk) 2012-09-06 """ +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + import os.path def isD(source): @@ -54,3 +80,8 @@ def setSmartLink(env, smart_link, smart_lib): return defaultLib env['SMART_ARCOM'] = smart_lib[arcom] = _smartLib +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 53579593..19c320d6 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -563,7 +563,7 @@ def tool_list(platform, env): assemblers = ['masm', 'nasm', 'gas', '386asm' ] fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran'] ars = ['mslib', 'ar', 'tlib'] - other_plat_tools=['msvs','midl'] + other_plat_tools = ['msvs', 'midl'] elif str(platform) == 'os2': "prefer IBM tools on OS/2" linkers = ['ilink', 'gnulink', ]#'mslink'] @@ -645,8 +645,10 @@ def tool_list(platform, env): fortran_compiler = FindTool(fortran_compilers, env) or fortran_compilers[0] ar = FindTool(ars, env) or ars[0] + d_compilers = ['dmd', 'gdc', 'lcd2'] + d_compiler = FindTool(d_compilers, env) or d_compilers[0] + other_tools = FindAllTools(other_plat_tools + [ - 'dmd', #TODO: merge 'install' into 'filesystem' and # make 'filesystem' the default 'filesystem', @@ -669,7 +671,7 @@ def tool_list(platform, env): ], env) tools = ([linker, c_compiler, cxx_compiler, - fortran_compiler, assembler, ar] + fortran_compiler, assembler, ar, d_compiler] + other_tools) return [x for x in tools if x] diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py index 1f6ec1c4..1ffd6ad2 100644 --- a/src/engine/SCons/Tool/dmd.py +++ b/src/engine/SCons/Tool/dmd.py @@ -68,7 +68,7 @@ import SCons.Defaults import SCons.Scanner.D import SCons.Tool -import DCommon +import SCons.Tool.DCommon smart_link = {} smart_lib = {} @@ -97,7 +97,7 @@ def generate(env): env['DDEBUG'] = [] if dc: - DCommon.addDPATHToEnv(env, dc) + SCons.Tool.DCommon.addDPATHToEnv(env, dc) env['DINCPREFIX'] = '-I' env['DINCSUFFIX'] = '' @@ -130,7 +130,7 @@ def generate(env): # these builders check for the presence of D source, and swap out # the system's defaults for the Digital Mars tools. If there's no D # source, then we silently return the previous settings. - DCommon.setSmartLink(env, smart_link, smart_lib) + SCons.Tool.DCommon.setSmartLink(env, smart_link, smart_lib) # It is worth noting that the final space in these strings is # absolutely pivotal. SCons sees these as actions and not generators diff --git a/src/engine/SCons/Tool/dmd.xml b/src/engine/SCons/Tool/dmd.xml index 835a4eb9..fd2a8c61 100644 --- a/src/engine/SCons/Tool/dmd.xml +++ b/src/engine/SCons/Tool/dmd.xml @@ -6,8 +6,7 @@ See its __doc__ string for a discussion of the format. --> <tool name="dmd"> <summary> -Sets construction variables for D language compilers -(the Digital Mars D compiler, or GDC). +Sets construction variables for the D language compiler DMD or GDMD. </summary> <sets> <!-- diff --git a/src/engine/SCons/Tool/gdc.py b/src/engine/SCons/Tool/gdc.py index 17c0f52e..b7085d2a 100644 --- a/src/engine/SCons/Tool/gdc.py +++ b/src/engine/SCons/Tool/gdc.py @@ -52,7 +52,7 @@ import SCons.Action import SCons.Defaults import SCons.Tool -import DCommon +import SCons.Tool.DCommon smart_link = {} smart_lib = {} @@ -81,7 +81,7 @@ def generate(env): env['DDEBUG'] = [] if dc: - DCommon.addDPATHToEnv(env, dc) + SCons.Tool.DCommon.addDPATHToEnv(env, dc) env['DINCPREFIX'] = '-I' env['DINCSUFFIX'] = '' @@ -114,7 +114,7 @@ def generate(env): # these builders check for the presence of D source, and swap out # the system's defaults for the Digital Mars tools. If there's no D # source, then we silently return the previous settings. - DCommon.setSmartLink(env, smart_link, smart_lib) + SCons.Tool.DCommon.setSmartLink(env, smart_link, smart_lib) # It is worth noting that the final space in these strings is # absolutely pivotal. SCons sees these as actions and not generators diff --git a/src/engine/SCons/Tool/gdc.xml b/src/engine/SCons/Tool/gdc.xml new file mode 100644 index 00000000..0388a311 --- /dev/null +++ b/src/engine/SCons/Tool/gdc.xml @@ -0,0 +1,52 @@ +<!-- +__COPYRIGHT__ + +This file is processed by the bin/SConsDoc.py module. +See its __doc__ string for a discussion of the format. +--> +<tool name="gdc"> +<summary> +Sets construction variables for the D language compiler GDC. +</summary> +<sets> +<!-- +DC +DCOM +_DINCFLAGS +_DVERFLAGS +_DDEBUGFLAGS +_DFLAGS +DPATH +DFLAGS +DVERSIONS +DDEBUG +DINCPREFIX +DINCSUFFIX +DVERPREFIX +DVERSUFFIX +DDEBUGPREFIX +DDEBUGSUFFIX +DFLAGPREFIX +DFLAGSUFFIX +DFLESUFFIX +DLINK +DLINKCOM +DLIB +DLIBCOM +_DLINKLIBFLAGS +_DLIBFLAGS +DLINKFLAGS +DLIBLINKPREFIX +DLIBLINKSUFFIX +DLIBFLAGPREFIX +DLIBFLAGSUFFIX +DLINKFLAGPREFIX +DLINKFLAGSUFFIX +LINKCOM +ARCOM +LIBS +--> +</sets> +<uses> +</uses> +</tool> diff --git a/src/engine/SCons/Tool/ldc.py b/src/engine/SCons/Tool/ldc.py index ad1a64dc..cc197ab3 100644 --- a/src/engine/SCons/Tool/ldc.py +++ b/src/engine/SCons/Tool/ldc.py @@ -57,7 +57,7 @@ import SCons.Defaults import SCons.Scanner.D import SCons.Tool -import DCommon +import SCons.Tool.DCommon smart_link = {} smart_lib = {} @@ -86,7 +86,7 @@ def generate(env): env['DDEBUG'] = [] if dc: - DCommon.addDPATHToEnv(env, dc) + SCons.Tool.DCommon.addDPATHToEnv(env, dc) env['DINCPREFIX'] = '-I=' env['DINCSUFFIX'] = '' @@ -119,7 +119,7 @@ def generate(env): # these builders check for the presence of D source, and swap out # the system's defaults for the Digital Mars tools. If there's no D # source, then we silently return the previous settings. - DCommon.setSmartLink(env, smart_link, smart_lib) + SCons.Tool.DCommon.setSmartLink(env, smart_link, smart_lib) # It is worth noting that the final space in these strings is # absolutely pivotal. SCons sees these as actions and not generators diff --git a/src/engine/SCons/Tool/ldc.xml b/src/engine/SCons/Tool/ldc.xml new file mode 100644 index 00000000..6785dad0 --- /dev/null +++ b/src/engine/SCons/Tool/ldc.xml @@ -0,0 +1,52 @@ +<!-- +__COPYRIGHT__ + +This file is processed by the bin/SConsDoc.py module. +See its __doc__ string for a discussion of the format. +--> +<tool name="dmd"> +<summary> +Sets construction variables for the D language compiler LDC2. +</summary> +<sets> +<!-- +DC +DCOM +_DINCFLAGS +_DVERFLAGS +_DDEBUGFLAGS +_DFLAGS +DPATH +DFLAGS +DVERSIONS +DDEBUG +DINCPREFIX +DINCSUFFIX +DVERPREFIX +DVERSUFFIX +DDEBUGPREFIX +DDEBUGSUFFIX +DFLAGPREFIX +DFLAGSUFFIX +DFLESUFFIX +DLINK +DLINKCOM +DLIB +DLIBCOM +_DLINKLIBFLAGS +_DLIBFLAGS +DLINKFLAGS +DLIBLINKPREFIX +DLIBLINKSUFFIX +DLIBFLAGPREFIX +DLIBFLAGSUFFIX +DLINKFLAGPREFIX +DLINKFLAGSUFFIX +LINKCOM +ARCOM +LIBS +--> +</sets> +<uses> +</uses> +</tool> |