From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-01-30 02:33:38
> >> # Declare generators
> >> generators.register-ldlk gccmt.ldlk : EXE : LDR : <toolset>gccmt ;
> >> generators.register-linker gccmt.link : LIB OBJ : EXE :
> >> <toolset>gccmt ;
> >> But I get the feeling I'm going about this the wrong way, and that I
> >> need to change builtin.jam.
> > It looks to me that you're generators exactly minic the
> > description of your
> > tools. I don't see anything wrong about it.
> > Why do you think you need to change builtin.jam?
> Thanks for being so prompt! Sorry meant to include the error messages :
> C:/Work/SS/hardware/boost-build/tools\gccmt.jam:57: in load
> rule generators.register-ldlk unknown in module gccmt.
Agh.. I though register-ldlk is something you've already defined yourself but
did not include in the post.
The reason there's 'register-linker' is because linker generator is pretty
special. For your linker, there's no need to create special generator type,
so you can use the following:
generators.register-composing gccmt.ldlk : EXE : LDR : <toolset>gccmt ;
The only trick here is 'register-composing'. It creates a generator which can
take multiple instances of "EXE". Had you used
'generators.register-standard', the resulting generator will convert only one
EXE into LDR -- not what you want.
> I'm not sure I follow the way it all works, but I got the impression that
> builtin.jam provided the types of generators - the interface if you like,
> and the toolset files provided the implementation. So I figured I would
> have to extend the interface somehow. Perhaps I have that wrong.
Not exactly. The 'generators' module provides three 'register*' rules. The
'register-linker' rule in 'builtin.jam' is just a convenient helper. Without
it, toolset modules would have to create instance of specific generator class
and call 'generators.register' -- and that's verbose.
So, in short, to add a new tool, you have to call
BTW, have you seen
> Also I figured I needed to provide a definition for LDR somewhere, and all
> the rest of the definitions were in builtin.jam. When I tried :
> declare-type : LDR : ldr : : application ;
> just after the imports, the error message was
> C:/Work/SS/hardware/boost-build/tools\gccmt.jam:17: in load
> rule declare-type unknown in module gccmt.
You'd better use
import type ;
type.register : LDR : ldr : : main ;
The 'declare-type' is internal rule for builtin.jam.
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