From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-10 09:09:23
> A lot of projects built with the GNU automake, etc.
> come with a program which outputs the necessary
> CFLAGS, LIBS, etc. one would need to compile a program
> using it. It is called XXX-config, where XXX is the
> project name, e..g., xml2-config or gtk-config.
> The output would be like:
> $ xml2-config --libs
> -L/sw/lib -lxml2 -lz -lpthread -L/sw/lib -liconv -lm
> So on the command line, I could use it like this:
> $ g++ a.cpp `xml2-config --cflags` `xml2-config
> I'm wondering if there's any way to easily use these
> kinds of tools in a Boost.Build project. I'm
> thinking I could write an action that assigns the
> output of a shell command to a variable so I could use
> it like:
> exe a : a.cpp : <cflags>$(LIBXMLSTUFF) ;
> But I'm not sure how to do this.
It's not easy, because bjam does not allow to run a command and capture
its output into variable. But maybe you could tell how xxx-config programs
are used in automake world. Are they really run on each invocation of
a compiler. Or the configure script adds output of xxx-config to Makefile?
If the latter is the case, then I think you can do the same with
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