[jamming] external program output -> variable

Vladimir Prus ghost at cs.msu.su
Wed May 5 00:55:17 PDT 2004


Igor Bukanov wrote:
> Hello!

Hi Igor,

> Instead I would like to write something
> like:
>
> CCFLAGS += [ RunCommand pkg-config --cflags gtk+-2.0 ] ;
> LINKLIBS += [ RunCommand pkg-config --libs gtk+-2.0 ] ;
>
> The question then is how to implement RunCommand ?

This question arises quite regularly, in particular, the same was requested 
several times on Boost.Jam mailing list.

The implementation is going to be straightforward, for example, on Unix you'd 
just fork a child and read from a pipe. However, making the implementation 
portable and robust would require some effort. Maybe, it makes sense to steal 
implementation from APR (Apache portable runtime), or from some other 
library.

If somebody, say you, could do that, it would be really great.

- Volodya



More information about the jamming mailing list