From 3bc5af724b370ceb2bd01fece863bd16fe7c0f6d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 19 Apr 2008 20:35:19 +0200 Subject: [PATCH] Check linking with Boost libraries. Use threaded versions. --- boost.m4 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/boost.m4 b/boost.m4 index 084e36e..961797a 100644 --- a/boost.m4 +++ b/boost.m4 @@ -1,6 +1,16 @@ # configure for Boost libs # # ID_BOOST([components],[libs]) +# +# Sets the following variables: +# +# BOOST_CPPFLAGS +# BOOST_LIB +# If components include "thread": +# BOOST_THREAD_LIB +# If components include "test": +# BOOST_TEST_LIB + AC_DEFUN([ID_BOOST], [ AC_SUBST(BOOST_CPPFLAGS) @@ -53,9 +63,10 @@ int x = BOOST_VERSION; case $c in thread) AC_SUBST(BOOST_THREAD_LIB) - BOOST_THREAD_LIB="-lboost_thread" + BOOST_THREAD_LIB="-lboost_thread-mt" + LIBS="${LIBS} ${BOOST_THREAD_LIB}" AC_MSG_CHECKING([Boost threads]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include ]],[[ @@ -67,9 +78,11 @@ AC_MSG_ERROR([Boost thread libraries required]) ;; test) AC_SUBST(BOOST_TEST_LIB) - BOOST_TEST_LIB="-lboost_unit_test_framework" + saveLIBS="${LIBS}" + BOOST_TEST_LIB="-lboost_unit_test_framework-mt" + LIBS="${LIBS} ${BOOST_TEST_LIB}" AC_MSG_CHECKING([Boost unit test framework]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define BOOST_TEST_DYN_LINK #include BOOST_AUTO_TEST_CASE( t ) @@ -79,6 +92,7 @@ BOOST_AUTO_TEST_CASE( t ) ]],[[ ]])],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no]) AC_MSG_ERROR([Boost unit test framework libraries required])]) + LIBS="${saveLIBS}" ;; esac done -- 1.7.10.4