[openbeos] Re: jam question

On 2007-06-26 at 21:41:43 [+0200], Clemens Zeidler 
<clemens.zeidler@xxxxxxxxxxxxxx> wrote:
> 
> its exact the problem that is descriped there but I don't realy understand
> whats the way to go now.

There are a few possible solutions depending on what exactly you want to do:

* Move command execution to a "configure" shell script that generates a 
file that can later be included by the jam build system. The Haiku build 
system does this and I think it is quite good approach. Very often in cases 
where you want to know output of commands at shell parse time, this output 
does normally not change between jam invocations, since it is indeed some 
configuration property (of the installed tool chain or your build system). 
Doing this kind of stuff in jam would only unnecessarily increase the build 
times.

* Move the command execution to the actions. How this can be done depends 
heavily on the specific case. At any rate you need to write one or more 
rules (with actions) to do that. The Haiku build system uses this method 
for injecting the svn revision number into some shared objects for instance 
(cf. build/jam/FileRules, rule CopySetHaikuRevision). You may or may not 
need intermediate files.

* Use a wrapper shell script for the jam invocation. This script would 
execute your special commands, set variables and then invoke jam.

* Use a jam derivate that supports this feature natively. There's a 
FreeType jam version which is relatively close to the original (with just a 
few additional goodies) and, unless I'm mistaken, has such a feature. An 
alternative is Boost Jam, which is further apart from the original jam; it 
definitely has command execution at parse time.

CU, Ingo

Other related posts: