From 369df99f5032db7c5ab4c01749726c31f9a838b7 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 6 Dec 2014 17:18:12 -0800 Subject: [PATCH] allow git cloning bitcoind. --- build-libbitcoind.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/build-libbitcoind.sh b/build-libbitcoind.sh index cf081fe1..3c126c94 100755 --- a/build-libbitcoind.sh +++ b/build-libbitcoind.sh @@ -1,15 +1,30 @@ #!/bin/sh -btc_dir=$(test -n "$1" && echo "$1" || echo "${HOME}/bitcoin") +cur_dir="$(pwd)" os_dir=$(dirname "$(./platform/os.sh)") -shift + +if test -n "$1"; then + if test "$1" = 'remote'; then + git clone git://github.com/bitcoin/bitcoin.git || exit 1 + btc_dir="${cur_dir}/bitcoin" + else + btc_dir=$1 + fi + shift +else + btc_dir="${HOME}/bitcoin" +fi ./patch-bitcoin.sh "$btc_dir" || exit 1 cd "$btc_dir" || exit 1 ./autogen.sh || exit 1 -./configure --enable-daemonlib --with-incompatible-bdb "$@" || exit 1 +if test -n "$1"; then + ./configure --enable-daemonlib --with-incompatible-bdb "$@" || exit 1 +else + ./configure --enable-daemonlib --with-incompatible-bdb || exit 1 +fi make || exit 1 cp src/libbitcoind.so "${os_dir}/libbitcoind.so" || exit 1 @@ -20,5 +35,8 @@ rm -f xaa xab split libbitcoind.so -n 2 || exit 1 +cd "$cur_dir" +rm -rf bitcoin + echo 'Build finished successfully.' exit 0