Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-03-26 03:30:43


Jurko Gospodnetić wrote:

> Hi Alex.
>
>> Here's an example of dtrace usage, which makes me copletely confused as to how
>> to implement this in bjam!!
>>
>> cc -c src1.c
>> cc -c src2.c
>> ...
>> dtrace -G -32 -s myserv.d src1.o src2.o ...
>> cc -o myserv myserv.o src1.o src2.o ...
>
> Do not know what 'dtrace' is and do not have the time to play around
> with this, but here's the first thing that pops to mind...
>
> At first glace seems similar to how regular link generators
> implemented. Why not implement a ( .d, .obj ) ==> ( whatever dtrace
> produces ) generator similar to how link generators are implemented and
> then simply build those targets that dtrace builds?
>
> Would that work?
>
> One possible problem with this is if 'dtrace' actually modifies .o
> files in-place. In that case I guess one would need to define new target
> type for 'dtrace modified obj files' and somehow tell Boost Build to use
> those targets for linking instead of 'raw' ones. But if this is the case
> then I'd really have to play around with this to get some more insight...

Right, I think implementing a new generator is called for.
Say, define a new type DTRACE_EXE and a generator creating such a type.
The generator would try converting all sources to OBJ, create
a target for that dtrace-produced-obj, and then try to construct EXE
from everything. You can try using examples/generator for a skeleton
of new generator and consult builtin.jam/generator.jam for how
generators work.

- 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