|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-04-12 07:59:10
Hi Max,
> Hi.
> I tried to use Boost.Build V2 to build applications for some custom
> embedded system. The building process uses modified GCC tools and has
> complicated linking stage whch consist of three steps:
> 1) *.o and *.a files are linked to app.xxx,
> 2) app.xxx and *.a are linked to app.yyy (with linking scripts different
> from previous step),
So, the input *.a files are used twice?
> 3) app.yyy is converted to app.zzz, that is an executable.
>
> I'm writing custom toolset module and my question is how to write a link
> rules/actions correctly.
> Should I use a generators? I tried this code, but I don't like it
Why?
> and it
> does't work:
In what way?
>
> type.register XXX : xxx ;
> generators.register-composing egcc.xxxlink : OBJ SEARCHED_LIB STATIC_LIB
>
> : XXX : <toolset>egcc ;
>
> type.register YYY : yyy ;
> generators.register-composing egcc.yyylink : XXX SEARCHED_LIB STATIC_LIB
>
> : YYY : <toolset>egcc ;
You mean that .a files are used only when creating app.xxx, but not when
creating app.yyy?
In this case, you'll have to write your own generator class. For example, did
you read:
http://boost.org/boost-build2/doc/html/bbv2/extending/tools.html
The last code examples override the 'run' rule of a generator. You can use it
to select all .a targets and then
- construct XXX from all sources
- construct YYY from XXX and all .a files
- construct ZZZ
When construction can be done by recursive call to generators.construct.
HTH,
Volodya
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
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