|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import targets |
|
import errors |
|
import targets |
|
import sequence |
|
import property |
|
import property-set |
|
import "class" : new |
|
import common |
|
import path |
|
|
|
rule log-summary ( ) |
|
{ |
|
|
|
} |
|
|
|
.width = 30 |
|
|
|
rule set-width ( width ) |
|
{ |
|
.width = $(width) |
|
} |
|
|
|
|
|
rule register-components ( components * ) |
|
{ |
|
.components += $(components) |
|
} |
|
|
|
|
|
|
|
rule components-building ( components * ) |
|
{ |
|
.built-components += $(components) |
|
} |
|
|
|
|
|
|
|
rule log-component-configuration ( component : message ) |
|
{ |
|
|
|
.component-logs.$(component) += $(message) |
|
} |
|
|
|
|
|
|
|
rule log-check-result ( result ) |
|
{ |
|
if ! $(.announced-checks) |
|
{ |
|
ECHO "Performing configuration checks\n" |
|
.announced-checks = 1 |
|
} |
|
|
|
ECHO $(result) |
|
|
|
} |
|
|
|
rule log-library-search-result ( library : result ) |
|
{ |
|
local x = [ PAD " - $(library) : $(result)" : $(.width) ] |
|
log-check-result "$(x)" |
|
} |
|
|
|
rule print-component-configuration ( ) |
|
{ |
|
local c = [ sequence.unique $(.components) ] |
|
|
|
ECHO "\nComponent configuration:\n" |
|
for c in $(.components) |
|
{ |
|
local s |
|
if $(c) in $(.built-components) |
|
{ |
|
s = "building" |
|
} |
|
else |
|
{ |
|
s = "not building" |
|
} |
|
ECHO [ PAD " - $(c)" : $(.width) ] ": $(s)" |
|
for local m in $(.component-logs.$(c)) |
|
{ |
|
ECHO " -" $(m) |
|
} |
|
} |
|
ECHO |
|
} |
|
|
|
rule print-configure-checks-summary ( ) |
|
{ |
|
|
|
|
|
|
|
|
|
if $(.check-results) |
|
{ |
|
ECHO "Configuration checks summary\n" |
|
|
|
for local r in $(.check-results) |
|
{ |
|
ECHO $(r) |
|
} |
|
ECHO |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
rule builds-raw ( metatarget-reference : project : ps : what : retry ? ) |
|
{ |
|
local result |
|
|
|
if ! $(retry) && ! $(.$(what)-tested.$(ps)) |
|
{ |
|
.$(what)-tested.$(ps) = true |
|
|
|
local targets = [ targets.generate-from-reference |
|
$(metatarget-reference) : $(project) : $(ps) ] |
|
|
|
local jam-targets |
|
for local t in $(targets[2-]) |
|
{ |
|
jam-targets += [ $(t).actualize ] |
|
} |
|
|
|
if ! UPDATE_NOW in [ RULENAMES ] |
|
{ |
|
|
|
} |
|
else |
|
{ |
|
local x = [ PAD " - $(what)" : $(.width) ] |
|
if [ UPDATE_NOW $(jam-targets) : |
|
$(.log-fd) : ignore-minus-n : ignore-minus-q ] |
|
{ |
|
.$(what)-supported.$(ps) = yes |
|
result = true |
|
log-check-result "$(x) : yes" |
|
} |
|
else |
|
{ |
|
log-check-result "$(x) : no" |
|
} |
|
} |
|
return $(result) |
|
} |
|
else |
|
{ |
|
return $(.$(what)-supported.$(ps)) |
|
} |
|
} |
|
|
|
rule builds ( metatarget-reference : properties * : what ? : retry ? ) |
|
{ |
|
what ?= "$(metatarget-reference) builds" |
|
|
|
|
|
|
|
local toolset = [ property.select <toolset> : $(properties) ] |
|
local toolset-version-property = "<toolset-$(toolset:G=):version>" |
|
local relevant = [ property.select <target-os> <toolset> $(toolset-version-property) |
|
<address-model> <architecture> |
|
: $(properties) ] |
|
local ps = [ property-set.create $(relevant) ] |
|
local t = [ targets.current ] |
|
local p = [ $(t).project ] |
|
|
|
return [ builds-raw $(metatarget-reference) : $(p) : $(ps) : $(what) : $(retry) ] |
|
} |
|
|
|
|
|
|
|
|
|
|
|
rule set-log-file ( log-file ) |
|
{ |
|
path.makedirs [ path.parent $(log-file) ] |
|
|
|
.log-fd = [ FILE_OPEN $(log-file) : "w" ] |
|
} |
|
|
|
|
|
|
|
class check-target-builds-worker |
|
{ |
|
import configure |
|
import property-set |
|
import targets |
|
import property |
|
|
|
rule __init__ ( target message ? : true-properties * : false-properties * ) |
|
{ |
|
self.target = $(target) |
|
self.message = $(message) |
|
self.true-properties = $(true-properties) |
|
self.false-properties = $(false-properties) |
|
} |
|
|
|
rule check ( properties * ) |
|
{ |
|
local choosen |
|
if [ configure.builds $(self.target) : $(properties) : $(self.message) ] |
|
{ |
|
choosen = $(self.true-properties) |
|
} |
|
else |
|
{ |
|
choosen = $(self.false-properties) |
|
} |
|
return [ property.evaluate-conditionals-in-context $(choosen) : $(properties) ] |
|
} |
|
} |
|
|
|
|
|
rule check-target-builds ( target message ? : true-properties * : false-properties * ) |
|
{ |
|
local instance = [ new check-target-builds-worker $(target) $(message) : $(true-properties) |
|
: $(false-properties) ] |
|
return <conditional>@$(instance).check |
|
} |
|
|
|
IMPORT $(__name__) : check-target-builds : : check-target-builds |
|
|
|
|
|
|