From 0b7662be4e6c57b66352317ab7f097117888993a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 21 Apr 2008 10:41:15 +0200 Subject: [PATCH] Do not use AC_CHECK_LIB anyway. Use AC_LINK_IFELSE instead. --- boost.m4 | 54 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/boost.m4 b/boost.m4 index f3dd675..cdf6c64 100644 --- a/boost.m4 +++ b/boost.m4 @@ -53,45 +53,35 @@ version_is:BOOST_VERSION for c in $1; do case $c in thread) + AC_MSG_CHECKING([Boost threads]) AC_SUBST([BOOST_THREAD_LIB]) + saveLIBS="${LIBS}" BOOST_THREAD_LIB="" for l in boost_thread-mt boost_thread; do - AC_CHECK_LIB([${l}],[main],[ - BOOST_THREAD_LIB="-l${l}" - break - ],[]) - done - if test -z "${BOOST_THREAD_LIB}"; then - AC_MSG_ERROR([Boost thread libs not found]) - fi - LIBS="${LIBS} ${BOOST_THREAD_LIB}" - AC_MSG_CHECKING([Boost threads]) + LIBS="${saveLIBS} -l${l}" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include ]],[[ int x = BOOST_VERSION; -]])],[AC_MSG_RESULT([yes])],[ -AC_MSG_RESULT([no]) -AC_MSG_ERROR([Boost thread libraries required]) - ]) +]])],[ + BOOST_THREAD_LIB="-l${l}" + break],[]) + done + if test "${BOOST_THREAD_LIB}"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi ;; test) + AC_MSG_CHECKING([Boost unit test framework]) + saveLIBS="${LIBS}" AC_SUBST([BOOST_TEST_LIB]) BOOST_TEST_LIB="" for l in boost_unit_test_framework-mt boost_unit_test_framework; do - AC_CHECK_LIB([${l}],[main],[ - BOOST_TEST_LIB="-l${l}" - break - ],[]) - done - if test -z "${BOOST_TEST_LIB}"; then - AC_MSG_ERROR([Boost unit test libs not found]) - fi - saveLIBS="${LIBS}" - LIBS="${LIBS} ${BOOST_TEST_LIB}" - AC_MSG_CHECKING([Boost unit test framework]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + LIBS="${saveLIBS} -l${l}" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define BOOST_TEST_DYN_LINK #include BOOST_AUTO_TEST_CASE( t ) @@ -99,8 +89,16 @@ BOOST_AUTO_TEST_CASE( t ) BOOST_CHECK(1); } ]],[[ -]])],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no]) -AC_MSG_ERROR([Boost unit test framework libraries required])]) +]])],[ + BOOST_TEST_LIB="-l${l}" + break +],[]) + done + if test "${BOOST_TEST_LIB}"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi LIBS="${saveLIBS}" ;; esac -- 1.7.10.4