@@ -39,18 +39,39 @@ script: |
39
39
unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r3.zip
40
40
unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip
41
41
cd ../build
42
+
43
+ function do_configure {
44
+ ./configure "$@" --enable-upnp-default --prefix=$STAGING --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"
45
+ }
42
46
#
43
47
cd bitcoin
44
48
./autogen.sh
45
- ./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"
49
+ do_configure
46
50
make dist
47
51
DISTNAME=`echo bitcoin-*.tar.gz`
52
+
53
+ # Build dynamic versions of everything
54
+ # (with static linking to boost and openssl as well a some non-OS deps)
48
55
mkdir -p distsrc
49
56
cd distsrc
50
57
tar --strip-components=1 -xf ../$DISTNAME
51
- ./configure --enable-upnp-default --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"
58
+ do_configure --bindir=$BINDIR
52
59
make $MAKEOPTS
53
60
make $MAKEOPTS install-strip
61
+ make $MAKEOPTS clean
62
+
63
+ # Build fully static versions of bitcoind and bitcoin-cli for older Linux distros
64
+ STATIC_BINDIR="$HOME/bindir.static"
65
+ mkdir -p $STATIC_BINDIR
66
+ # For 32-bit, -pie cannot be used with -static, as invalid executables are generated
67
+ # For 64-bit, -pie with -static causes a link error
68
+ # Disable hardening in configure and manually pass 'static-safe' hardening flags
69
+ OPTFLAGS='-O2 -static -Wstack-protector -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now'
70
+ do_configure --bindir=$STATIC_BINDIR --disable-tests --enable-upnp-default --without-gui --disable-hardening
71
+ make $MAKEOPTS
72
+ make $MAKEOPTS install-strip
73
+ cp $STATIC_BINDIR/bitcoind $BINDIR/bitcoind.static
74
+ cp $STATIC_BINDIR/bitcoin-cli $BINDIR/bitcoin-cli.static
54
75
55
76
# sort distribution tar file and normalize user/group/mtime information for deterministic output
56
77
mkdir -p $OUTDIR/src
0 commit comments