|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import os ; |
|
|
import modules ; |
|
|
import utility ; |
|
|
import print ; |
|
|
import type ; |
|
|
import feature ; |
|
|
import errors ; |
|
|
import path ; |
|
|
import sequence ; |
|
|
import toolset ; |
|
|
import virtual-target ; |
|
|
|
|
|
if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] |
|
|
{ |
|
|
.debug-configuration = true ; |
|
|
} |
|
|
if [ MATCH (--show-configuration) : [ modules.peek : ARGV ] ] |
|
|
{ |
|
|
.show-configuration = true ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class configurations |
|
|
{ |
|
|
import errors ; |
|
|
|
|
|
rule __init__ ( ) |
|
|
{ |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule register ( id ) |
|
|
{ |
|
|
if $(id) in $(self.used) |
|
|
{ |
|
|
errors.error "common: the configuration '$(id)' is in use" ; |
|
|
} |
|
|
|
|
|
local retval ; |
|
|
|
|
|
if ! $(id) in $(self.all) |
|
|
{ |
|
|
self.all += $(id) ; |
|
|
|
|
|
|
|
|
retval = true ; |
|
|
} |
|
|
|
|
|
return $(retval) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule use ( id ) |
|
|
{ |
|
|
if ! $(id) in $(self.all) |
|
|
{ |
|
|
errors.error "common: the configuration '$(id)' is not known" ; |
|
|
} |
|
|
|
|
|
local retval ; |
|
|
|
|
|
if ! $(id) in $(self.used) |
|
|
{ |
|
|
self.used += $(id) ; |
|
|
|
|
|
|
|
|
retval = true ; |
|
|
} |
|
|
|
|
|
return $(retval) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rule all ( ) |
|
|
{ |
|
|
return $(self.all) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rule used ( ) |
|
|
{ |
|
|
return $(self.used) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rule get ( id : param ) |
|
|
{ |
|
|
return $(self.$(param).$(id)) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rule set ( id : param : value * ) |
|
|
{ |
|
|
self.$(param).$(id) = $(value) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule check-init-parameters ( toolset requirement * : * ) |
|
|
{ |
|
|
local sig = $(toolset) ; |
|
|
local condition = <toolset>$(toolset) ; |
|
|
local subcondition ; |
|
|
for local index in 2 3 4 5 6 7 8 9 |
|
|
{ |
|
|
local name = $($(index)[1]) ; |
|
|
local value = $($(index)[2]) ; |
|
|
|
|
|
if $(value)-is-not-empty |
|
|
{ |
|
|
condition = $(condition)-$(value) ; |
|
|
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" ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local t = $(toolset) ; |
|
|
local m = [ MATCH ([^-]*)- : $(toolset) ] ; |
|
|
if $(m) |
|
|
{ |
|
|
t = $(m[1]) ; |
|
|
} |
|
|
if ! $(.had-value.$(toolset).$(name)) |
|
|
{ |
|
|
if ! $(.declared-subfeature.$(t).$(name)) |
|
|
{ |
|
|
feature.subfeature toolset $(t) : $(name) : : propagated ; |
|
|
.declared-subfeature.$(t).$(name) = true ; |
|
|
} |
|
|
.had-value.$(toolset).$(name) = true ; |
|
|
} |
|
|
feature.extend-subfeature toolset $(t) : $(name) : $(value) ; |
|
|
subcondition += <toolset-$(t):$(name)>$(value) ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
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" ; |
|
|
} |
|
|
.had-unspecified-value.$(toolset).$(name) = true ; |
|
|
} |
|
|
sig = $(sig)$(value:E="")- ; |
|
|
} |
|
|
if $(sig) in $(.all-signatures) |
|
|
{ |
|
|
local message = |
|
|
"duplicate initialization of $(toolset) with the following parameters: " ; |
|
|
for local index in 2 3 4 5 6 7 8 9 |
|
|
{ |
|
|
local p = $($(index)) ; |
|
|
if $(p) |
|
|
{ |
|
|
message += "$(p[1]) = $(p[2]:E=<unspecified>)" ; |
|
|
} |
|
|
} |
|
|
message += "previous initialization at $(.init-loc.$(sig))" ; |
|
|
errors.user-error |
|
|
$(message[1]) : $(message[2]) : $(message[3]) : $(message[4]) : |
|
|
$(message[5]) : $(message[6]) : $(message[7]) : $(message[8]) ; |
|
|
} |
|
|
.all-signatures += $(sig) ; |
|
|
.init-loc.$(sig) = [ errors.nearest-user-location ] ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if $(requirement) |
|
|
{ |
|
|
local r = <toolset>$(toolset) $(requirement) ; |
|
|
r = $(r:J=,) ; |
|
|
toolset.add-requirements $(r):$(subcondition) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
condition += $(requirement) ; |
|
|
|
|
|
if $(.show-configuration) |
|
|
{ |
|
|
ECHO notice: $(condition) ; |
|
|
} |
|
|
return $(condition:J=/) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule get-invocation-command-nodefault ( toolset : tool : |
|
|
user-provided-command * : additional-paths * : path-last ? ) |
|
|
{ |
|
|
local command ; |
|
|
if ! $(user-provided-command) |
|
|
{ |
|
|
command = [ find-tool $(tool) : $(additional-paths) : $(path-last) ] ; |
|
|
if ! $(command) && $(.debug-configuration) |
|
|
{ |
|
|
ECHO "warning: toolset $(toolset) initialization: can not find tool $(tool)" ; |
|
|
ECHO "warning: initialized from" [ errors.nearest-user-location ] ; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
command = [ check-tool $(user-provided-command) ] ; |
|
|
if ! $(command) && $(.debug-configuration) |
|
|
{ |
|
|
ECHO "warning: toolset $(toolset) initialization: " ; |
|
|
ECHO "warning: can not find user-provided command " '$(user-provided-command)' ; |
|
|
ECHO "warning: initialized from" [ errors.nearest-user-location ] ; |
|
|
} |
|
|
} |
|
|
|
|
|
return $(command) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) ] ; |
|
|
|
|
|
if ! $(result) |
|
|
{ |
|
|
if $(user-provided-command) |
|
|
{ |
|
|
result = $(user-provided-command) ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
result = $(tool) ; |
|
|
} |
|
|
} |
|
|
return $(result) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule get-absolute-tool-path ( command ) |
|
|
{ |
|
|
if $(command:D) |
|
|
{ |
|
|
return $(command:D) ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
local m = [ GLOB [ modules.peek : PATH Path path ] : $(command) $(command).exe ] ; |
|
|
return $(m[1]:D) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule find-tool ( name : additional-paths * : path-last ? ) |
|
|
{ |
|
|
local path = [ path.programs-path ] ; |
|
|
local match = [ path.glob $(path) : $(name) $(name).exe ] ; |
|
|
local additional-match = [ path.glob $(additional-paths) : $(name) $(name).exe ] ; |
|
|
|
|
|
local result ; |
|
|
if $(path-last) |
|
|
{ |
|
|
result = $(additional-match) ; |
|
|
if ! $(result) && $(match) |
|
|
{ |
|
|
result = $(name) ; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
if $(match) |
|
|
{ |
|
|
result = $(name) ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
result = $(additional-match) ; |
|
|
} |
|
|
} |
|
|
if $(result) |
|
|
{ |
|
|
return [ path.native $(result[1]) ] ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local rule check-tool-aux ( command ) |
|
|
{ |
|
|
if $(command:D) |
|
|
{ |
|
|
if [ path.exists $(command) ] |
|
|
|
|
|
|| ( [ os.on-windows ] && [ path.exists $(command).exe ] ) |
|
|
|
|
|
|| ( ( [ os.name ] = NT ) && ( [ path.exists $(command).bat ] || |
|
|
[ path.exists $(command).cmd ] ) ) |
|
|
{ |
|
|
return $(command) ; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
if [ GLOB [ modules.peek : PATH Path path ] : $(command) ] |
|
|
{ |
|
|
return $(command) ; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local rule check-tool ( xcommand + ) |
|
|
{ |
|
|
if [ check-tool-aux $(xcommand[1]) ] || |
|
|
[ check-tool-aux $(xcommand[-1]) ] |
|
|
{ |
|
|
return $(xcommand) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule handle-options ( toolset : condition * : command * : options * ) |
|
|
{ |
|
|
if $(.debug-configuration) |
|
|
{ |
|
|
ECHO "notice: will use '$(command)' for $(toolset), condition $(condition:E=(empty))" ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
toolset.flags $(toolset) CONFIG_COMMAND $(condition) : $(command) |
|
|
: unchecked ; |
|
|
|
|
|
toolset.flags $(toolset).compile OPTIONS $(condition) : |
|
|
[ feature.get-values <compileflags> : $(options) ] : unchecked ; |
|
|
|
|
|
toolset.flags $(toolset).compile.c OPTIONS $(condition) : |
|
|
[ feature.get-values <cflags> : $(options) ] : unchecked ; |
|
|
|
|
|
toolset.flags $(toolset).compile.c++ OPTIONS $(condition) : |
|
|
[ feature.get-values <cxxflags> : $(options) ] : unchecked ; |
|
|
|
|
|
toolset.flags $(toolset).compile.fortran OPTIONS $(condition) : |
|
|
[ feature.get-values <fflags> : $(options) ] : unchecked ; |
|
|
|
|
|
toolset.flags $(toolset).link OPTIONS $(condition) : |
|
|
[ feature.get-values <linkflags> : $(options) ] : unchecked ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule get-program-files-dir ( ) |
|
|
{ |
|
|
local ProgramFiles = [ modules.peek : ProgramFiles ] ; |
|
|
if $(ProgramFiles) |
|
|
{ |
|
|
ProgramFiles = "$(ProgramFiles:J= )" ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
ProgramFiles = "c:\\Program Files" ; |
|
|
} |
|
|
return $(ProgramFiles) ; |
|
|
} |
|
|
|
|
|
|
|
|
if [ os.name ] = NT |
|
|
{ |
|
|
RM = del /f /q ; |
|
|
CP = copy /b ; |
|
|
IGNORE = "2>nul >nul & setlocal" ; |
|
|
LN ?= $(CP) ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WINDOWS-CP-HACK = "+ this-file-does-not-exist-A698EE7806899E69" ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
RM = rm -f ; |
|
|
CP = cp ; |
|
|
LN = ln ; |
|
|
} |
|
|
|
|
|
|
|
|
rule rm-command ( ) |
|
|
{ |
|
|
return $(RM) ; |
|
|
} |
|
|
|
|
|
|
|
|
rule copy-command ( ) |
|
|
{ |
|
|
return $(CP) ; |
|
|
} |
|
|
|
|
|
|
|
|
if "\n" = "n" |
|
|
{ |
|
|
|
|
|
|
|
|
nl = " |
|
|
" ; |
|
|
q = "" ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
nl = "\n" ; |
|
|
q = "\"" ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule variable-setting-command ( variable : value ) |
|
|
{ |
|
|
if [ os.name ] = NT |
|
|
{ |
|
|
return "set $(variable)=$(value)$(nl)" ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "$(variable)=$(q)$(value)$(q)$(nl)export $(variable)$(nl)" ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule path-variable-setting-command ( variable : paths * ) |
|
|
{ |
|
|
local sep = [ os.path-separator ] ; |
|
|
return [ variable-setting-command $(variable) : $(paths:J=$(sep)) ] ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule prepend-path-variable-command ( variable : paths * ) |
|
|
{ |
|
|
return [ path-variable-setting-command $(variable) |
|
|
: $(paths) [ os.expand-variable $(variable) ] ] ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule file-creation-command ( ) |
|
|
{ |
|
|
if [ os.name ] = NT |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "echo. > " ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
return "touch " ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule file-touch-command ( ) |
|
|
{ |
|
|
if [ os.name ] = NT |
|
|
{ |
|
|
return "echo. >> " ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
return "touch " ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
rule MkDir |
|
|
{ |
|
|
|
|
|
NOUPDATE $(<) ; |
|
|
|
|
|
if $(<) != $(DOT) && ! $($(<)-mkdir) |
|
|
{ |
|
|
|
|
|
$(<)-mkdir = true ; |
|
|
|
|
|
|
|
|
common.mkdir $(<) ; |
|
|
|
|
|
|
|
|
|
|
|
DEPENDS dirs : $(<) ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local s = $(<:P) ; |
|
|
if [ os.name ] = NT |
|
|
{ |
|
|
switch $(s) |
|
|
{ |
|
|
case *: : s = ; |
|
|
case *:\\ : s = ; |
|
|
} |
|
|
} |
|
|
|
|
|
if $(s) |
|
|
{ |
|
|
if $(s) != $(<) |
|
|
{ |
|
|
DEPENDS $(<) : $(s) ; |
|
|
MkDir $(s) ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
NOTFILE $(s) ; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ os.name ] = NT |
|
|
{ |
|
|
actions mkdir |
|
|
{ |
|
|
if not exist "$(<)\\" mkdir "$(<)" |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
actions mkdir |
|
|
{ |
|
|
mkdir -p "$(<)" |
|
|
} |
|
|
} |
|
|
|
|
|
actions piecemeal together existing Clean |
|
|
{ |
|
|
$(RM) "$(>)" |
|
|
} |
|
|
|
|
|
|
|
|
rule copy |
|
|
{ |
|
|
} |
|
|
|
|
|
|
|
|
actions copy |
|
|
{ |
|
|
$(CP) "$(>)" $(WINDOWS-CP-HACK) "$(<)" |
|
|
} |
|
|
|
|
|
|
|
|
rule RmTemps |
|
|
{ |
|
|
} |
|
|
|
|
|
|
|
|
actions quietly updated piecemeal together RmTemps |
|
|
{ |
|
|
$(RM) "$(>)" $(IGNORE) |
|
|
} |
|
|
|
|
|
|
|
|
actions hard-link |
|
|
{ |
|
|
$(RM) "$(<)" 2$(NULL_OUT) $(NULL_OUT) |
|
|
$(LN) "$(>)" "$(<)" $(NULL_OUT) |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rule format-name ( format * : name : type ? : property-set ) |
|
|
{ |
|
|
local result = "" ; |
|
|
for local f in $(format) |
|
|
{ |
|
|
switch $(f:G) |
|
|
{ |
|
|
case <base> : |
|
|
result += $(name:B) ; |
|
|
|
|
|
case <toolset> : |
|
|
result += [ join-tag $(f:G=) : [ toolset-tag $(name) : $(type) : |
|
|
$(property-set) ] ] ; |
|
|
|
|
|
case <threading> : |
|
|
result += [ join-tag $(f:G=) : [ threading-tag $(name) : $(type) |
|
|
: $(property-set) ] ] ; |
|
|
|
|
|
case <runtime> : |
|
|
result += [ join-tag $(f:G=) : [ runtime-tag $(name) : $(type) : |
|
|
$(property-set) ] ] ; |
|
|
|
|
|
case <qt> : |
|
|
result += [ join-tag $(f:G=) : [ qt-tag $(name) : $(type) : |
|
|
$(property-set) ] ] ; |
|
|
|
|
|
case <address-model> : |
|
|
result += [ join-tag $(f:G=) : [ address-model-tag $(name) : $(type) : |
|
|
$(property-set) ] ] ; |
|
|
|
|
|
case <version:*> : |
|
|
local key = [ MATCH <version:(.*)> : $(f:G) ] ; |
|
|
local version = [ $(property-set).get <$(key)> ] ; |
|
|
version ?= $(key) ; |
|
|
version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)" : $(version) ] ; |
|
|
result += [ join-tag $(f:G=) : $(version[1])_$(version[2]) ] ; |
|
|
|
|
|
case <property:*> : |
|
|
local key = [ MATCH <property:(.*)> : $(f:G) ] ; |
|
|
local p0 = [ MATCH <($(key))> : [ $(property-set).raw ] ] ; |
|
|
if $(p0) |
|
|
{ |
|
|
local p = [ $(property-set).get <$(p0)> ] ; |
|
|
if $(p) |
|
|
{ |
|
|
result += [ join-tag $(f:G=) : $(p) ] ; |
|
|
} |
|
|
} |
|
|
|
|
|
case * : |
|
|
result += $(f:G=) ; |
|
|
} |
|
|
} |
|
|
result = [ virtual-target.add-prefix-and-suffix $(result:J=) : $(type) : |
|
|
$(property-set) ] ; |
|
|
return $(result) ; |
|
|
} |
|
|
|
|
|
|
|
|
local rule join-tag ( joiner ? : tag ? ) |
|
|
{ |
|
|
if ! $(joiner) { joiner = - ; } |
|
|
return $(joiner)$(tag) ; |
|
|
} |
|
|
|
|
|
|
|
|
local rule toolset-tag ( name : type ? : property-set ) |
|
|
{ |
|
|
local tag = ; |
|
|
|
|
|
local properties = [ $(property-set).raw ] ; |
|
|
switch [ $(property-set).get <toolset> ] |
|
|
{ |
|
|
case borland* : tag += bcb ; |
|
|
case clang* : |
|
|
{ |
|
|
switch [ $(property-set).get <toolset-clang:platform> ] |
|
|
{ |
|
|
case darwin : tag += clang-darwin ; |
|
|
case linux : tag += clang ; |
|
|
} |
|
|
} |
|
|
case como* : tag += como ; |
|
|
case cw : tag += cw ; |
|
|
case darwin* : tag += xgcc ; |
|
|
case edg* : tag += edg ; |
|
|
case gcc* : |
|
|
{ |
|
|
switch [ $(property-set).get <toolset-gcc:flavor> ] |
|
|
{ |
|
|
case *mingw* : tag += mgw ; |
|
|
case * : tag += gcc ; |
|
|
} |
|
|
} |
|
|
case intel : |
|
|
if [ $(property-set).get <toolset-intel:platform> ] = win |
|
|
{ |
|
|
tag += iw ; |
|
|
} |
|
|
else |
|
|
{ |
|
|
tag += il ; |
|
|
} |
|
|
case kcc* : tag += kcc ; |
|
|
case kylix* : tag += bck ; |
|
|
|
|
|
|
|
|
case mipspro* : tag += mp ; |
|
|
case msvc* : tag += vc ; |
|
|
case qcc* : tag += qcc ; |
|
|
case sun* : tag += sw ; |
|
|
case tru64cxx* : tag += tru ; |
|
|
case vacpp* : tag += xlc ; |
|
|
} |
|
|
local version = [ MATCH "<toolset.*version>([0123456789]+)[.]([0123456789]*)" |
|
|
: $(properties) ] ; |
|
|
|
|
|
if $(tag) = vc |
|
|
{ |
|
|
if $(version[1]) = 6 |
|
|
{ |
|
|
|
|
|
version = 6 ; |
|
|
} |
|
|
else if $(version[1]) = 7 && $(version[2]) = 0 |
|
|
{ |
|
|
version = 7 ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if $(tag) = iw |
|
|
{ |
|
|
version = ; |
|
|
} |
|
|
|
|
|
|
|
|
if $(tag) = bcb |
|
|
{ |
|
|
version = ; |
|
|
} |
|
|
|
|
|
tag += $(version) ; |
|
|
|
|
|
return $(tag:J=) ; |
|
|
} |
|
|
|
|
|
|
|
|
local rule threading-tag ( name : type ? : property-set ) |
|
|
{ |
|
|
local tag = ; |
|
|
local properties = [ $(property-set).raw ] ; |
|
|
if <threading>multi in $(properties) { tag = mt ; } |
|
|
|
|
|
return $(tag:J=) ; |
|
|
} |
|
|
|
|
|
|
|
|
local rule runtime-tag ( name : type ? : property-set ) |
|
|
{ |
|
|
local tag = ; |
|
|
|
|
|
local properties = [ $(property-set).raw ] ; |
|
|
if <runtime-link>static in $(properties) { tag += s ; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( <toolset>msvc in $(properties) ) || |
|
|
( <stdlib>stlport in $(properties) ) || |
|
|
( <toolset-intel:platform>win in $(properties) ) |
|
|
{ |
|
|
if <runtime-debugging>on in $(properties) { tag += g ; } |
|
|
} |
|
|
|
|
|
if <python-debugging>on in $(properties) { tag += y ; } |
|
|
if <variant>debug in $(properties) { tag += d ; } |
|
|
if <stdlib>stlport in $(properties) { tag += p ; } |
|
|
if <stdlib-stlport:iostream>hostios in $(properties) { tag += n ; } |
|
|
|
|
|
return $(tag:J=) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
local rule qt-tag ( name : type ? : property-set ) |
|
|
{ |
|
|
local properties = [ $(property-set).get <qt> ] ; |
|
|
local version = [ MATCH "([0123456789]+)[.]?([0123456789]*)[.]?([0123456789]*)" |
|
|
: $(properties) ] ; |
|
|
local tag = "qt"$(version:J=) ; |
|
|
return $(tag) ; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
local rule address-model-tag ( name : type ? : property-set ) |
|
|
{ |
|
|
local tag = ; |
|
|
local version = [ $(property-set).get <address-model> ] ; |
|
|
return $(version) ; |
|
|
} |
|
|
|
|
|
rule __test__ ( ) |
|
|
{ |
|
|
import assert ; |
|
|
|
|
|
local save-os = [ modules.peek os : .name ] ; |
|
|
|
|
|
modules.poke os : .name : LINUX ; |
|
|
|
|
|
assert.result "PATH=\"foo:bar:baz\"\nexport PATH\n" |
|
|
: path-variable-setting-command PATH : foo bar baz ; |
|
|
|
|
|
assert.result "PATH=\"foo:bar:$PATH\"\nexport PATH\n" |
|
|
: prepend-path-variable-command PATH : foo bar ; |
|
|
|
|
|
modules.poke os : .name : NT ; |
|
|
|
|
|
assert.result "set PATH=foo;bar;baz\n" |
|
|
: path-variable-setting-command PATH : foo bar baz ; |
|
|
|
|
|
assert.result "set PATH=foo;bar;%PATH%\n" |
|
|
: prepend-path-variable-command PATH : foo bar ; |
|
|
|
|
|
modules.poke os : .name : $(save-os) ; |
|
|
} |
|
|
|