diff --git a/configure.ac b/configure.ac index 88c20cdce..9737b884b 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 + + ])], + [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 #include @@ -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 #include @@ -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 diff --git a/contrib/gitian-descriptors/boost-linux.yml b/contrib/gitian-descriptors/boost-linux.yml new file mode 100644 index 000000000..5d22294dd --- /dev/null +++ b/contrib/gitian-descriptors/boost-linux.yml @@ -0,0 +1,42 @@ +--- +name: "boost" +suites: +- "precise" +architectures: +- "i386" +- "amd64" +packages: +- "unzip" +- "pkg-config" +- "libtool" +- "faketime" +- "bsdmainutils" +- "zip" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "boost_1_55_0.tar.bz2" +script: | + STAGING="$HOME/install" + export LIBRARY_PATH="$STAGING/lib" + # Input Integrity Check + echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c + + mkdir -p "$STAGING" + tar xjf boost_1_55_0.tar.bz2 + cd boost_1_55_0 + GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) + # note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags + echo "using gcc : $GCCVERSION : g++ + : + \"-frandom-seed=boost1 -fPIC\" + ;" > user-config.jam + + ./bootstrap.sh --without-icu + + ./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS install + + cd "$STAGING" + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + zip -r $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip * diff --git a/contrib/gitian-descriptors/boost-win32.yml b/contrib/gitian-descriptors/boost-win32.yml index b14cd1f6c..55e74ce3e 100644 --- a/contrib/gitian-descriptors/boost-win32.yml +++ b/contrib/gitian-descriptors/boost-win32.yml @@ -16,7 +16,7 @@ files: - "boost-mingw-gas-cross-compile-2013-03-03.patch" script: | # Defines - INSTALLPREFIX="$OUTDIR/staging/boost" + INSTALLPREFIX="$HOME/install" HOST=i686-w64-mingw32 # Input Integrity Check echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c @@ -57,10 +57,9 @@ script: | # Note: Might need these options in the future for 64bit builds. # "Please note that address-model=64 must be given to bjam command line on 64bit Windows for 64bit build; otherwise 32bit code will be generated." # "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model." - ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install + ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install cd "$INSTALLPREFIX" export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME - zip -r boost-win32-1.55.0-gitian-r6.zip * - cp boost-win32-1.55.0-gitian-r6.zip $OUTDIR + zip -r $OUTDIR/boost-win32-1.55.0-gitian-r6.zip * diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml index 4ebf5c53a..41d8d65fb 100644 --- a/contrib/gitian-descriptors/deps-linux.yml +++ b/contrib/gitian-descriptors/deps-linux.yml @@ -15,6 +15,7 @@ packages: reference_datetime: "2013-06-01 00:00:00" remotes: [] files: +- "openssl-1.0.1e.tar.gz" - "miniupnpc-1.8.tar.gz" - "qrencode-3.4.3.tar.bz2" - "protobuf-2.5.0.tar.bz2" @@ -24,11 +25,21 @@ script: | OPTFLAGS='-O2' export LIBRARY_PATH="$STAGING/lib" # Integrity Check + echo "f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3 openssl-1.0.1e.tar.gz" | sha256sum -c echo "bc5f73c7b0056252c1888a80e6075787a1e1e9112b808f863a245483ff79859c miniupnpc-1.8.tar.gz" | sha256sum -c echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c + # + tar xzf openssl-1.0.1e.tar.gz + cd openssl-1.0.1e + # need -fPIC to avoid relocation error in 64 bit builds + ./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC + make + make install_sw + cd .. + # tar xzfm miniupnpc-1.8.tar.gz cd miniupnpc-1.8 # miniupnpc is always built with -fPIC @@ -60,4 +71,4 @@ script: | cd ../.. # cd $STAGING - zip -r $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r1.zip include lib bin host + zip -r $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2.zip include lib bin host diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index b0fe86e25..417f31e27 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -6,14 +6,7 @@ architectures: - "i386" - "amd64" packages: -- "qt4-qmake" - "libqt4-dev" -- "libboost-system-dev" -- "libboost-filesystem-dev" -- "libboost-program-options-dev" -- "libboost-thread-dev" -- "libboost-test-dev" -- "libssl-dev" - "git-core" - "unzip" - "pkg-config" @@ -27,8 +20,10 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "bitcoin-deps-linux32-gitian-r1.zip" -- "bitcoin-deps-linux64-gitian-r1.zip" +- "bitcoin-deps-linux32-gitian-r2.zip" +- "bitcoin-deps-linux64-gitian-r2.zip" +- "boost-linux32-1.55.0-gitian-r1.zip" +- "boost-linux64-1.55.0-gitian-r1.zip" script: | STAGING="$HOME/install" OPTFLAGS='-O2' @@ -38,18 +33,19 @@ script: | # mkdir -p $STAGING cd $STAGING - unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r1.zip + unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2.zip + unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip cd ../build # cd bitcoin export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'` ./autogen.sh - ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" + ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/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 ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" make dist mkdir -p distsrc cd distsrc tar --strip-components=1 -xf ../bitcoin-*.tar.* - ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/bin --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" + ./configure --prefix=$STAGING --bindir=$BINDIR --with-protoc-bindir=$STAGING/host/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 ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitcoin ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" make $MAKEOPTS make $MAKEOPTS install-strip mkdir -p $OUTDIR/src diff --git a/doc/release-process.md b/doc/release-process.md index 428193681..7fccf2172 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -53,6 +53,8 @@ Release Process cd .. ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-linux.yml mv build/out/bitcoin-deps-*.zip inputs/ + ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml + mv build/out/boost-linux-*.zip inputs/ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win32.yml mv build/out/boost-win32-*.zip inputs/ ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win32.yml