diff --git a/src/tools/borland.jam b/src/tools/borland.jam index a444c35dc..1b2dce884 100644 --- a/src/tools/borland.jam +++ b/src/tools/borland.jam @@ -18,7 +18,7 @@ import common ; toolset.register borland ; -rule init ( version ? : command ? ) +rule init ( version ? : command * ) { local condition = [ common.check-init-parameters borland : version $(version) ] ; @@ -26,7 +26,7 @@ rule init ( version ? : command ? ) local command = [ common.get-invocation-command borland : bcc32.exe : $(command) ] ; - local root = [ common.get-absolute-tool-path $(command) ] ; + local root = [ common.get-absolute-tool-path $(command[-1]) ] ; root = $(root:D) ; toolset.flags borland.compile STDHDRS $(condition) : $(root)/include/ ; diff --git a/src/tools/common.jam b/src/tools/common.jam index 6e2ca5f6e..10c9450e2 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -110,7 +110,7 @@ rule check-init-parameters ( toolset : * ) # This rule returns the command to be used when invoking the tool. If we can't # find the tool, a warning is issued. rule get-invocation-command ( - toolset : tool : user-provided-command ? : additional-paths * ) + toolset : tool : user-provided-command * : additional-paths * ) { local command ; if ! $(user-provided-command) @@ -119,7 +119,7 @@ rule get-invocation-command ( } else { - command = [ common.check-tool $(user-provided-command) ] ; + command = [ common.check-tool $(user-provided-command) ] ; } if ! $(command) { @@ -132,7 +132,7 @@ rule get-invocation-command ( return $(command) ; } -# Given an invocation command returned by 'get-invocation-command', +# Given an invocation command, # return the absolute path to the command. This works even if commnad # has not path element and is present in PATH. rule get-absolute-tool-path ( command ) @@ -172,20 +172,21 @@ rule find-tool ( name : additional-paths * ) # If command is not an absolute path, checks if it can be found in 'path'. # If comand is absolute path, check that it exists. Returns 'command' # if ok and empty string otherwise. -rule check-tool ( command ) +rule check-tool ( xcommand + ) { + local command = $(xcommand[1]) ; if $(command:D) { if [ path.exists $(command) ] { - return $(command) ; + return $(xcommand) ; } } else { if [ GLOB [ modules.peek : PATH Path path ] : $(command) ] { - return $(command) ; + return $(xcommand) ; } } } diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index 9724b9b13..f25e8ecec 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -23,7 +23,7 @@ toolset.inherit-rules darwin : gcc ; flags darwin.link ST_OPTIONS off : -s ; # No additional initialization should be necessary -rule init ( version ? : command ? ) +rule init ( version ? : command * ) { local condition = [ common.check-init-parameters darwin : version $(version) ] ; local command = [ common.get-invocation-command darwin : g++ : $(command) ] ; diff --git a/src/tools/gcc.jam b/src/tools/gcc.jam index 5f957e3a9..806ff166d 100644 --- a/src/tools/gcc.jam +++ b/src/tools/gcc.jam @@ -28,7 +28,7 @@ type.set-generated-target-suffix STATIC_LIB : gcc : a ; # Initializes the gcc toolset # The name parameter specifies the name used to invoke the compiler, and # can be absolute. -rule init ( version ? : command ? ) +rule init ( version ? : command * ) { local condition = [ common.check-init-parameters gcc : version $(version) ] ; diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index e6ab9cbb9..27dd25b64 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -25,15 +25,15 @@ toolset.inherit-rules intel-linux : gcc ; # version in mandatory # name (default icc) is used to invoke the specified intellinux complier # compile and link options allow you to specify addition command line options for each version -rule init ( version ? : name ? : compile_options * : link_options * ) +rule init ( version ? : command * : compile_options * : link_options * ) { local condition = [ common.check-init-parameters intel-linux : version $(version) ] ; name = [ common.get-invocation-command intel-linux : icc - : $(name) : /opt/intel_cc_80/bin ] ; + : $(command) : /opt/intel_cc_80/bin ] ; - flags intel-linux CONFIG_NAME $(condition) : $(name) ; + flags intel-linux CONFIG_COMMAND $(condition) : $(command) ; flags intel-linux CONFIG_COMPILE $(condition) : $(compile_options) ; flags intel-linux CONFIG_LINK $(condition) : $(link_options) ; } @@ -44,21 +44,21 @@ flags intel-linux.compile OPTIONS full : "-Ob2" ; flags intel-linux.compile OPTIONS space : "-O1" ; # no specific space optimization flag in icc actions compile.c++ { - $(CONFIG_NAME) -c -xc++ $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc++ $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } actions compile.c { - $(CONFIG_NAME) -c -xc $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } actions link bind LIBRARIES { - $(CONFIG_NAME) $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) + "$(CONFIG_COMMAND)" $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) } # Differ from 'link' above only by -shared. actions link.dll bind LIBRARIES { - $(CONFIG_NAME) $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) + "$(CONFIG_COMMAND)" $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) } diff --git a/src/tools/intel-win.jam b/src/tools/intel-win.jam index 2e191a572..16fe445e5 100644 --- a/src/tools/intel-win.jam +++ b/src/tools/intel-win.jam @@ -23,7 +23,7 @@ toolset.inherit-rules intel-win : msvc ; # Initializes the intel toolset for windows rule init ( version ? : # the compiler version - command ? : # the command to invoke the compiler itself + command * : # the command to invoke the compiler itself compatibility ? # Compatibility mode: either 'vc6', 'vc7', 'vc7.1' # or 'native'(default). ) @@ -34,30 +34,23 @@ rule init ( version ? : # the compiler version command = [ common.get-invocation-command intel-win : icc.exe : $(command) ] ; + local root = [ common.get-absolute-tool-path $(command[-1]) ] ;) local setup ; - if $(command:D) - { - setup = $(command:D)/iclvars.bat ; - setup = "call \""$(setup)"\" > nul " ; + setup = $(root:D)/iclvars.bat ; + setup = "call \""$(setup)"\" > nul " ; - if [ os.name ] = NT - { - setup = $(setup)" + if [ os.name ] = NT + { + setup = $(setup)" " ; - } - else - { - setup = "cmd /S /C "$(setup)" \"&&\" " ; - } } else { - setup = "" ; + 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 ; diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 3c4610a09..e0f9645e1 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -57,7 +57,7 @@ feature.subfeature toolset msvc : vendor rule init ( version ? # the msvc version which is being configured. When omitted # the tools invoked when no explicit version is given will be configured. - : command ? + : command * # the command to invoke the compiler. If not specified: # - if version is given, default location for that version will be searched # @@ -82,7 +82,7 @@ rule init ( if $(command) { - command = [ common.get-absolute-tool-path $(command) ] ; + command = [ common.get-absolute-tool-path $(command[-1]) ] ; } local root = $(command:D) ; diff --git a/src/tools/sun.jam b/src/tools/sun.jam index 8377cb51b..47d194c9f 100644 --- a/src/tools/sun.jam +++ b/src/tools/sun.jam @@ -21,7 +21,7 @@ feature.compose sun-stlport : -library=stlport4 -library=stlport4 ; -rule init ( version ? : command ? ) +rule init ( version ? : command * ) { local condition = [ common.check-init-parameters sun : version $(version) ] ;