From 460b32d7b1a2014dd490b15a360d062847f8efe9 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 21 Jul 2014 17:34:08 -0400 Subject: [PATCH 1/2] build: fix broken boost chrono check on some platforms If clock_gettime is implemented outside of libc (librt in this case), configure would fail when testing boost. Since clock_gettime is not present on all OSs, boost only uses it when it can. Check for it in librt and add it to LIBS if found, but don't fail if it's not (since boost won't be expecting it in this case). Also, reverse the link order as necessary for static libs. Note that it's possible that there are other similar cases for boost, which may be handled the same way. --- configure.ac | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index cedc34e52..719b06da6 100644 --- a/configure.ac +++ b/configure.ac @@ -392,6 +392,8 @@ AC_TRY_COMPILE([#include ], [ AC_MSG_RESULT(no)] ) +AC_SEARCH_LIBS([clock_gettime],[rt]) + LEVELDB_CPPFLAGS= LIBLEVELDB= LIBMEMENV= @@ -460,11 +462,8 @@ 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" +LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ @@ -486,7 +485,7 @@ fi if test x$boost_sleep != xyes; then TEMP_LIBS="$LIBS" -LIBS="$LIBS $BOOST_LIBS" +LIBS="$BOOST_LIBS $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" AC_TRY_LINK([ From a7ec027311ae4b14d3ea4225a875caa5a83151bb Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 22 Jul 2014 09:01:51 -0400 Subject: [PATCH 2/2] gitian: remove unneeded option after last commit --- contrib/gitian-descriptors/gitian-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 65a6c3c1e..30b0227bd 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -59,7 +59,7 @@ script: | local: *; };' > $LINKER_SCRIPT function do_configure { - ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --enable-glibc-back-compat + ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" --enable-glibc-back-compat } # cd bitcoin