bitcore-node-zcash/build-libbitcoind.sh

51 lines
924 B
Bash
Raw Normal View History

2014-12-06 16:43:53 -08:00
#!/bin/sh
2014-12-06 17:18:12 -08:00
cur_dir="$(pwd)"
2014-12-06 16:43:53 -08:00
os_dir=$(dirname "$(./platform/os.sh)")
2014-12-06 17:18:12 -08:00
if test -n "$1"; then
if test "$1" = 'remote'; then
git clone git://github.com/bitcoin/bitcoin.git libbitcoind || exit 1
btc_dir="${cur_dir}/libbitcoind"
2014-12-06 17:18:12 -08:00
else
btc_dir=$1
if ! test -d "$btc_dir"; then
"$0" remote
exit 0
fi
2014-12-06 17:18:12 -08:00
fi
shift
else
btc_dir="${HOME}/bitcoin"
if ! test -d "$btc_dir"; then
"$0" remote
exit 0
fi
2014-12-06 17:18:12 -08:00
fi
2014-12-06 16:43:53 -08:00
./patch-bitcoin.sh "$btc_dir" || exit 1
cd "$btc_dir" || exit 1
./autogen.sh || exit 1
2014-12-06 17:18:12 -08:00
if test -n "$1"; then
./configure --enable-daemonlib --with-incompatible-bdb "$@" || exit 1
else
./configure --enable-daemonlib --with-incompatible-bdb || exit 1
fi
2014-12-06 16:43:53 -08:00
make || exit 1
cp src/libbitcoind.so "${os_dir}/libbitcoind.so" || exit 1
cd "$os_dir" || exit 1
rm -f xaa xab
split libbitcoind.so -n 2 || exit 1
2014-12-06 17:18:12 -08:00
cd "$cur_dir"
rm -rf bitcoin
2014-12-06 16:43:53 -08:00
echo 'Build finished successfully.'
exit 0