Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-20 11:04:59


Vladimir Prus <ghost_at_[hidden]> writes:

> I was thinking about reuse of toolset definitions when declaring other
> toolsets. The conclusion is that it's probably quite simple. Basically,
> toolset can:
>
> - change some variables (for example Kylix can redefine
> COMPILER_NAME and LINKER_NAME, provided base borland toolset uses those),
> - add some flags
> - rewrite some rules

One might also imagine blocking the application of certain flags from
the base toolset, however I think I'd prefer to encourage toolset
refactoring so that this blocking would be unneeded before we
are forced to implement that feature.

> I think that V2 heavily uses generators, this is the right unit of
> inheritance. We have provide some means to inherit generator. For example,
> borland toolset contains:
>
> generators.register-compiler borland.compile : CPP : OBJ : <toolset>borland ;
>
> Toolset for kylix can contain:
>
> toolset.inherit-generator borland.compile ;
>
> This would create new generator "kylix.compile" which will be equal to
> "borland.compile" except that required properties will contain <toolset>kylix
> instead of <toolset>borland.

Hmm, I'm not sure that's all there is to it.

It's common to need to set build requirements for a target based on
matching any one of a family of toolsets. I think that with handling
multiple toolset versions in a single toolset file we will probably
see that phenomenon lessened, but I'm not certain it will disappear
completely. We ought to give it some thought, anyway.

> All flags relevant to this generator will be inherited too. Lastly, all rules
> will be imported. E.g if borland.jam had:
>
> actions compile
> {
> $(COMPILER_NAME) ....
> }
>
> then the kylix module will get its own copy of this rule, which will use the
> COMPILER_NAME variable defined in the kylix module.
>
> I guess there should also be a convenience rule, which will inherit all
> generators from other module.

I think that will be used most often.

> Does it sound reasonable?

Yes!

I can do a little bit today; do you have a job for me?

-Dave

-- 
David Abrahams
dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
 

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