Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-12-15 12:13:44


On Wed, Dec 15, 2004 at 08:38:37AM -0500, Neal D. Becker wrote:

> First, I would say, there is a need for a better autoconf for boost. There
> has been some interest in scons, and scons also includes some capability
> here that might be useful.
>
> I don't think pkg-config is the right tool. All it is for is to record the
> settings that were used to build packages - it doesn't figure them out. I
> don't see how that would help boost.

They're useful for other libraries or applications that rely on Boost to
be able to generate Makefiles.

It doesn't help Boost at all, but if I write a library that uses
Boost and I want to use autoconf and automake then I can tell autoconf
to use pkg-config in order to figure out the compiler and linker args
to use to find Boost.

This means the user can run "configure" and not have to say
"configure --with-boost=/usr/local/boost/" or similar, configure will
run pkgconfig and determine that info itself.

The only problem with this approach I can see is that Boost consists of
*lots* of libraries, not a single libboost.so - so IIUC there would have
to be pkgconfig files for each lib, and possibly for each combination of
toolset, debug/release, ST/MT, for each lib!

This might be something that packagers should add themselves if they
ship a single, pre-packaged, system-wide Boost. (By which I mean,
RedHat could add pkgconfig to their boost RPM, because they only ship
a single libboost_regex.so, not libboost_regex-gcc-mt-1_32.so and
other toolset/build/thread combos).

Otherwise autoconf would have to ask pkgconfig for the paths to a
specific build for a specific toolset for a specific build, which
makes it completely unportable to other toolsets/builds etc.

Another, related option, is a boost-config script that allows you to
specify which libs you want, and which versions, e.g.
    boost-config thread regex signals --libs
might output:
    -L/usr/lib/ -lboost_regex -lboost_thread -lboost_signals

and
    boost-config regex --libs --toolset=gcc --build=mt
might output:
    -L/usr/lib/ -lboost_regex-gcc-mt-1_32

A number of projects I know provide a file like this, which is almost as
easy to use in autoconf/automake as pkgconfig (there are standard macros
for using such a file in place of pkgconfig).

jon

-- 
"Most people would sooner die than think; in fact, they do so."
	- Bertrand Russell

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk