diff --git a/.travis.yml b/.travis.yml index d050d692..45957147 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,16 @@ +sudo: false language: node_js env: -- BITCOINDJS_ENV=test +- BITCOINDJS_ENV=test BITCOINDJS_ASSUME_YES=true node_js: - "0.12" before_install: - - sudo apt-get install libboost1.48-all-dev - - sudo add-apt-repository -y ppa:bitcoin/bitcoin - - sudo apt-get update - - sudo apt-get install libdb4.8-dev libdb4.8++-dev - git config --global user.email "dev@bitpay.com" - git config --global user.name "BitPay, Inc." script: - _mocha -R spec integration/regtest.js - _mocha -R spec --recursive +cache: + directories: + - platform/ubuntu + diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index 6ba69f21..ac4ffe71 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -1,9 +1,50 @@ #!/bin/bash root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." -cd "${root_dir}" options=`cat ${root_dir}/bin/config_options.sh` +h_and_a_dir=$($root_dir/platform/os.sh h_and_a_dir) +depends_dir=$($root_dir/platform/os.sh depends_dir) +os_dir=$(${root_dir}/platform/os.sh osdir) +host=$(${root_dir}/platform/os.sh host) +btc_dir="${root_dir}/libbitcoind" +ext=$($root_dir/platform/os.sh ext) +artifacts_dir=$($root_dir/platform/os.sh artifacts_dir) +echo "Using BTC directory: ${btc_dir}" -os_dir=$(./platform/os.sh osdir) +cd "${root_dir}" + +copy_header_files () { + if [[ -d "${artifacts_dir}" && -d "${h_and_a_dir}" && -d "${btc_dir}" ]]; then + mkdir -p "${artifacts_dir}/include" > /dev/null 2>&1 + pushd "${root_dir}" + find libbitcoind -type f \( -name "*.h" -or -name "*.hpp" -or -name "*.ipp" \) -print0 | xargs -0 -I{} rsync -R {} "${artifacts_dir}"/include + mkdir -p "${artifacts_dir}/lib" > /dev/null 2>&1 + cp -r "${h_and_a_dir}"/lib/libboost_filesystem-mt.a "${h_and_a_dir}"/lib/libboost_thread-mt.a "${artifacts_dir}"/lib/ + popd + fi +} + +build_dependencies () { + if [ -d "${btc_dir}" ]; then + pushd "${depends_dir}" + echo "using host for dependencies: ${host}" + boost_files_count=`find "${h_and_a_dir}"/lib -iname "libboost_*-mt.a" | wc -l | xargs` + db_files_count=`find "${h_and_a_dir}"/lib -iname "libdb*.a" | wc -l | xargs` + should_rebuild=false + if [[ "${boost_files_count}" -lt 5 || ( "${db_files_count}" -lt 1 && "${test}" = true ) ]]; then + should_rebuild=true + fi + if [ "${should_rebuild}" = true ]; then + if [ "${test}" = true ]; then + make HOST=${host} NO_QT=1 NO_UPNP=1 + else + make HOST=${host} NO_QT=1 NO_WALLET=1 NO_UPNP=1 + fi + else + echo "Looks like libs are already built, so we won't rebuild them. Incidentally, we found: ${boost_files_count} boost libraries and: ${db_files_count} Berkeley DB libraries and you have test mode set to: ${test}" + fi + popd + fi +} get_patch_file () { if test -e "${root_dir/PATCH_VERSION}"; then @@ -15,101 +56,121 @@ get_patch_file () { } compare_patch () { - cd "${root_dir}/libbitcoind" + cd "${btc_dir}" get_patch_file echo "running the diff command from HEAD to ${tag}" git diff ${tag}..HEAD > /tmp/tmp.patch #uncommitted changes won't affect things here matching_patch=`diff -w /tmp/tmp.patch "${root_dir}/etc/bitcoin.patch"` } -#set the LD_LIBRARY_PATH for the linux clients. -export LD_LIBRARY_PATH="${root_dir}/libbitcoind/src/leveldb":"${os_dir}":$LD_LIBRARY_PATH debug= if [ "${BITCOINDJS_ENV}" == "debug" ]; then options=`cat ${root_dir}/bin/config_options_debug.sh` fi -test= +test=false if [ "${BITCOINDJS_ENV}" == "test" ]; then + test=true options=`cat ${root_dir}/bin/config_options_test.sh` fi -btc_dir="${root_dir}/libbitcoind" -echo "Using BTC directory: ${btc_dir}" - -rm -f "${os_dir}/libbitcoind.*" -only_make=false -if [ -d "${root_dir}/libbitcoind" ]; then - echo "running compare patch..." - compare_patch - repatch=false - if [[ "${matching_patch}" =~ [^\s\\] ]]; then - echo "Warning! libbitcoind is not patched with:\ - ${root_dir}/etc/bitcoin.patch." - echo -n "Would you like to remove the current patch, checkout the tag: ${tag} and \ -apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " - if [ "${BITCOINDJS_ASSUME_YES}" = true ]; then - input=y - echo "" - else - read input - fi - if [[ "${input}" =~ ^y|^Y ]]; then - repatch=true - echo "Removing directory: \"${root_dir}/libbitcoind\" and starting over!" - rm -fr "${root_dir}"/libbitcoind - fi - fi - if [ "${repatch}" = false ]; then - echo "Running make inside libbitcoind (assuming you've previously patched and configured libbitcoind)..." - cd "${btc_dir}" - only_make=true - fi +patch_file_sha=$(shasum -a 256 "${root_dir}/etc/bitcoin.patch" | awk '{print $1}') +if [ "${ext}" == "dylib" ]; then + last_patch_file_sha=$(cat "${os_dir}"/lib/patch_sha.txt) +else + last_patch_file_sha=$(cat "${os_dir}"/patch_sha.txt) +fi +shared_file_built=false +if [[ "${last_patch_file_sha}" == "${patch_file_sha}" && -d "${artifacts_dir}/include" ]]; then + shared_file_built=true fi -set -e +if [ "${shared_file_built}" = false ]; then + only_make=false + if [ -d "${btc_dir}" ]; then + echo "running compare patch..." + compare_patch + repatch=false + if [[ "${matching_patch}" =~ [^\s\\] ]]; then + echo "Warning! libbitcoind is not patched with:\ + ${root_dir}/etc/bitcoin.patch." + echo -n "Would you like to remove the current patch, checkout the tag: ${tag} and \ +apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " + if [ "${BITCOINDJS_ASSUME_YES}" = true ]; then + input=y + echo "" + else + read input + fi + if [[ "${input}" =~ ^y|^Y ]]; then + repatch=true + rm -f "${os_dir}/libbitcoind.*" + echo "Removing directory: \"${btc_dir}\" and starting over!" + rm -fr "${btc_dir}" + fi + fi + if [ "${repatch}" = false ]; then + echo "Running make inside libbitcoind (assuming you've previously patched and configured libbitcoind)..." + cd "${btc_dir}" + only_make=true + fi + fi -if [ "${only_make}" = false ]; then - echo "Removing cloning, patching, and building libbitcoind..." - get_patch_file - echo "attempting to checkout tag: ${tag} of bitcoin from github..." - cd "${root_dir}" - git clone --depth 1 --branch "${tag}" https://github.com/bitcoin/bitcoin.git libbitcoind + if [ "${only_make}" = false ]; then + echo "Cloning, patching, and building libbitcoind..." + get_patch_file + echo "attempting to checkout tag: ${tag} of bitcoin from github..." + cd "${root_dir}" + git clone --depth 1 --branch "${tag}" https://github.com/bitcoin/bitcoin.git libbitcoind - cd "${btc_dir}" + cd "${btc_dir}" - echo '../patch-bitcoin.sh' "${btc_dir}" - ../bin/patch-bitcoin "${btc_dir}" + echo '../patch-bitcoin.sh' "${btc_dir}" + ../bin/patch-bitcoin "${btc_dir}" - if ! test -d .git; then - echo 'Please point this script to an upstream bitcoin git repo.' + if ! test -d .git; then + echo 'Please point this script to an upstream bitcoin git repo.' + exit 1 + fi + + fi + build_dependencies + echo './autogen.sh' + ./autogen.sh + + export CPPFLAGS="-I${h_and_a_dir}/include/boost -I${h_and_a_dir}/include -L${h_and_a_dir}/lib" + boost_libdir="--with-boost-libdir=${h_and_a_dir}/lib" + + full_options="${options} ${boost_libdir} --prefix=${os_dir}" + echo "running the configure script with the following options:\n :::[\"${full_options}\"]:::" + ${full_options} + + echo 'make V=1' + make V=1 + + echo 'Copying libbitcoind.{so|dylib} to its appropriate location.' + if test -e "${btc_dir}/src/.libs/libbitcoind.${ext}"; then + if [ "$ext" = "dylib" ]; then + if [ ! -d "${os_dir}/lib" ]; then + mkdir -p "${os_dir}/lib" + fi + cp -R "${btc_dir}"/src/.libs/libbitcoind.*dylib "${os_dir}/lib/" + else + if [ ! -d "${os_dir}" ]; then + mkdir -p "${os_dir}" + fi + cp -P "${btc_dir}"/src/.libs/libbitcoind.so* "${os_dir}/" + fi + echo "Creating the sha marker for the patching in libbitcoind..." + echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${artifacts_dir}"/patch_sha.txt + echo "Copying the header files in order to be cached..." + copy_header_files + else + echo "Could not find the shared libraries after they should have been built, please run make clean inside the libbitcoind dir and run npm install again." exit 1 fi - + echo 'Build finished successfully.' +else + echo 'Using existing shared library.' fi -echo './autogen.sh' -./autogen.sh -full_options="${options}${os_dir}" -echo "running the configure script with the following options:\n :::[\"${full_options}\"]:::" -${full_options} -echo 'make V=1' -make V=1 - -ext=$($root_dir/platform/os.sh ext) -echo 'Copying libbitcoind.{so|dylib} to its appropriate location.' -if test -e "${root_dir}/libbitcoind/src/.libs/libbitcoind.${ext}"; then - if [ "$ext" = "dylib" ]; then - if [ ! -d "${os_dir}/lib" ]; then - mkdir -p "${os_dir}/lib" - fi - cp -R "${root_dir}"/libbitcoind/src/.libs/libbitcoind.*dylib "${os_dir}/lib/" - else - if [ ! -d "${os_dir}" ]; then - mkdir -p "${os_dir}" - fi - cp -P "${root_dir}"/libbitcoind/src/.libs/libbitcoind.so* "${os_dir}/" - fi -fi - -echo 'Build finished successfully.' diff --git a/bin/config_options.sh b/bin/config_options.sh index 248bcb6a..d51d99a0 100644 --- a/bin/config_options.sh +++ b/bin/config_options.sh @@ -1,2 +1,2 @@ -./configure --enable-tests=no --enable-daemonlib --with-gui=no --without-qt --without-miniupnpc --without-bdb --disable-wallet --without-utils --prefix= +./configure --enable-tests=no --enable-daemonlib --with-gui=no --without-qt --without-miniupnpc --without-bdb --disable-wallet --without-utils diff --git a/bin/config_options_debug.sh b/bin/config_options_debug.sh index afacbc9f..fb5845e0 100644 --- a/bin/config_options_debug.sh +++ b/bin/config_options_debug.sh @@ -1,2 +1,2 @@ -./configure --enable-debug --enable-tests=no --enable-daemonlib --with-gui=no --without-qt --without-miniupnpc --without-bdb --disable-wallet --without-utils --prefix= +./configure --enable-debug --enable-tests=no --enable-daemonlib --with-gui=no --without-qt --without-miniupnpc --without-bdb --disable-wallet --without-utils diff --git a/bin/config_options_test.sh b/bin/config_options_test.sh index 225f7aa0..3ee83701 100644 --- a/bin/config_options_test.sh +++ b/bin/config_options_test.sh @@ -1,2 +1,2 @@ -./configure --enable-debug --enable-tests=no --enable-daemonlib --with-gui=no --without-qt --without-miniupnpc --prefix= +./configure --enable-debug --enable-tests=no --enable-daemonlib --with-gui=no --without-qt --without-miniupnpc diff --git a/binding.gyp b/binding.gyp old mode 100644 new mode 100755 index 8dfff9e8..08a19576 --- a/binding.gyp +++ b/binding.gyp @@ -3,10 +3,9 @@ 'target_name': 'bitcoindjs', 'include_dirs' : [ '\"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam + endef + diff --git a/src/Makefile.am b/src/Makefile.am -index 1c2f770..ddcae0f 100644 +index 1c2f770..d2eca15 100644 --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -1,6 +1,8 @@ +@@ -1,6 +1,12 @@ DIST_SUBDIRS = secp256k1 AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) +lib_LTLIBRARIES = +libbitcoind_la_LIBADD = ++libbitcoind_la_LDFLAGS = -no-undefined ++STATIC_BOOST_LIBS = ++STATIC_BDB_LIBS = ++STATIC_EXTRA_LIBS = $(STATIC_BOOST_LIBS) $(LIBLEVELDB) $(LIBMEMENV) if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include -@@ -15,6 +17,10 @@ $(LIBLEVELDB) $(LIBMEMENV): +@@ -15,6 +21,7 @@ $(LIBLEVELDB) $(LIBMEMENV): @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ OPT="$(CXXFLAGS) $(CPPFLAGS) -D__STDC_LIMIT_MACROS" -+ -+LIBLEVELDB_SHARED: -+ @echo "Building the LevelDB shared library..." && $(MAKE) -C ./leveldb + endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config -@@ -49,16 +55,16 @@ BITCOIN_INCLUDES += $(BDB_CPPFLAGS) +@@ -49,16 +56,16 @@ BITCOIN_INCLUDES += $(BDB_CPPFLAGS) EXTRA_LIBRARIES += libbitcoin_wallet.a endif @@ -127,7 +187,7 @@ index 1c2f770..ddcae0f 100644 if BUILD_BITCOIND bin_PROGRAMS += bitcoind endif -@@ -66,6 +72,9 @@ endif +@@ -66,6 +73,9 @@ endif if BUILD_BITCOIN_UTILS bin_PROGRAMS += bitcoin-cli bitcoin-tx endif @@ -137,18 +197,20 @@ index 1c2f770..ddcae0f 100644 .PHONY: FORCE # bitcoin core # -@@ -169,8 +178,9 @@ obj/build.h: FORCE +@@ -169,8 +179,11 @@ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) -libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h ++ARCH_PLATFORM = $(shell ../../platform/os.sh host) ++ +libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h +clientversion.cpp: obj/build.h # server: shared between bitcoind and bitcoin-qt libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) libbitcoin_server_a_SOURCES = \ -@@ -309,9 +319,18 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h +@@ -309,9 +322,18 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h bitcoind_SOURCES = bitcoind.cpp bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) @@ -167,26 +229,29 @@ index 1c2f770..ddcae0f 100644 endif bitcoind_LDADD = \ -@@ -326,9 +345,19 @@ bitcoind_LDADD = \ +@@ -326,10 +348,21 @@ bitcoind_LDADD = \ if ENABLE_WALLET bitcoind_LDADD += libbitcoin_wallet.a -+libbitcoind_la_LIBADD += $(BDB_LIBS) ++STATIC_EXTRA_LIBS += $(STATIC_BDB_LIBS) +libbitcoind_la_SOURCES += $(libbitcoin_wallet_a_SOURCES) endif -+MEMOBJ = helpers/memenv/memenv.lo -+$(MEMOBJ): -+ @echo "Building the Memenv shared library..." && $(MAKE) -C ./leveldb $@ ++STATIC_BOOST_LIBS += ../depends/$(ARCH_PLATFORM)/lib/libboost_filesystem-mt.a ../depends/$(ARCH_PLATFORM)/lib/libboost_system-mt.a ../depends/$(ARCH_PLATFORM)/lib/libboost_chrono-mt.a ../depends/$(ARCH_PLATFORM)/lib/libboost_thread-mt.a ../depends/$(ARCH_PLATFORM)/lib/libboost_program_options-mt.a ++STATIC_BDB_LIBS += ../depends/$(ARCH_PLATFORM)/lib/libdb_cxx.a + bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) -+libbitcoind_la_LIBADD += $(BOOST_LIBS) $(SSL_LIBS) $(LIBSECP256K1) $(CRYPTO_LIBS) leveldb/$(MEMOBJ) +-# ++libbitcoind_la_LIBADD += $(SSL_LIBS) $(LIBSECP256K1) $(CRYPTO_LIBS) $(STATIC_EXTRA_LIBS) +libbitcoind_la_CPPFLAGS = $(BITCOIN_INCLUDES) -+libbitcoind_la_LDFLAGS = -lleveldb -L./leveldb $(RELDFLAGS) -no-undefined -+libbitcoind_la_DEPENDENCIES = $(LIBSECP256K1) LIBLEVELDB_SHARED $(MEMOBJ) - # ++if TARGET_DARWIN ++libbitcoind_la_LDFLAGS += -Wl,-all_load ++else ++libbitcoind_la_LDFLAGS += -Wl,--whole-archive $(STATIC_EXTRA_LIBS) -Wl,--no-whole-archive ++endif # bitcoin-cli binary # + bitcoin_cli_SOURCES = bitcoin-cli.cpp diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index cce687a..0f162ff 100644 --- a/src/bitcoind.cpp @@ -232,28 +297,20 @@ index dcb2b29..5ce68ba 100644 bool ShutdownRequested(); void Shutdown(); diff --git a/src/leveldb/Makefile b/src/leveldb/Makefile -index 2bd2cad..490ba66 100644 +index 2bd2cad..a85d3ca 100644 --- a/src/leveldb/Makefile +++ b/src/leveldb/Makefile -@@ -103,7 +103,7 @@ check: all $(PROGRAMS) $(TESTS) - for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done +@@ -16,10 +16,9 @@ OPT ?= -O2 -DNDEBUG - clean: -- -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED) $(MEMENVLIBRARY) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk -+ -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED) $(MEMENVLIBRARY) */*.o */*/*.lo helpers/memenv/.deps/*.Plo helpers/memenv/.deps/*.Tpo */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk - -rm -rf ios-x86/* ios-arm/* - - $(LIBRARY): $(LIBOBJECTS) -@@ -192,6 +192,10 @@ $(MEMENVLIBRARY) : $(MEMENVOBJECTS) - rm -f $@ - $(AR) -rs $@ $(MEMENVOBJECTS) - -+helpers/memenv/memenv.lo: helpers/memenv/memenv.cc -+ -mkdir -p helpers/memenv/.deps -+ /bin/bash ../../libtool --tag=CXX --mode=compile $(CXX) $(CXXFLAGS) $(CFLAGS) -fPIC -MT $@ -MD -MP -MF helpers/memenv/.deps/memenv.Tpo -c -o $@ $< -+ - memenv_test : helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHARNESS) - $(CXX) $(LDFLAGS) helpers/memenv/memenv_test.o $(MEMENVLIBRARY) $(LIBRARY) $(TESTHARNESS) -o $@ $(LIBS) + # detect what platform we're building on + $(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \ +- ./build_detect_platform build_config.mk ./) ++ ./build_detect_platform build_config.mk .) + # this file is generated by the previous line to set build flags and sources + include build_config.mk +- + CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) + CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h index c65e842..0e44bb5 100644 diff --git a/example/index.js b/example/index.js index 98e5c7b4..7782b355 100755 --- a/example/index.js +++ b/example/index.js @@ -14,7 +14,6 @@ process.title = 'bitcoind.js'; var daemon = require('../').daemon({ datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin', - network: 'regtest' }); daemon.on('error', function(err) { diff --git a/platform/os.sh b/platform/os.sh index 14406da7..b1897183 100755 --- a/platform/os.sh +++ b/platform/os.sh @@ -6,7 +6,10 @@ root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." BITCOIN_DIR="${root_dir}/libbitcoind" os= ext=so -thread=-lboost_thread + +host=`uname -m`-`uname -a | awk '{print tolower($1)}'` +depends_dir="${BITCOIN_DIR}"/depends +h_and_a_dir="${depends_dir}"/"${host}" if test -f /etc/centos-release \ || grep -q 'CentOS' /etc/redhat-release \ @@ -20,7 +23,6 @@ elif test -f /etc/redhat_release \ elif uname -a | grep -q '^Darwin'; then os=osx ext=dylib - thread=-lboost_thread-mt elif test -f /etc/SuSE-release; then os=suse elif test -f /etc/mandrake-release \ @@ -48,6 +50,15 @@ fi os_dir=${root_dir}/platform/${os} +if [ "${os}" == "osx" ]; then + artifacts_dir="${os_dir}/lib" +else + artifacts_dir="${os_dir}" +fi + +thread="${artifacts_dir}"/lib/libboost_thread-mt.a +filesystem="${artifacts_dir}"/lib/libboost_filesystem-mt.a + if test -z "$os" -o x"$os" = x'android' -o x"$os" = x'aix'; then if test "$os" = 'android' -o "$os" = 'aix'; then echo 'Android or AIX detected!' >& 2 @@ -74,6 +85,34 @@ if test -z "$1" -o x"$1" = x'thread'; then echo -n "${thread}" fi +if test -z "$1" -o x"$1" = x'filesystem'; then + echo -n "${filesystem}" +fi + +if test -z "$1" -o x"$1" = x'depends_dir'; then + echo -n "${depends_dir}" +fi + +if test -z "$1" -o x"$1" = x'h_and_a_dir'; then + echo -n "${h_and_a_dir}" +fi + +if test -z "$1" -o x"$1" = x'host'; then + echo -n "${host}" +fi + +if test -z "$1" -o x"$1" = x'load_archive'; then + if [ "${os}" == "osx" ]; then + echo -n "-Wl,-all_load" + else + echo -n "-Wl,--whole-archive ${filesystem} ${thread} -Wl,--no-whole-archive" + fi +fi + +if test -z "$1" -o x"$1" = x'artifacts_dir'; then + echo -n "${artifacts_dir}" +fi + if test -z "$1" -o x"$1" = x'lib'; then if test -e "${os_dir}/libbitcoind.${ext}" -o -e "${os_dir}/lib/libbitcoind.${ext}"; then if test -e "${os_dir}/lib/libbitcoind.${ext}"; then