Merge pull request #54 from kleetus/faster_travis
Added support for using internal dependencies (boost).
This commit is contained in:
commit
2c8ae04af1
11
.travis.yml
11
.travis.yml
|
@ -1,15 +1,16 @@
|
||||||
|
sudo: false
|
||||||
language: node_js
|
language: node_js
|
||||||
env:
|
env:
|
||||||
- BITCOINDJS_ENV=test
|
- BITCOINDJS_ENV=test BITCOINDJS_ASSUME_YES=true
|
||||||
node_js:
|
node_js:
|
||||||
- "0.12"
|
- "0.12"
|
||||||
before_install:
|
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.email "dev@bitpay.com"
|
||||||
- git config --global user.name "BitPay, Inc."
|
- git config --global user.name "BitPay, Inc."
|
||||||
script:
|
script:
|
||||||
- _mocha -R spec integration/regtest.js
|
- _mocha -R spec integration/regtest.js
|
||||||
- _mocha -R spec --recursive
|
- _mocha -R spec --recursive
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- platform/ubuntu
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,50 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
|
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
|
||||||
cd "${root_dir}"
|
|
||||||
options=`cat ${root_dir}/bin/config_options.sh`
|
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 () {
|
get_patch_file () {
|
||||||
if test -e "${root_dir/PATCH_VERSION}"; then
|
if test -e "${root_dir/PATCH_VERSION}"; then
|
||||||
|
@ -15,101 +56,121 @@ get_patch_file () {
|
||||||
}
|
}
|
||||||
|
|
||||||
compare_patch () {
|
compare_patch () {
|
||||||
cd "${root_dir}/libbitcoind"
|
cd "${btc_dir}"
|
||||||
get_patch_file
|
get_patch_file
|
||||||
echo "running the diff command from HEAD to ${tag}"
|
echo "running the diff command from HEAD to ${tag}"
|
||||||
git diff ${tag}..HEAD > /tmp/tmp.patch #uncommitted changes won't affect things here
|
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"`
|
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=
|
debug=
|
||||||
if [ "${BITCOINDJS_ENV}" == "debug" ]; then
|
if [ "${BITCOINDJS_ENV}" == "debug" ]; then
|
||||||
options=`cat ${root_dir}/bin/config_options_debug.sh`
|
options=`cat ${root_dir}/bin/config_options_debug.sh`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test=
|
test=false
|
||||||
if [ "${BITCOINDJS_ENV}" == "test" ]; then
|
if [ "${BITCOINDJS_ENV}" == "test" ]; then
|
||||||
|
test=true
|
||||||
options=`cat ${root_dir}/bin/config_options_test.sh`
|
options=`cat ${root_dir}/bin/config_options_test.sh`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
btc_dir="${root_dir}/libbitcoind"
|
patch_file_sha=$(shasum -a 256 "${root_dir}/etc/bitcoin.patch" | awk '{print $1}')
|
||||||
echo "Using BTC directory: ${btc_dir}"
|
if [ "${ext}" == "dylib" ]; then
|
||||||
|
last_patch_file_sha=$(cat "${os_dir}"/lib/patch_sha.txt)
|
||||||
rm -f "${os_dir}/libbitcoind.*"
|
else
|
||||||
only_make=false
|
last_patch_file_sha=$(cat "${os_dir}"/patch_sha.txt)
|
||||||
if [ -d "${root_dir}/libbitcoind" ]; then
|
fi
|
||||||
echo "running compare patch..."
|
shared_file_built=false
|
||||||
compare_patch
|
if [[ "${last_patch_file_sha}" == "${patch_file_sha}" && -d "${artifacts_dir}/include" ]]; then
|
||||||
repatch=false
|
shared_file_built=true
|
||||||
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
|
|
||||||
fi
|
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
|
if [ "${only_make}" = false ]; then
|
||||||
echo "Removing cloning, patching, and building libbitcoind..."
|
echo "Cloning, patching, and building libbitcoind..."
|
||||||
get_patch_file
|
get_patch_file
|
||||||
echo "attempting to checkout tag: ${tag} of bitcoin from github..."
|
echo "attempting to checkout tag: ${tag} of bitcoin from github..."
|
||||||
cd "${root_dir}"
|
cd "${root_dir}"
|
||||||
git clone --depth 1 --branch "${tag}" https://github.com/bitcoin/bitcoin.git libbitcoind
|
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}"
|
echo '../patch-bitcoin.sh' "${btc_dir}"
|
||||||
../bin/patch-bitcoin "${btc_dir}"
|
../bin/patch-bitcoin "${btc_dir}"
|
||||||
|
|
||||||
if ! test -d .git; then
|
if ! test -d .git; then
|
||||||
echo 'Please point this script to an upstream bitcoin git repo.'
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo 'Build finished successfully.'
|
||||||
|
else
|
||||||
|
echo 'Using existing shared library.'
|
||||||
fi
|
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.'
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
'target_name': 'bitcoindjs',
|
'target_name': 'bitcoindjs',
|
||||||
'include_dirs' : [
|
'include_dirs' : [
|
||||||
'<!(node -e "require(\'nan\')")',
|
'<!(node -e "require(\'nan\')")',
|
||||||
'/usr/include/boost',
|
'<!(./platform/os.sh artifacts_dir)/include/libbitcoind/src',
|
||||||
'/usr/local/include',
|
'<!(./platform/os.sh artifacts_dir)/include/libbitcoind/depends/<!(./platform/os.sh host)/include',
|
||||||
'./libbitcoind/src/leveldb/include',
|
'<!(./platform/os.sh artifacts_dir)/include/libbitcoind/src/leveldb/include'
|
||||||
'./libbitcoind/src',
|
|
||||||
],
|
],
|
||||||
'sources': [
|
'sources': [
|
||||||
'./src/bitcoindjs.cc',
|
'./src/bitcoindjs.cc',
|
||||||
|
@ -28,13 +27,13 @@
|
||||||
],
|
],
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
'-lboost_filesystem',
|
'<!(./platform/os.sh filesystem)',
|
||||||
'-L/usr/local/lib',
|
|
||||||
'<!(./platform/os.sh thread)',
|
'<!(./platform/os.sh thread)',
|
||||||
'<!(./platform/os.sh lib)'
|
'<!(./platform/os.sh lib)'
|
||||||
],
|
],
|
||||||
'ldflags': [
|
'ldflags': [
|
||||||
'-Wl,-rpath,<!(./platform/os.sh osdir),-rpath,<!(./platform/os.sh btcdir)/src/leveldb'
|
'-Wl,-rpath,<!(./platform/os.sh osdir)',
|
||||||
|
'<!(./platform/os.sh load_archive)'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
|
@ -79,31 +79,91 @@ index 37fe47e..83cfe70 100644
|
||||||
LEVELDB_CPPFLAGS=
|
LEVELDB_CPPFLAGS=
|
||||||
LIBLEVELDB=
|
LIBLEVELDB=
|
||||||
LIBMEMENV=
|
LIBMEMENV=
|
||||||
|
diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk
|
||||||
|
index 68841af..65a105b 100644
|
||||||
|
--- a/depends/packages/bdb.mk
|
||||||
|
+++ b/depends/packages/bdb.mk
|
||||||
|
@@ -9,6 +9,7 @@ define $(package)_set_vars
|
||||||
|
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
|
||||||
|
$(package)_config_opts_mingw32=--enable-mingw
|
||||||
|
$(package)_config_opts_linux=--with-pic
|
||||||
|
+$(package)_cxxflags_darwin=-stdlib=libc++
|
||||||
|
endef
|
||||||
|
|
||||||
|
define $(package)_preprocess_cmds
|
||||||
|
diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk
|
||||||
|
index e7aa48d..df0f7ae 100644
|
||||||
|
--- a/depends/packages/boost.mk
|
||||||
|
+++ b/depends/packages/boost.mk
|
||||||
|
@@ -1,9 +1,8 @@
|
||||||
|
package=boost
|
||||||
|
-$(package)_version=1_55_0
|
||||||
|
-$(package)_download_path=http://sourceforge.net/projects/boost/files/boost/1.55.0
|
||||||
|
+$(package)_version=1_57_0
|
||||||
|
+$(package)_download_path=http://sourceforge.net/projects/boost/files/boost/1.57.0
|
||||||
|
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
|
||||||
|
-$(package)_sha256_hash=fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52
|
||||||
|
-$(package)_patches=darwin_boost_atomic-1.patch darwin_boost_atomic-2.patch gcc_5_no_cxx11.patch
|
||||||
|
+$(package)_sha256_hash=910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967
|
||||||
|
|
||||||
|
define $(package)_set_vars
|
||||||
|
$(package)_config_opts_release=variant=release
|
||||||
|
@@ -11,7 +10,7 @@ $(package)_config_opts_debug=variant=debug
|
||||||
|
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
|
||||||
|
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
|
||||||
|
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
|
||||||
|
-$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
|
||||||
|
+$(package)_config_opts_darwin=--toolset=clang runtime-link=shared
|
||||||
|
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||||
|
$(package)_config_opts_x86_64_mingw32=address-model=64
|
||||||
|
$(package)_config_opts_i686_mingw32=address-model=32
|
||||||
|
@@ -20,15 +19,14 @@ $(package)_toolset_$(host_os)=gcc
|
||||||
|
$(package)_archiver_$(host_os)=$($(package)_ar)
|
||||||
|
$(package)_toolset_darwin=darwin
|
||||||
|
$(package)_archiver_darwin=$($(package)_libtool)
|
||||||
|
-$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test
|
||||||
|
-$(package)_cxxflags=-fvisibility=hidden
|
||||||
|
-$(package)_cxxflags_linux=-fPIC
|
||||||
|
+$(package)_config_libraries=chrono,filesystem,program_options,system,thread
|
||||||
|
+$(package)_cxxflags=-fvisibility=default -fPIC
|
||||||
|
+$(package)_cxxflags_darwin=-std=c++11 -stdlib=libc++
|
||||||
|
+$(package)_linkflags=-stdlib=libc++
|
||||||
|
endef
|
||||||
|
|
||||||
|
+
|
||||||
|
define $(package)_preprocess_cmds
|
||||||
|
- patch -p2 < $($(package)_patch_dir)/darwin_boost_atomic-1.patch && \
|
||||||
|
- patch -p2 < $($(package)_patch_dir)/darwin_boost_atomic-2.patch && \
|
||||||
|
- patch -p2 < $($(package)_patch_dir)/gcc_5_no_cxx11.patch && \
|
||||||
|
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
|
||||||
|
endef
|
||||||
|
|
||||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||||
index 1c2f770..ddcae0f 100644
|
index 1c2f770..d2eca15 100644
|
||||||
--- a/src/Makefile.am
|
--- a/src/Makefile.am
|
||||||
+++ b/src/Makefile.am
|
+++ b/src/Makefile.am
|
||||||
@@ -1,6 +1,8 @@
|
@@ -1,6 +1,12 @@
|
||||||
DIST_SUBDIRS = secp256k1
|
DIST_SUBDIRS = secp256k1
|
||||||
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
|
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
|
||||||
|
|
||||||
+lib_LTLIBRARIES =
|
+lib_LTLIBRARIES =
|
||||||
+libbitcoind_la_LIBADD =
|
+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
|
if EMBEDDED_LEVELDB
|
||||||
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
|
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)" \
|
@echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
|
||||||
CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
|
CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
|
||||||
OPT="$(CXXFLAGS) $(CPPFLAGS) -D__STDC_LIMIT_MACROS"
|
OPT="$(CXXFLAGS) $(CPPFLAGS) -D__STDC_LIMIT_MACROS"
|
||||||
+
|
|
||||||
+LIBLEVELDB_SHARED:
|
|
||||||
+ @echo "Building the LevelDB shared library..." && $(MAKE) -C ./leveldb
|
|
||||||
+
|
+
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
|
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
|
EXTRA_LIBRARIES += libbitcoin_wallet.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -127,7 +187,7 @@ index 1c2f770..ddcae0f 100644
|
||||||
if BUILD_BITCOIND
|
if BUILD_BITCOIND
|
||||||
bin_PROGRAMS += bitcoind
|
bin_PROGRAMS += bitcoind
|
||||||
endif
|
endif
|
||||||
@@ -66,6 +72,9 @@ endif
|
@@ -66,6 +73,9 @@ endif
|
||||||
if BUILD_BITCOIN_UTILS
|
if BUILD_BITCOIN_UTILS
|
||||||
bin_PROGRAMS += bitcoin-cli bitcoin-tx
|
bin_PROGRAMS += bitcoin-cli bitcoin-tx
|
||||||
endif
|
endif
|
||||||
|
@ -137,18 +197,20 @@ index 1c2f770..ddcae0f 100644
|
||||||
|
|
||||||
.PHONY: FORCE
|
.PHONY: FORCE
|
||||||
# bitcoin core #
|
# bitcoin core #
|
||||||
@@ -169,8 +178,9 @@ obj/build.h: FORCE
|
@@ -169,8 +179,11 @@ obj/build.h: FORCE
|
||||||
@$(MKDIR_P) $(builddir)/obj
|
@$(MKDIR_P) $(builddir)/obj
|
||||||
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
|
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
|
||||||
$(abs_top_srcdir)
|
$(abs_top_srcdir)
|
||||||
-libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
|
-libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
|
||||||
|
|
||||||
|
+ARCH_PLATFORM = $(shell ../../platform/os.sh host)
|
||||||
|
+
|
||||||
+libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
|
+libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
|
||||||
+clientversion.cpp: obj/build.h
|
+clientversion.cpp: obj/build.h
|
||||||
# server: shared between bitcoind and bitcoin-qt
|
# server: shared between bitcoind and bitcoin-qt
|
||||||
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
|
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
|
||||||
libbitcoin_server_a_SOURCES = \
|
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_SOURCES = bitcoind.cpp
|
||||||
bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
|
bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
|
||||||
bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||||
|
@ -167,26 +229,29 @@ index 1c2f770..ddcae0f 100644
|
||||||
endif
|
endif
|
||||||
|
|
||||||
bitcoind_LDADD = \
|
bitcoind_LDADD = \
|
||||||
@@ -326,9 +345,19 @@ bitcoind_LDADD = \
|
@@ -326,10 +348,21 @@ bitcoind_LDADD = \
|
||||||
|
|
||||||
if ENABLE_WALLET
|
if ENABLE_WALLET
|
||||||
bitcoind_LDADD += libbitcoin_wallet.a
|
bitcoind_LDADD += libbitcoin_wallet.a
|
||||||
+libbitcoind_la_LIBADD += $(BDB_LIBS)
|
+STATIC_EXTRA_LIBS += $(STATIC_BDB_LIBS)
|
||||||
+libbitcoind_la_SOURCES += $(libbitcoin_wallet_a_SOURCES)
|
+libbitcoind_la_SOURCES += $(libbitcoin_wallet_a_SOURCES)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
+MEMOBJ = helpers/memenv/memenv.lo
|
+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
|
||||||
+$(MEMOBJ):
|
+STATIC_BDB_LIBS += ../depends/$(ARCH_PLATFORM)/lib/libdb_cxx.a
|
||||||
+ @echo "Building the Memenv shared library..." && $(MAKE) -C ./leveldb $@
|
|
||||||
+
|
+
|
||||||
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
|
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_CPPFLAGS = $(BITCOIN_INCLUDES)
|
||||||
+libbitcoind_la_LDFLAGS = -lleveldb -L./leveldb $(RELDFLAGS) -no-undefined
|
+if TARGET_DARWIN
|
||||||
+libbitcoind_la_DEPENDENCIES = $(LIBSECP256K1) LIBLEVELDB_SHARED $(MEMOBJ)
|
+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 binary #
|
||||||
|
bitcoin_cli_SOURCES = bitcoin-cli.cpp
|
||||||
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
|
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
|
||||||
index cce687a..0f162ff 100644
|
index cce687a..0f162ff 100644
|
||||||
--- a/src/bitcoind.cpp
|
--- a/src/bitcoind.cpp
|
||||||
|
@ -232,28 +297,20 @@ index dcb2b29..5ce68ba 100644
|
||||||
bool ShutdownRequested();
|
bool ShutdownRequested();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
diff --git a/src/leveldb/Makefile b/src/leveldb/Makefile
|
diff --git a/src/leveldb/Makefile b/src/leveldb/Makefile
|
||||||
index 2bd2cad..490ba66 100644
|
index 2bd2cad..a85d3ca 100644
|
||||||
--- a/src/leveldb/Makefile
|
--- a/src/leveldb/Makefile
|
||||||
+++ b/src/leveldb/Makefile
|
+++ b/src/leveldb/Makefile
|
||||||
@@ -103,7 +103,7 @@ check: all $(PROGRAMS) $(TESTS)
|
@@ -16,10 +16,9 @@ OPT ?= -O2 -DNDEBUG
|
||||||
for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done
|
|
||||||
|
|
||||||
clean:
|
# detect what platform we're building on
|
||||||
- -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED) $(MEMENVLIBRARY) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk
|
$(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \
|
||||||
+ -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
|
- ./build_detect_platform build_config.mk ./)
|
||||||
-rm -rf ios-x86/* ios-arm/*
|
+ ./build_detect_platform build_config.mk .)
|
||||||
|
# this file is generated by the previous line to set build flags and sources
|
||||||
$(LIBRARY): $(LIBOBJECTS)
|
include build_config.mk
|
||||||
@@ -192,6 +192,10 @@ $(MEMENVLIBRARY) : $(MEMENVOBJECTS)
|
-
|
||||||
rm -f $@
|
CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
||||||
$(AR) -rs $@ $(MEMENVOBJECTS)
|
CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
|
||||||
|
|
||||||
+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)
|
|
||||||
|
|
||||||
diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h
|
diff --git a/src/leveldbwrapper.h b/src/leveldbwrapper.h
|
||||||
index c65e842..0e44bb5 100644
|
index c65e842..0e44bb5 100644
|
||||||
|
|
|
@ -14,7 +14,6 @@ process.title = 'bitcoind.js';
|
||||||
|
|
||||||
var daemon = require('../').daemon({
|
var daemon = require('../').daemon({
|
||||||
datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin',
|
datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin',
|
||||||
network: 'regtest'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
daemon.on('error', function(err) {
|
daemon.on('error', function(err) {
|
||||||
|
|
|
@ -6,7 +6,10 @@ root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
|
||||||
BITCOIN_DIR="${root_dir}/libbitcoind"
|
BITCOIN_DIR="${root_dir}/libbitcoind"
|
||||||
os=
|
os=
|
||||||
ext=so
|
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 \
|
if test -f /etc/centos-release \
|
||||||
|| grep -q 'CentOS' /etc/redhat-release \
|
|| grep -q 'CentOS' /etc/redhat-release \
|
||||||
|
@ -20,7 +23,6 @@ elif test -f /etc/redhat_release \
|
||||||
elif uname -a | grep -q '^Darwin'; then
|
elif uname -a | grep -q '^Darwin'; then
|
||||||
os=osx
|
os=osx
|
||||||
ext=dylib
|
ext=dylib
|
||||||
thread=-lboost_thread-mt
|
|
||||||
elif test -f /etc/SuSE-release; then
|
elif test -f /etc/SuSE-release; then
|
||||||
os=suse
|
os=suse
|
||||||
elif test -f /etc/mandrake-release \
|
elif test -f /etc/mandrake-release \
|
||||||
|
@ -48,6 +50,15 @@ fi
|
||||||
|
|
||||||
os_dir=${root_dir}/platform/${os}
|
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 -z "$os" -o x"$os" = x'android' -o x"$os" = x'aix'; then
|
||||||
if test "$os" = 'android' -o "$os" = 'aix'; then
|
if test "$os" = 'android' -o "$os" = 'aix'; then
|
||||||
echo 'Android or AIX detected!' >& 2
|
echo 'Android or AIX detected!' >& 2
|
||||||
|
@ -74,6 +85,34 @@ if test -z "$1" -o x"$1" = x'thread'; then
|
||||||
echo -n "${thread}"
|
echo -n "${thread}"
|
||||||
fi
|
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 -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}/libbitcoind.${ext}" -o -e "${os_dir}/lib/libbitcoind.${ext}"; then
|
||||||
if test -e "${os_dir}/lib/libbitcoind.${ext}"; then
|
if test -e "${os_dir}/lib/libbitcoind.${ext}"; then
|
||||||
|
|
Loading…
Reference in New Issue