diff --git a/v2/build/configure.jam b/v2/build/configure.jam index 66b81b3..9b26e04 100644 --- a/v2/build/configure.jam +++ b/v2/build/configure.jam @@ -123,76 +123,87 @@ rule print-configure-checks-summary ( ) } } - -# Attempt to build a metatarget named by 'metatarget-reference' in context of -# 'project' with properties 'ps'. Returns non-empty value if build is OK. -# -rule builds-raw ( metatarget-reference : project : ps : what : retry ? ) +# Attempts to build a set of virtual targets +rule try-build ( targets * : ps : what : retry ? ) { + local cache-name = $(what) [ $(ps).raw ] ; + cache-name = $(cache-name:J=-) ; + local value = [ config-cache.get $(cache-name) ] ; + local result ; + local jam-targets ; - if ! $(retry) && ! $(.$(what)-tested.$(ps)) + for local t in $(targets[2-]) { - .$(what)-tested.$(ps) = true ; - - local cache-name = $(what) [ $(ps).raw ] ; - cache-name = $(cache-name:J=-) ; - local value = [ config-cache.get $(cache-name) ] ; - - local targets = [ targets.generate-from-reference - $(metatarget-reference) : $(project) : $(ps) ] ; - - local jam-targets ; - for local t in $(targets[2-]) + jam-targets += [ $(t).actualize ] ; + } + + if $(value) + { + local x = [ PAD " - $(what)" : $(.width) ] ; + if $(value) = true { - jam-targets += [ $(t).actualize ] ; + .$(what)-supported.$(ps) = yes ; + result = true ; + log-check-result "$(x) : yes (cached)" ; } - - if $(value) + else { - local x = [ PAD " - $(what)" : $(.width) ] ; - if $(value) = true - { - .$(what)-supported.$(ps) = yes ; - result = true ; - log-check-result "$(x) : yes (cached)" ; - } - else - { - log-check-result "$(x) : no (cached)" ; - } - } - else if ! UPDATE_NOW in [ RULENAMES ] + log-check-result "$(x) : no (cached)" ; + } + } + else if ! UPDATE_NOW in [ RULENAMES ] + { + # Cannot determine. Assume existance. + } + else + { + local x = [ PAD " - $(what)" : $(.width) ] ; + if [ UPDATE_NOW $(jam-targets) : + $(.log-fd) : ignore-minus-n : ignore-minus-q ] { - # Cannot determine. Assume existance. + .$(what)-supported.$(ps) = yes ; + result = true ; + log-check-result "$(x) : yes" ; } 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" ; - } + log-check-result "$(x) : no" ; + } + } + if ! $(value) + { + if $(result) + { + config-cache.set $(cache-name) : true ; } - if ! $(value) + else { - if $(result) - { - config-cache.set $(cache-name) : true ; - } - else - { - config-cache.set $(cache-name) : false ; - } - } + config-cache.set $(cache-name) : false ; + } + } + return $(result) ; +} + +# Attempt to build a metatarget named by 'metatarget-reference' +# in context of 'project' with properties 'ps'. +# Returns non-empty value if build is OK. +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) ] ; + + result = [ try-build $(targets[2-]) : $(ps) : $(what) : $(retry) ] ; + .$(what)-supported.$(ps) = $(result) ; + return $(result) ; + } else { diff --git a/v2/tools/link.jam b/v2/tools/link.jam index e604b12..b334e47 100644 --- a/v2/tools/link.jam +++ b/v2/tools/link.jam @@ -10,6 +10,7 @@ import virtual-target ; import configure ; import path ; import property ; +import property-set ; import common ; rule get-root-project ( project ) @@ -44,7 +45,9 @@ rule can-symlink ( project ) local target = [ new file-target test-symlink : : $(project) : [ new action $(source-target) : link.mklink ] ] ; - if [ configure.try-build $(target) : "symlinks supported" ] + local ps = [ property-set.create $(empty) ] ; + + if [ configure.try-build $(target) : $(ps) : "symlinks supported" ] { .can-symlink = true ; }