Skip to content

Commit 490d6a3

Browse files
committed
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)
2 parents 851eb1e + 1cbbeb6 commit 490d6a3

File tree

6 files changed

+94
-19
lines changed

6 files changed

+94
-19
lines changed

configure.ac

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@ case $host in
207207
fi
208208

209209
CPPFLAGS="$CPPFLAGS -DMAC_OSX"
210-
TESTDEFS="-DBOOST_TEST_DYN_LINK"
211210
;;
212211
*)
213-
TESTDEFS="-DBOOST_TEST_DYN_LINK"
214212
;;
215213
esac
216214

@@ -345,6 +343,24 @@ if test x$use_tests = xyes; then
345343

346344

347345
AX_BOOST_UNIT_TEST_FRAMEWORK
346+
347+
dnl Determine if -DBOOST_TEST_DYN_LINK is needed
348+
AC_MSG_CHECKING([for dynamic linked boost test])
349+
TEMP_LIBS="$LIBS"
350+
LIBS="$LIBS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
351+
TEMP_CPPFLAGS="$CPPFLAGS"
352+
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
353+
AC_LINK_IFELSE([AC_LANG_SOURCE([
354+
#define BOOST_TEST_DYN_LINK
355+
#define BOOST_TEST_MAIN
356+
#include <boost/test/unit_test.hpp>
357+
358+
])],
359+
[AC_MSG_RESULT(yes)]
360+
[TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
361+
[AC_MSG_RESULT(no)])
362+
LIBS="$TEMP_LIBS"
363+
CPPFLAGS="$TEMP_CPPFLAGS"
348364
fi
349365

350366
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.
357373
dnl If neither is available, abort.
358374
dnl If sleep_for is used, boost_chrono becomes a requirement.
359375
if test x$ax_cv_boost_chrono = xyes; then
376+
dnl Allow passing extra needed dependency libraries for boost-chrono from static gitian build
377+
BOOST_CHRONO_LIB="$BOOST_CHRONO_LIB $BOOST_CHRONO_EXTRALIBS"
378+
360379
TEMP_LIBS="$LIBS"
361380
LIBS="$LIBS $BOOST_LIBS $BOOST_CHRONO_LIB"
381+
TEMP_CPPFLAGS="$CPPFLAGS"
382+
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
362383
AC_TRY_LINK([
363384
#include <boost/thread/thread.hpp>
364385
#include <boost/version.hpp>
@@ -373,11 +394,14 @@ AC_TRY_LINK([
373394
AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
374395
[boost_sleep=no])
375396
LIBS="$TEMP_LIBS"
397+
CPPFLAGS="$TEMP_CPPFLAGS"
376398
fi
377399

378400
if test x$boost_sleep != xyes; then
379401
TEMP_LIBS="$LIBS"
380402
LIBS="$LIBS $BOOST_LIBS"
403+
TEMP_CPPFLAGS="$CPPFLAGS"
404+
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
381405
AC_TRY_LINK([
382406
#include <boost/version.hpp>
383407
#include <boost/thread.hpp>
@@ -392,6 +416,7 @@ AC_TRY_LINK([
392416
[boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
393417
[boost_sleep=no])
394418
LIBS="$TEMP_LIBS"
419+
CPPFLAGS="$TEMP_CPPFLAGS"
395420
fi
396421

397422
if test x$boost_sleep != xyes; then
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: "boost"
3+
suites:
4+
- "precise"
5+
architectures:
6+
- "i386"
7+
- "amd64"
8+
packages:
9+
- "unzip"
10+
- "pkg-config"
11+
- "libtool"
12+
- "faketime"
13+
- "bsdmainutils"
14+
- "zip"
15+
reference_datetime: "2011-01-30 00:00:00"
16+
remotes: []
17+
files:
18+
- "boost_1_55_0.tar.bz2"
19+
script: |
20+
STAGING="$HOME/install"
21+
export LIBRARY_PATH="$STAGING/lib"
22+
# Input Integrity Check
23+
echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c
24+
25+
mkdir -p "$STAGING"
26+
tar xjf boost_1_55_0.tar.bz2
27+
cd boost_1_55_0
28+
GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2)
29+
# note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags
30+
echo "using gcc : $GCCVERSION : g++
31+
:
32+
<cxxflags>\"-frandom-seed=boost1 -fPIC\"
33+
;" > user-config.jam
34+
35+
./bootstrap.sh --without-icu
36+
37+
./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
38+
39+
cd "$STAGING"
40+
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
41+
export FAKETIME=$REFERENCE_DATETIME
42+
zip -r $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip *

contrib/gitian-descriptors/boost-win32.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ files:
1616
- "boost-mingw-gas-cross-compile-2013-03-03.patch"
1717
script: |
1818
# Defines
19-
INSTALLPREFIX="$OUTDIR/staging/boost"
19+
INSTALLPREFIX="$HOME/install"
2020
HOST=i686-w64-mingw32
2121
# Input Integrity Check
2222
echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c
@@ -57,10 +57,9 @@ script: |
5757
# Note: Might need these options in the future for 64bit builds.
5858
# "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."
5959
# "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model."
60-
./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
60+
./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
6161
6262
cd "$INSTALLPREFIX"
6363
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
6464
export FAKETIME=$REFERENCE_DATETIME
65-
zip -r boost-win32-1.55.0-gitian-r6.zip *
66-
cp boost-win32-1.55.0-gitian-r6.zip $OUTDIR
65+
zip -r $OUTDIR/boost-win32-1.55.0-gitian-r6.zip *

contrib/gitian-descriptors/deps-linux.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages:
1515
reference_datetime: "2013-06-01 00:00:00"
1616
remotes: []
1717
files:
18+
- "openssl-1.0.1e.tar.gz"
1819
- "miniupnpc-1.8.tar.gz"
1920
- "qrencode-3.4.3.tar.bz2"
2021
- "protobuf-2.5.0.tar.bz2"
@@ -24,11 +25,21 @@ script: |
2425
OPTFLAGS='-O2'
2526
export LIBRARY_PATH="$STAGING/lib"
2627
# Integrity Check
28+
echo "f74f15e8c8ff11aa3d5bb5f276d202ec18d7246e95f961db76054199c69c1ae3 openssl-1.0.1e.tar.gz" | sha256sum -c
2729
echo "bc5f73c7b0056252c1888a80e6075787a1e1e9112b808f863a245483ff79859c miniupnpc-1.8.tar.gz" | sha256sum -c
2830
echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c
2931
echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c
3032
echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c
3133
34+
#
35+
tar xzf openssl-1.0.1e.tar.gz
36+
cd openssl-1.0.1e
37+
# need -fPIC to avoid relocation error in 64 bit builds
38+
./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC
39+
make
40+
make install_sw
41+
cd ..
42+
#
3243
tar xzfm miniupnpc-1.8.tar.gz
3344
cd miniupnpc-1.8
3445
# miniupnpc is always built with -fPIC
@@ -60,4 +71,4 @@ script: |
6071
cd ../..
6172
#
6273
cd $STAGING
63-
zip -r $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r1.zip include lib bin host
74+
zip -r $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2.zip include lib bin host

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ architectures:
66
- "i386"
77
- "amd64"
88
packages:
9-
- "qt4-qmake"
109
- "libqt4-dev"
11-
- "libboost-system-dev"
12-
- "libboost-filesystem-dev"
13-
- "libboost-program-options-dev"
14-
- "libboost-thread-dev"
15-
- "libboost-test-dev"
16-
- "libssl-dev"
1710
- "git-core"
1811
- "unzip"
1912
- "pkg-config"
@@ -27,8 +20,10 @@ remotes:
2720
- "url": "https://github.com/bitcoin/bitcoin.git"
2821
"dir": "bitcoin"
2922
files:
30-
- "bitcoin-deps-linux32-gitian-r1.zip"
31-
- "bitcoin-deps-linux64-gitian-r1.zip"
23+
- "bitcoin-deps-linux32-gitian-r2.zip"
24+
- "bitcoin-deps-linux64-gitian-r2.zip"
25+
- "boost-linux32-1.55.0-gitian-r1.zip"
26+
- "boost-linux64-1.55.0-gitian-r1.zip"
3227
script: |
3328
STAGING="$HOME/install"
3429
OPTFLAGS='-O2'
@@ -38,18 +33,19 @@ script: |
3833
#
3934
mkdir -p $STAGING
4035
cd $STAGING
41-
unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r1.zip
36+
unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r2.zip
37+
unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip
4238
cd ../build
4339
#
4440
cd bitcoin
4541
export TAR_OPTIONS=--mtime=`echo $REFERENCE_DATETIME | awk '{ print $1 }'`
4642
./autogen.sh
47-
./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}"
43+
./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"
4844
make dist
4945
mkdir -p distsrc
5046
cd distsrc
5147
tar --strip-components=1 -xf ../bitcoin-*.tar.*
52-
./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}"
48+
./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"
5349
make $MAKEOPTS
5450
make $MAKEOPTS install-strip
5551
mkdir -p $OUTDIR/src

doc/release-process.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Release Process
5353
cd ..
5454
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-linux.yml
5555
mv build/out/bitcoin-deps-*.zip inputs/
56+
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-linux.yml
57+
mv build/out/boost-linux-*.zip inputs/
5658
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/boost-win32.yml
5759
mv build/out/boost-win32-*.zip inputs/
5860
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/deps-win32.yml

0 commit comments

Comments
 (0)