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

Boost Build cleanup - minor stylistic changes. Added some FIXME comments.

[SVN r79176]
This commit is contained in:
Jurko Gospodnetić
2012-06-29 19:20:56 +00:00
parent c48a0c9ddc
commit 8f021f4bfc
2 changed files with 86 additions and 77 deletions

View File

@@ -719,14 +719,14 @@ local rule should-clean-project ( project )
generators.dump ;
}
# We wish to put config.log in the build directory corresponding
# to Jamroot, so that the location does not differ depending on
# directory where we do build. The amount of indirection necessary
# here is scary.
# We wish to put config.log in the build directory corresponding to Jamroot,
# so that the location does not differ depending on the directory we run the
# build from. The amount of indirection necessary here is scary.
local first-project = [ $(targets[0]).project ] ;
local first-project-root-location = [ $(first-project).get project-root ] ;
local first-project-root-module = [ project.load $(first-project-root-location) ] ;
local first-project-root = [ project.target $(first-project-root-module) ] ;
local first-project-root-module = [ project.load
$(first-project-root-location) ] ;
local first-project-root = [ project.target $(first-project-root-module) ] ;
local first-build-build-dir = [ $(first-project-root).build-dir ] ;
configure.set-log-file $(first-build-build-dir)/config.log ;

View File

@@ -6,25 +6,23 @@
# This module defines function to help with two main tasks:
#
# - Discovering build-time configuration for the purposes of adjusting
# build process.
# - Discovering build-time configuration for the purposes of adjusting the build
# process.
# - Reporting what is built, and how it is configured.
import targets ;
import errors ;
import targets ;
import sequence ;
import property ;
import property-set ;
import "class" : new ;
import common ;
import path ;
import property ;
import property-set ;
import targets ;
rule log-summary ( )
{
}
.width = 30 ;
rule set-width ( width )
@@ -32,29 +30,33 @@ rule set-width ( width )
.width = $(width) ;
}
# Declare that the components specified by the parameter exist.
#
rule register-components ( components * )
{
.components += $(components) ;
}
# Declare that the components specified by the parameters will
# be build.
# Declare that the components specified by the parameters will be built.
#
rule components-building ( components * )
{
.built-components += $(components) ;
}
# Report something about component configuration that the
# user should better know.
# Report something about component configuration that the user should better
# know.
#
rule log-component-configuration ( component : message )
{
# FIXME: implement per-property-set logs
# FIXME: Implement per-property-set logs.
.component-logs.$(component) += $(message) ;
}
rule log-check-result ( result )
{
if ! $(.announced-checks)
@@ -62,22 +64,27 @@ rule log-check-result ( result )
ECHO "Performing configuration checks\n" ;
.announced-checks = 1 ;
}
ECHO $(result) ;
ECHO $(result) ;
# FIXME: Unfinished code. Nothing seems to set .check-results at the moment.
#.check-results += $(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) ] ;
# FIXME: See what was intended with this initial assignment.
# local c = [ sequence.unique $(.components) ] ;
ECHO "\nComponent configuration:\n" ;
local c ;
for c in $(.components)
{
local s ;
@@ -93,70 +100,70 @@ rule print-component-configuration ( )
for local m in $(.component-logs.$(c))
{
ECHO " -" $(m) ;
}
}
}
ECHO ;
}
rule print-configure-checks-summary ( )
{
# FIXME: the problem with that approach is tha
# the user sees checks summary when all checks are
# done, and has no progress reporting while the
# checks are being executed.
# FIXME: The problem with this approach is that the user sees the checks
# summary when all checks are done, and has no progress reporting while the
# checks are being executed.
if $(.check-results)
{
{
ECHO "Configuration checks summary\n" ;
for local r in $(.check-results)
{
ECHO $(r) ;
}
ECHO ;
}
}
}
# Attempt to build a metatarget named by 'metatarget-reference'
# in context of 'project' with properties 'ps'.
# Returns non-empty value if build is OK.
# 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
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 ]
{
# Cannot determine. Assume existance.
# Cannot determine. Assume existence.
}
else
{
local x = [ PAD " - $(what)" : $(.width) ] ;
else
{
local x = [ PAD " - $(what)" : $(.width) ] ;
if [ UPDATE_NOW $(jam-targets) :
$(.log-fd) : ignore-minus-n : ignore-minus-q ]
$(.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)) ;
@@ -166,32 +173,33 @@ rule builds-raw ( metatarget-reference : project : ps : what : retry ? )
rule builds ( metatarget-reference : properties * : what ? : retry ? )
{
what ?= "$(metatarget-reference) builds" ;
# FIXME: this should not be hardcoded. Other checks might
# want to consider different set of features as relevant.
# FIXME: This should not be hardcoded. Other checks might want to consider a
# different set of features as relevant.
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 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) ] ;
return [ builds-raw $(metatarget-reference) : $(p) : $(ps) : $(what) :
$(retry) ] ;
}
# Called by Boost.Build startup code to specify name of a file
# that will receive results of configure checks. This
# should never be called by users.
# Called by Boost.Build startup code to specify the file to receive the
# configuration check results. Should never be called by user code.
#
rule set-log-file ( log-file )
{
path.makedirs [ path.parent $(log-file) ] ;
.log-fd = [ FILE_OPEN $(log-file) : "w" ] ;
}
# Frontend rules
class check-target-builds-worker
@@ -199,39 +207,40 @@ class check-target-builds-worker
import configure ;
import property-set ;
import targets ;
import property ;
rule __init__ ( target message ? : true-properties * : false-properties * )
import property ;
rule __init__ ( target message ? : true-properties * : false-properties * )
{
self.target = $(target) ;
self.message = $(message) ;
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) ] ;
}
}
return [ property.evaluate-conditionals-in-context $(choosen) :
$(properties) ] ;
}
}
rule check-target-builds ( target message ? : true-properties * : false-properties * )
rule check-target-builds ( target message ? : true-properties * :
false-properties * )
{
local instance = [ new check-target-builds-worker $(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 ;