|
Boost-Build : |
From: Robert Ramey (Ramey_at_[hidden])
Date: 2005-01-23 02:06:47
I would like to checkin the following changes to
tools/build/v1/boost-base.jam.
These are necessary in order to avoid build errors when I flow the advice in
http://lists.boost.org/MailArchives/boost/msg70153.php
and include the following in the Jamfile for the serialization library
build:
# certain tool sets are known apriori not to support wide char i/o
rule wide-char-io-support ( toolset variant : properties * )
{
switch $(toolset) {
case "como*" :
properties += <build>no ;
case "mingw*" :
properties += <build>no ;
case "cw*" : # codewarrior only supports wide characters in the static
version
}
return $(properties) ;
}
I've made the changes on my local system and things work fine. However, I'm
not too comfortable meddling in boost-base.jam without some adult
supervision. If no one sees any thing wrong with this, I will check it in
in a day or so.
Robert Ramey
Here are the changes marked with >>
# find-compatible-subvariant main-target : toolset variant :
dependent-simple-properties
rule find-compatible-subvariant ( main-target : toolset variant :
dependent-simple-properties * )
{
# calculate the subvariant only of what is requested
# the subvariant requested...
local sv-request =
[ multiply-property-sets
[ get-properties $(BUILD:G) : $(dependent-simple-properties) ] ]
;
# the available build requests...
local build-requests =
[ multiply-property-sets [ select-gristed $(BUILD) ] ] ;
# the build requst we want to build...
local sv-build =
[ intersection $(sv-request) : $(build-requests) ] ;
sv-build ?= "" ;
local BUILD = $(variant) [ split-path $(sv-build) ] ;
local gTARGET_DEFAULT_BUILD($(main-target)) = ;
# the full subvariant to build...
local subvariant = [ expand-target-subvariants $(main-target) :
$(variant) : $(toolset) ] ;
>> if $(subvariant) {
local sv-target = ; local sv-properties = ; local sv-toolset = ;
local sv-variant = ;
split-target-subvariant sv-target sv-properties sv-toolset
sv-variant : $(subvariant) ;
local sv-overrides =
[ difference $(dependent-simple-properties) : [ select-gristed
$(sv-properties) ] ] ;
sv-overrides +=
[ get-properties
[ difference $(dependent-simple-properties:G) :
$(sv-overrides:G) ] : $(sv-properties) ] ;
if ! $(gTARGET_TYPE($(main-target)))
{
EXIT unknown dependent target $(main-target) ;
}
# check to make sure we can link against the subvariant
local target-requirements
= [ select-gristed $(gTARGET_REQUIREMENTS($(main-target))) ] ;
local override-conflicts
= [ get-properties $(target-requirements:G) $(gALWAYS_RELEVANT)
: $(sv-overrides) ] ;
for local sv-override in $(override-conflicts)
{
local sv-required = [ get-values $(sv-override:G) :
$(sv-properties) ] ;
if $(sv-override:G=) != $(sv-required) &&
! [ is-link-compatible $(sv-override:G) : $(sv-override:G=)
: $(sv-required) ]
{
EXIT $(main-target): required property
$(sv-override:G)$(sv-required)
incompatible with $(sv-override) ;
}
}
# now that we have a mostly (or completely) compatible subvariant do
the overrides
local gTARGET_REQUIREMENTS($(main-target)) =
# property rules...
[ select-ungristed $(gTARGET_REQUIREMENTS($(main-target))) ]
# always relevant properties to target...
[ difference
$(target-requirements) :
[ get-properties [ difference $(sv-overrides:G) :
$(gALWAYS_RELEVANT) ] : $(target-requirements) ] ]
# link compatible properties, on the target...
[ get-properties
[ difference $(sv-overrides:G) : $(gALWAYS_RELEVANT) ] :
$(target-requirements) ]
# overrides from dependent...
[ get-properties
[ difference $(sv-overrides:G) : $(override-conflicts:G) ] :
$(dependent-simple-properties) ]
;
subvariant = [ expand-target-subvariants $(sv-target) :
$(sv-variant) : $(sv-toolset) ] ;
split-target-subvariant sv-target sv-properties sv-toolset
sv-variant : $(subvariant) ;
return $(sv-properties) ;
>> }
}
# For each target specified in libs, generate build instructions
# for a subvariant that can be linked with a dependent target with
# dependent-properties, returning a list of all generated targets.
rule link-libraries ( libs * : toolset variant : dependent-simple-properties
* )
{
local lib-path result ;
for lib-path in $(libs)
{
local lib-path = [ target-path-of $(lib-path) ] ;
local lib-target = [ target-id-of $(lib-path) ] ;
# Enter the dependee subproject
local [ protect-subproject ] ;
enter-subproject [ directory-of $(lib-path) ] ;
local lib-subvariant = [
find-compatible-subvariant $(lib-target)
: $(toolset) $(variant)
: $(dependent-simple-properties) ] ;
# Generate build instructions for the library target
>> if $(lib-subvariant) {
result += [ subvariant-target $(lib-target) :
$(lib-subvariant) : $(toolset) $(variant) ] ;
>> }
}
return $(result) ;
}
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk