diff --git a/bin/build b/bin/build index a56c4a95..bed89c1d 100755 --- a/bin/build +++ b/bin/build @@ -5,6 +5,7 @@ depends_dir=$($root_dir/bin/variables.sh depends_dir) host=$(${root_dir}/bin/variables.sh host) btc_dir="${root_dir}/libbitcoind" patch_sha=$($root_dir/bin/variables.sh patch_sha) +config_lib_dir=$($root_dir/bin/variables.sh config_lib_dir) export CPPFLAGS="-I${depends_dir}/${host}/include/boost -I${depends_dir}/${host}/include -L${depends_dir}/${host}/lib" echo "Using BTC directory: ${btc_dir}" @@ -153,9 +154,7 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " echo './autogen.sh' ./autogen.sh || exit -1 - boost_libdir="--with-boost-libdir=${depends_dir}/${host}/lib" - - full_options="${options} ${boost_libdir}" + full_options="${options} ${config_lib_dir}" echo "running the configure script with the following options:\n :::[\"${full_options}\"]:::" ${full_options} diff --git a/bin/variables.sh b/bin/variables.sh index 65cae0b1..8b35e0cf 100755 --- a/bin/variables.sh +++ b/bin/variables.sh @@ -1,14 +1,25 @@ #!/bin/bash exec 2> /dev/null - -root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." +root_dir="$(cd "$(dirname $0)" && pwd)/.." +if [ "${root_dir}" == "" ]; then + root_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.." +fi bitcoin_dir="${root_dir}"/libbitcoind cache_dir="${root_dir}"/cache -platform=`uname -a | awk '{print tolower($1)}'` -arch=`uname -m` -host="${arch}"-"${platform}" +host= +compute_host () { + platform=`uname -a | awk '{print tolower($1)}'` + arch=`uname -m` + if [ "${arch:0:3}" == "arm" ]; then + host="arm-linux-gnueabihf" + else + host="${arch}"-"${platform}" + fi +} + +compute_host mac_response= check_mac_build_system () { @@ -35,6 +46,13 @@ libsecp256k1="${cache_dir}"/src/secp256k1/.libs/libsecp256k1.a ssl="${cache_dir}"/depends/"${host}"/lib/libssl.a crypto="${cache_dir}"/depends/"${host}"/lib/libcrypto.a +config_lib_dir= +if [ "${platform}" == "darwin" ]; then + config_lib_dir="--with-boost-libdir=${depends_dir}/${host}/lib" +else + config_lib_dir="--prefix=${depends_dir}/${host}" +fi + if test x"$1" = x'anl'; then if [ "${platform}" != "darwin" ]; then echo -n "-lanl" @@ -129,3 +147,7 @@ fi if test -z "$1" -o x"$1" = x'bitcoind'; then echo -n "${cache_dir}"/src/.libs/libbitcoind.a fi + +if test -z "$1" -o x"$1" = x'config_lib_dir'; then + echo -n "${config_lib_dir}" +fi diff --git a/package.json b/package.json index ad4cef9c..57eddbb9 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,8 @@ "linux" ], "cpu": [ - "x64" + "x64", + "arm" ], "license": "MIT" }