Boost logo

Boost :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2004-06-25 08:49:30


On Thursday 24 June 2004 8:44 pm, Mathew Robertson wrote:
> Can a make a few small suggestions...

Suggestions are *always* welcome.

> To allow the autoconf tools (ie configure) to detect the presence of the
> various Boost libs and header file versions, would it be possible to add a
> C-linkage function to each libraries' source file(s). This would allow
> users to add a configure check which detects if a particular library
> instance is installed. For example, we add the following code to each
> library instance:
>
> extern "C" boost_autoconf() {}
>
> This allows autoconf users to add a test to their configure.in script:
>
> AC_CHECK_LIB(boost_regex,boost_autoconf,...,[Boost::Regex library not
> found])
>
> The extern simply needs to be added to one of the top cpp files in each
> library.

As Vladimir points out, we'll need to include the name of the lib in that,
e.g., boost_regex_autoconf or boost_threads_autoconf.

> Would it be possible to get bjam to detect the system installed compiler,
> then if it matched the "-sTOOLS=xxx" name, then it would install a version
> of the target libraries which doesn't include the compiler name? eg
> installing Boost results in libraries names like "libboost_signals-gcc.so"
> - it would be useful to install a library names like "libboost_signals.so".
> The main reason is that when you build your application, 'make' will use
> the $(CC) value (which is often 'gcc', 'aCC', 'cc', etc) automatically
> dependant on the platform - the application doesn't care which compiler it
> is built with, it only cares that it is the 'default system compiler'.

bjam doesn't seem to have the notion of a "system compiler", but it seems that
we could have an "install-as-system" step that would do this.

> Boost installs its include files in $PREFIX/include/boost-<version>/boost
> (where prefix is something like /usr/local). Would it be possible to
> install a symlink which effestively implements:
>
> cd $PREFIX/include
> ln -s boost-<version>/boost boost
>
> but only if the symlink didn't already exist. This would allow users to
> do a default/generic install of Boost, without them need to specify the
> specific version of the libraries within their build/make system.

Sounds like a good idea...

> Finally (if there isn't a technique to do this already), would it be
> possible for the main boost/config.hpp to include a version number as a
> #define (or something similar), so the the application build tools could
> detect the whether the installed version is sufficient.

You want boost/version.hpp, which defines the BOOST_VERSION and
BOOST_LIB_VERSION macros for this purpose. The file itself describes the
(simple) encoding used.

        Doug


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