Boost logo

Boost Users :

From: Luigi Ballabio (luigi.ballabio_at_[hidden])
Date: 2004-06-25 03:45:58


On Fri, 25 Jun 2004 05:01:56 +0300, Petri Latvala wrote:

>> is somewhere documented how to add automake/autoconf stuff for boost to a
>> project? I have a set of small testcases and the need
>> boost_unit_test_framework-gcc library to compile. At the moment I add the
>> lib directly to linker options with
>>
>> project_test_LDADD = -lboost_unit_test_framework-gcc
>>
>> But this is not platform independent, because someone might have not gcc
>> installed. So how can I do it in a better way?
>
> The way to put in libraries is to AC_CHECK_LIB them. That will check
> that the lib is present with the given test symbol, and will link to it
> in the final build.

Unfortunately, the Boost unit-test framework is a strange beast.
AC_CHECK_LIB will check that the lib is present by writing a small
main() which calls the supplied function; but boost_unit_test_framework
already defines a main(), and requires the user to supply a function
with signature
test_suite* init_unit_test_suite( int argc, char* argv[] )
Therefore, AC_CHECK_LIB is doomed to fail.
Presently I'm trying to use lower-level macros such as AC_LINK_IFELSE.
I'll post something if I succeed...

Later,
        Luigi


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net