Boost logo

Boost-Build :

From: msheppard_climax (msheppard_at_[hidden])
Date: 2003-09-26 10:11:08


--- In jamboost_at_[hidden], Vladimir Prus <ghost_at_c...> wrote:
> msheppard_climax wrote:
>
> > I want to invoke a shell command during the parsing phase which
will
> > update a source target with information from the Jamfile, but I
can't
> > see how to do it. I'm looking for the Jam equivalent of doing:
> >
> > $(shell whatever 2>&1 >/dev/null)
> >
> > in GNU Make. Is there a way to do that in Boost Jam?
>
> Nope, there's no such facility. It was talked about, but nothing
happened,
> probably because it's not that simple.

I couldn't find that discussion with a search of the jamboost Yahoo
group, do have a link to it? I had imagined it wouldn't be that hard
a feature to add, but obviously it is.

> Why do you need it? Maybe the problem can be solved in some other
way?

I want it to run a program which will write out a C++ file which just
#includes a number of other C++ files. The list of files to #include
originates from the jamfile and would be passed in on the command
line. If the generated file exists and already includes exactly the
same list of files it's left alone, if not it's updated. The
generated file is then compiled rather than all the individual files
it includes.

This needs to be done prior to dependency checking so that the
timestamp on the generated file can be checked. If you avoid
checking the timestamp on this file and instead use explicit calls to
DEPENDS/INCLUDES to make the object file depend on the files the
generated file includes then jam would fail to notice if the list of
files had changed since the previous invocation. If none of the
included files had been changed jam then wouldn't do the compilation
when it should.

I guess a work-around would be to run the program as part of the
normal action commands and have it exit non-zero if it updated the
file causing jam to bail out. The user would then have to re-run jam
to get it to compile the updated file. A bit inelegant, but it
should work.

Mark.

 


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