diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 88c20cdce6..9737b884b4 100644 --- a/configure.ac +++ b/configure.ac @@ -207,10 +207,8 @@ case $host in fi CPPFLAGS="$CPPFLAGS -DMAC_OSX" - TESTDEFS="-DBOOST_TEST_DYN_LINK" ;; *) - TESTDEFS="-DBOOST_TEST_DYN_LINK" ;; esac @@ -345,6 +343,24 @@ if test x$use_tests = xyes; then AX_BOOST_UNIT_TEST_FRAMEWORK + + dnl Determine if -DBOOST_TEST_DYN_LINK is needed + AC_MSG_CHECKING([for dynamic linked boost test]) + TEMP_LIBS="$LIBS" + LIBS="$LIBS $BOOST_UNIT_TEST_FRAMEWORK_LIB" + TEMP_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define BOOST_TEST_DYN_LINK + #define BOOST_TEST_MAIN + #include <boost/test/unit_test.hpp> + + ])], + [AC_MSG_RESULT(yes)] + [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"], + [AC_MSG_RESULT(no)]) + LIBS="$TEMP_LIBS" + CPPFLAGS="$TEMP_CPPFLAGS" fi BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB" @@ -357,8 +373,13 @@ dnl after 1.56. dnl If neither is available, abort. dnl If sleep_for is used, boost_chrono becomes a requirement. if test x$ax_cv_boost_chrono = xyes; then +dnl Allow passing extra needed dependency libraries for boost-chrono from static gitian build +BOOST_CHRONO_LIB="$BOOST_CHRONO_LIB $BOOST_CHRONO_EXTRALIBS" + TEMP_LIBS="$LIBS" LIBS="$LIBS $BOOST_LIBS $BOOST_CHRONO_LIB" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ #include <boost/thread/thread.hpp> #include <boost/version.hpp> @@ -373,11 +394,14 @@ AC_TRY_LINK([ AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], [boost_sleep=no]) LIBS="$TEMP_LIBS" +CPPFLAGS="$TEMP_CPPFLAGS" fi if test x$boost_sleep != xyes; then TEMP_LIBS="$LIBS" LIBS="$LIBS $BOOST_LIBS" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ #include <boost/version.hpp> #include <boost/thread.hpp> @@ -392,6 +416,7 @@ AC_TRY_LINK([ [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])], [boost_sleep=no]) LIBS="$TEMP_LIBS" +CPPFLAGS="$TEMP_CPPFLAGS" fi if test x$boost_sleep != xyes; then |