Boost logo

Boost Users :

From: Vincent N. Virgilio (virgilio_at_[hidden])
Date: 2004-06-24 22:32:20


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

I didn't see any Boost Autoconf macros in the ac-archive

        http://ac-archive.sourceforge.net/

nor in Peter Simon's Autoconf archive

        http://www.gnu.org/software/ac-archive/.

And since I haven't run across such macros anywhere else, I offer some
Armchair Autoconf'ing. I do not know if the following is executable.

AC_SEARCH_LIBS(...) might do it handily. You'd list the variant library
names in the second argument. This would select the first library found;
limited, but not bad for a first cut.

Or you could probably find part of the library name (compiler) in the
CXX variable, and then use it in AC_CHECK_LIB.

Either approach could be made more flexible by adding appropriate
'--with-<~boost-option>' flags to configure.ac to help construct the
target boost library name(s).

Regards,

-- 
Vince Virgilio

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