Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-01-17 10:15:22


David Abrahams wrote:
> ----- Original Message -----
> From: "Vladimir Prus" <ghost_at_[hidden]>
>
> > > > 2. If we search from targets, then there's a problem we've discussed
> > > > a message ago: multiple targets in intermediate rules that should all
> > > > be
> > >
> > > linked
> > >
> > > > I think a have an idea how it can be addressed. Suppose you
> > > > consider
> > > > generators for <target_type>CPP
> > > > - WHL -> CPP transformation is found
> > > > - WD -> WHL transformation is found
> > > > - WHL->CPP transformation, which initialted the search that found
> > > > WD->WHL, asks that transformation about any other files it produce
> > > > > that
> > > > should be processed, DLP is returned.
> > > > - WHL->CPP transformation tries to match transformation from DLP to
> > > > the top-level target type. (*)
> > > >
> > > > [snip]
> > >
> > > Very complicated. So far I opt for the easy way out:
> >
> > Is it that complicated? I've only added one extra step, which is quite
> > simple.
>
> Oh, I envisioned something complicated when you wrote "tries to match".
> What does that mean, anyway?

The top-level operation we've been discussing is "given a certain target type
and a list of sources, compute a sequence of transformations". This is what I
mean by "tries to match". In other words, when WD->WHL,DLP transformation has
been selected by seach from WHL, we suddenly realize that there's DLP file
and have no better option that to treat that file as if it were yet another
source.

> Also, does it handle the case where WHL->LEX->CPP and DLP->CPP?
Yes. After arriving at CPP type, there are two alternatives:
1. LEX->CPP is selected, WHL->LEX is selected, WD->{WHL,DLP} is selected and
DLP file appears, then OBJ->CPP, DLP->CPP transformations are added.
2. DLP->CPP is selected, WD->{WHL,DLP} is selected and WHL file appears,
the OBJ->CPP, LEX->CPP, WHL->LEX transformation are added.

Since the list of transformations is the same in both cases, we'll know
there's no ambiguity. (Acually, we'd need to gather the list of
(transformation, source files) pairs, but that's the same).

> Finally, does it force the products of wd to be handled as a unit?

I don't think so. If something like

generate a_lexer.lex : a.wd ;

is given (meaning create the target of type determined by extension from
source), then after selecting WD->{WHL,DLP} transformation, there will be no
transformation sequence using the other generated file, so DLP file will be
generated, but will remain unused.

> > Selection rules are almost the same as you've proposed, and the only
> > non-trivial thing is finding equivalent alternatives, which is quite easy
> > once the list of all intermidiate transformation is collected.
>
> What do you mean by "finding equivalent alternatives"? Please spell it out
> for me.

This is the case when at some point you can run either of two generators, but
each one, if selected, will result in the same list of transformations.

> > And then... hope we'll start writing something!
>
> HERE HERE!

Okay, would you mind my experimenting with project declaration syntax? I've
made some attempts in that direction already and there unlikely to be any
major problems.

- Volodya

 


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