Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2004-06-24 18:21:54


Mathew Robertson wrote:

> 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])

I don't see why you need a function with C linkage for this to work.
The behavior of autoconf depends on the current language specified
in configure.ac at the point where you call AC_CHECK_LIB. If that language
is C++, you should well be able to test for functions with C++ linkage.
See http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_chapter/autoconf_5.html#SEC43

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

yeah, that sounds like a good idea. Additionally, autotools based packages often use
config/package scripts that can be queried by library users for the required compilation
and linking flags (for example additional libraries the application has to link with (such as
'-lpthread') when linking with the library in question.

Regards,
                Stefan


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