Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-08-23 20:51:07


Author: jurko
Date: 2008-08-23 20:51:06 EDT (Sat, 23 Aug 2008)
New Revision: 48337
URL: http://svn.boost.org/trac/boost/changeset/48337

Log:
Minor stylistic changes and code cleanup in several internal Boost Build modules.
Text files modified:
   trunk/tools/build/v2/tools/builtin.jam | 4
   trunk/tools/build/v2/tools/common.jam | 35 ++++++------
   trunk/tools/build/v2/tools/intel-win.jam | 109 ++++++++++++++++++---------------------
   3 files changed, 71 insertions(+), 77 deletions(-)

Modified: trunk/tools/build/v2/tools/builtin.jam
==============================================================================
--- trunk/tools/build/v2/tools/builtin.jam (original)
+++ trunk/tools/build/v2/tools/builtin.jam 2008-08-23 20:51:06 EDT (Sat, 23 Aug 2008)
@@ -548,8 +548,8 @@
 # The implementation of the 'lib' rule. Beyond standard syntax that rule allows
 # simplified: "lib a b c ;".
 #
-rule lib ( names + : sources * : requirements * : default-build *
- : usage-requirements * )
+rule lib ( names + : sources * : requirements * : default-build * :
+ usage-requirements * )
 {
     if $(names[2])
     {

Modified: trunk/tools/build/v2/tools/common.jam
==============================================================================
--- trunk/tools/build/v2/tools/common.jam (original)
+++ trunk/tools/build/v2/tools/common.jam 2008-08-23 20:51:06 EDT (Sat, 23 Aug 2008)
@@ -168,9 +168,9 @@
             if $(.had-unspecified-value.$(toolset).$(name))
             {
                 errors.user-error
- "$(toolset) initialization: parameter '$(name)' inconsistent" :
- "no value was specified in earlier initialization" :
- "an explicit value is specified now" ;
+ "$(toolset) initialization: parameter '$(name)'"
+ "inconsistent" : "no value was specified in earlier"
+ "initialization" : "an explicit value is specified now" ;
             }
             # The below logic is for intel compiler. It calls this rule with
             # 'intel-linux' and 'intel-win' as toolset, so we need to get the
@@ -200,9 +200,9 @@
             if $(.had-value.$(toolset).$(name))
             {
                 errors.user-error
- "$(toolset) initialization: parameter '$(name)' inconsistent" :
- "an explicit value was specified in an earlier initialization" :
- "no value is specified now" ;
+ "$(toolset) initialization: parameter '$(name)'"
+ "inconsistent" : "an explicit value was specified in an"
+ "earlier initialization" : "no value is specified now" ;
             }
             .had-unspecified-value.$(toolset).$(name) = true ;
         }
@@ -259,8 +259,8 @@
 # find the tool, a warning is issued. If 'path-last' is specified, PATH is
 # checked after 'additional-paths' when searching for 'tool'.
 #
-rule get-invocation-command-nodefault (
- toolset : tool : user-provided-command * : additional-paths * : path-last ? )
+rule get-invocation-command-nodefault ( toolset : tool :
+ user-provided-command * : additional-paths * : path-last ? )
 {
     local command ;
     if ! $(user-provided-command)
@@ -290,11 +290,11 @@
 # Same as get-invocation-command-nodefault, except that if no tool is found,
 # returns either the user-provided-command, if present, or the 'tool' parameter.
 #
-rule get-invocation-command (
- toolset : tool : user-provided-command * : additional-paths * : path-last ? )
+rule get-invocation-command ( toolset : tool : user-provided-command * :
+ additional-paths * : path-last ? )
 {
- local result = [ get-invocation-command-nodefault $(toolset) : $(tool)
- : $(user-provided-command) : $(additional-paths) : $(path-last) ] ;
+ local result = [ get-invocation-command-nodefault $(toolset) : $(tool) :
+ $(user-provided-command) : $(additional-paths) : $(path-last) ] ;
 
     if ! $(result)
     {
@@ -334,7 +334,7 @@
 # first path found. Otherwise, returns an empty string. If 'path-last' is
 # specified, PATH is searched after 'additional-paths'.
 #
-rule find-tool ( name : additional-paths * : path-last ? )
+local rule find-tool ( name : additional-paths * : path-last ? )
 {
     local path = [ path.programs-path ] ;
     local match = [ path.glob $(path) : $(name) $(name).exe ] ;
@@ -370,15 +370,16 @@
 # Checks if 'command' can be found either in path or is a full name to an
 # existing file.
 #
-rule check-tool-aux ( command )
+local rule check-tool-aux ( command )
 {
     if $(command:D)
     {
         if [ path.exists $(command) ]
             # Both NT and Cygwin will run .exe files by their unqualified names.
             || ( [ os.on-windows ] && [ path.exists $(command).exe ] )
- # Only NT will run .bat files by their unqualified names.
- || ( ( [ os.name ] = NT ) && [ path.exists $(command).bat ] )
+ # Only NT will run .bat & .cmd files by their unqualified names.
+ || ( ( [ os.name ] = NT ) && ( [ path.exists $(command).bat ] ||
+ [ path.exists $(command).cmd ] ) )
         {
             return $(command) ;
         }
@@ -397,7 +398,7 @@
 # path, checks if it can be found in 'path'. If comand is an absolute path,
 # check that it exists. Returns 'command' if ok or empty string otherwise.
 #
-rule check-tool ( xcommand + )
+local rule check-tool ( xcommand + )
 {
     if [ check-tool-aux $(xcommand[1]) ] ||
        [ check-tool-aux $(xcommand[-1]) ]

Modified: trunk/tools/build/v2/tools/intel-win.jam
==============================================================================
--- trunk/tools/build/v2/tools/intel-win.jam (original)
+++ trunk/tools/build/v2/tools/intel-win.jam 2008-08-23 20:51:06 EDT (Sat, 23 Aug 2008)
@@ -3,21 +3,19 @@
 # (See accompanying file LICENSE_1_0.txt
 # or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-import toolset ;
+# Importing common is needed because the rules we inherit here depend on it.
+# That is nasty.
+import common ;
+import errors ;
 import feature ;
-import toolset : flags ;
+import intel ;
+import msvc ;
 import os ;
-import errors ;
-
-# This is needed because the rule we import here depend on 'common'
-# That's nasty.
-import common ;
+import toolset ;
 
-import intel ;
 
 feature.extend-subfeature toolset intel : platform : win ;
 
-import msvc ;
 toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win : msvc ;
 toolset.inherit-flags intel-win : msvc ;
 toolset.inherit-rules intel-win : msvc ;
@@ -31,28 +29,28 @@
                             # either 'vc6', 'vc7', 'vc7.1'
                             # or 'native'(default).
           )
-{
- local compatibility =
+{
+ local compatibility =
       [ feature.get-values <compatibility> : $(options) ] ;
     local condition = [ common.check-init-parameters intel-win
         : version $(version) : compatibility $(compatibility) ] ;
-
+
     command = [ common.get-invocation-command intel-win : icl.exe :
- $(command) ] ;
-
+ $(command) ] ;
+
     common.handle-options intel-win : $(condition) : $(command) : $(options) ;
-
+
     local root ;
     if $(command)
     {
         root = [ common.get-absolute-tool-path $(command[-1]) ] ;
         root = $(root)/ ;
     }
-
+
     local setup ;
     setup = $(root)/iclvars.bat ;
     setup = "call \""$(setup)"\" > nul " ;
-
+
     if [ os.name ] = NT
     {
         setup = $(setup)"
@@ -62,52 +60,51 @@
     {
         setup = "cmd /S /C "$(setup)" \"&&\" " ;
     }
-
-
- flags intel-win.compile .CC $(condition) : $(setup)icl ;
- flags intel-win.link .LD $(condition) : $(setup)xilink ;
- flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ;
- flags intel-win.link .MT $(condition) : mt -nologo ;
-
+
+ toolset.flags intel-win.compile .CC $(condition) : $(setup)icl ;
+ toolset.flags intel-win.link .LD $(condition) : $(setup)xilink ;
+ toolset.flags intel-win.archive .LD $(condition) : $(setup)xilink /lib ;
+ toolset.flags intel-win.link .MT $(condition) : mt -nologo ;
+
     local m = [ MATCH (.).* : $(version) ] ;
     local major = $(m[1]) ;
 
     local C++FLAGS ;
-
+
     C++FLAGS += /nologo ;
-
+
     # Reduce the number of spurious error messages
     C++FLAGS += /Qwn5 /Qwd985 ;
 
     # Enable ADL
     C++FLAGS += -Qoption,c,--arg_dep_lookup ; #"c" works for C++, too
-
- # Disable Microsoft "secure" overloads in Dinkumware libraries
- # since they cause compile errors with Intel versions 9 and 10
+
+ # Disable Microsoft "secure" overloads in Dinkumware libraries since they
+ # cause compile errors with Intel versions 9 and 10.
     C++FLAGS += -D_SECURE_SCL=0 ;
 
     if $(major) > 5
     {
- C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping
+ C++FLAGS += /Zc:forScope ; # Add support for correct for loop scoping.
     }
 
- # Add options recognized only by intel7
+ # Add options recognized only by intel7 and above.
     if $(major) >= 7
     {
         C++FLAGS += /Qansi_alias ;
     }
-
+
     if $(compatibility) = vc6
     {
- C++FLAGS +=
+ C++FLAGS +=
           # Emulate VC6
           /Qvc6
-
- # no wchar_t support in vc6 dinkum library. Furthermore, in vc6
+
+ # No wchar_t support in vc6 dinkum library. Furthermore, in vc6
           # compatibility-mode, wchar_t is not a distinct type from unsigned
- # short
+ # short.
           -DBOOST_NO_INTRINSIC_WCHAR_T
- ;
+ ;
     }
     else
     {
@@ -119,21 +116,19 @@
               -D_NATIVE_WCHAR_T_DEFINED
               ;
         }
- }
-
-
+ }
+
     if $(compatibility) && $(compatibility) != native
- {
+ {
         C++FLAGS += /Q$(base-vc) ;
     }
- else
+ else
     {
- C++FLAGS +=
+ C++FLAGS +=
           -Qoption,cpp,--arg_dep_lookup
- # The following options were intended to disable
- # 'bug-emulation' mode of intel compiler, but later
- # were reported to case ICE with Intel-Win 9.0
- # It's not yet clear which options can be safely used.
+ # The following options were intended to disable the Intel compiler's
+ # 'bug-emulation' mode, but were later reported to be causing ICE with
+ # Intel-Win 9.0. It is not yet clear which options can be safely used.
           # -Qoption,cpp,--const_string_literals
           # -Qoption,cpp,--new_for_init
           # -Qoption,cpp,--no_implicit_typename
@@ -141,28 +136,26 @@
           # -Qoption,cpp,--no_microsoft_bugs
           ;
     }
-
- flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
-
+
+ toolset.flags intel-win CFLAGS $(condition) : $(C++FLAGS) ;
+
     if ! $(compatibility)
     {
         # If there's no backend version, assume 7.1.
         compatibility = vc7.1 ;
     }
-
+
     local extract-version = [ MATCH ^vc(.*) : $(compatibility) ] ;
     if ! $(extract-version)
     {
         errors.user-error "Invalid value for compatibility option:"
- $(compatibility) ;
+ $(compatibility) ;
     }
-
+
     # Depending on the settings, running of tests require some runtime DLLs.
- flags intel-win RUN_PATH $(condition) : $(root) ;
-
+ toolset.flags intel-win RUN_PATH $(condition) : $(root) ;
+
     msvc.configure-version-specific intel-win : $(extract-version[1]) : $(condition) ;
 }
 
-flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
-
-
+toolset.flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk