2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-14 00:32:11 +00:00

Allow each toolset to accept multielement command. Each element will be

individually quoted, and check-for-existance will be applied only to
the first element.


[SVN r23246]
This commit is contained in:
Vladimir Prus
2004-06-29 06:21:21 +00:00
parent 07f6065611
commit 581a348dca
8 changed files with 29 additions and 35 deletions

View File

@@ -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/ ;

View File

@@ -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) ;
}
}
}

View File

@@ -23,7 +23,7 @@ toolset.inherit-rules darwin : gcc ;
flags darwin.link ST_OPTIONS <debug-symbols>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) ] ;

View File

@@ -28,7 +28,7 @@ type.set-generated-target-suffix STATIC_LIB : <toolset>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) ] ;

View File

@@ -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 <inlining>full : "-Ob2" ;
flags intel-linux.compile OPTIONS <optimization>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)
}

View File

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

View File

@@ -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) ;

View File

@@ -21,7 +21,7 @@ feature.compose <stdlib>sun-stlport
: <cxxflags>-library=stlport4 <linkflags>-library=stlport4
;
rule init ( version ? : command ? )
rule init ( version ? : command * )
{
local condition = [
common.check-init-parameters sun : version $(version) ] ;