Boost logo

Boost-Build :

From: David Abrahams (gclbb-jamboost_at_[hidden])
Date: 2003-06-06 07:25:07


David Abrahams <gclbb-jamboost_at_[hidden]> writes:

> Vladimir Prus <ghost_at_[hidden]> writes:
>
>> In the current system you can describe it by creating a generator STATIC_DATA
>> <- ECPP, which will
>> 1. Create CPP from ECPP by recursive call to 'generators.construct'.
>> 2. Take a first CPP and convert it to NM_ASM by another call to
>> 'generators.construct'.
>> 3. Convert NM_ASM to STATIC_DATA
>> 4. Return STATIC_DATA and the second CPP
>>
>> If you take a look at Jamfile for part of this example, still at
>> http://zigzag.cs.msu.su:7813/Jamfile.v2
>> you'll notice similiar approach.
>
> Looking again, I think I understand you a little better. I think
> that sort of thing is easily handle-able at the top level, without
> intruding on the generator algorithm, but I'll have to look more
> closely.

I'm looking more closely, but failing to understand clearly what's
going on. What does "convert-multiple-sources-to-consumable-types"
do, exactly? The name is descriptive but it doesn't tell the whole
story and there's no comment. Also:

# Converts several files to consumable types.
rule convert-multiple-sources-to-consumable-types
( project : property-set : sources * : consumed-var bypassed-var )
{
# We process each source one-by-one, trying to convert it to
# a usable type.
local failed ;
while $(sources) && ! $(failed)
{
local _c ;
local _b ;
# TODO: need to check for failure on each source.
convert-to-consumable-types $(project) : $(property-set)
: $(sources[1]) : * : true : _c _b ;
if ! $(_c)
{
generators.dout [ indent ] " failed to convert " [ $(sources[1]).str ] ;
# failed = true ;
}
$(consumed-var) += $(_c) ;
$(bypassed-var) += $(_b) ;
sources = $(sources[2-]) ;
}
if $(failed)
{
$(consumed-var) = ;
$(bypassed-var) = ;
}
}

Can we just eliminate the "failed" variable? It doesn't seem to do
anything.

>From what I can see, your generator tries to convert all sources to
CPP, LIB, and STATIC_DATA, then it explicitly takes all the
STATIC_DATA it found and tries to convert it to a single CPP, then it
combines that with the other non-STATIC_DATA sources to build an EXE.

I believe all this is compatible with my search procedure, actually.
Details in a follow-up, if neccessary.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

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