Russel Winder avatar Russel Winder committed 5c57ae7

Fix a few bugs. Integrate D better into the selection system, and defaulting system.

Comments (0)

Files changed (10)

src/engine/MANIFEST-xml.in

 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
 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

src/engine/MANIFEST.in

 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
 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
 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

src/engine/SCons/Tool/DCommon.py

-"""
+"""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):
                 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:

src/engine/SCons/Tool/__init__.py

         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']
         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',
                                ], 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]

src/engine/SCons/Tool/dmd.py

 import SCons.Scanner.D
 import SCons.Tool
 
-import DCommon
+import SCons.Tool.DCommon
 
 smart_link = {}
 smart_lib = {}
     env['DDEBUG'] = []
 
     if dc:
-        DCommon.addDPATHToEnv(env, dc)
+        SCons.Tool.DCommon.addDPATHToEnv(env, dc)
 
     env['DINCPREFIX'] = '-I'
     env['DINCSUFFIX'] = ''
     # 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

src/engine/SCons/Tool/dmd.xml

 -->
 <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>
 <!--

src/engine/SCons/Tool/gdc.py

 import SCons.Defaults
 import SCons.Tool
 
-import DCommon
+import SCons.Tool.DCommon
 
 smart_link = {}
 smart_lib = {}
     env['DDEBUG'] = []
 
     if dc:
-        DCommon.addDPATHToEnv(env, dc)
+        SCons.Tool.DCommon.addDPATHToEnv(env, dc)
 
     env['DINCPREFIX'] = '-I'
     env['DINCSUFFIX'] = ''
     # 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

src/engine/SCons/Tool/gdc.xml

+<!--
+__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>

src/engine/SCons/Tool/ldc.py

 import SCons.Scanner.D
 import SCons.Tool
 
-import DCommon
+import SCons.Tool.DCommon
 
 smart_link = {}
 smart_lib = {}
     env['DDEBUG'] = []
 
     if dc:
-        DCommon.addDPATHToEnv(env, dc)
+        SCons.Tool.DCommon.addDPATHToEnv(env, dc)
 
     env['DINCPREFIX'] = '-I='
     env['DINCSUFFIX'] = ''
     # 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

src/engine/SCons/Tool/ldc.xml

+<!--
+__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>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.