aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-01-18 16:02:21 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-01-18 16:02:31 +0100
commit490d6a30461d11aa112efe9fb3006797651ba4d5 (patch)
tree2532354f52544ca3e6df8c2385760f77dff91568 /configure.ac
parent851eb1efb19c93565cbdc292f39ab643a2e89592 (diff)
parent1cbbeb6a270d974b89c68d01e6a8544136a3c562 (diff)
Merge pull request #3545
1cbbeb6 gitian: Add openssl to linux deps (Wladimir J. van der Laan) 64be7f7 gitian: Build boost dependency for linux (Wladimir J. van der Laan) 7eb99a8 gitian: Reduce build time for boost windows dependency (Wladimir J. van der Laan) 714cdec build: Pass BOOST_CPPFLAGS to sleep implementation test (Wladimir J. van der Laan) 0d40f5a build: Allow providing extra libs for Boost Chrono (Wladimir J. van der Laan) e4b991e build: Auto-detect whether -DBOOST_TEST_DYN_LINK is needed (Wladimir J. van der Laan)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac29
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