Boost logo

Boost-Build :

From: Daniel Schlyder (daniel_at_[hidden])
Date: 2004-09-10 03:32:12

Ian Fasel:
> 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
> --libs`

> 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.

A bit ugly, but you could wrap bjam in a Perl script that runs the config
scripts and sets environment variables that you can then use in your

Daniel Schlyder

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at