fixed threading path and the os dir path.

This commit is contained in:
k 2015-07-06 18:38:09 -04:00
parent 49808a64ac
commit e0cf86be4e
3 changed files with 27 additions and 24 deletions

View File

@ -2,10 +2,13 @@
set -e
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
cd "$root_dir"
cd "${root_dir}"
os_dir=$(./platform/os.sh osdir)
#set the LD_LIBRARY_PATH for the linux clients.
export LD_LIBRARY_PATH="${root_dir}/libbitcoind/src/leveldb":"${os_dir}":$LD_LIBRARY_PATH
if test -e "${os_dir}/libbitcoind.so" || test -e "${os_dir}/libbitcoind.dylib"; then
read -r -p 'libbitcoind already built. Rebuild? (Y/n): ' choice
if test x"$choice" != x'y' -a x"$choice" != x'Y'; then
@ -59,9 +62,14 @@ make V=1
echo 'Copying libbitcoind.{so|dylib} to its appropriate location.'
if test -e "${os_dir}/libbitcoind.so"
mv src/libbitcoind.so "${os_dir}/libbitcoind.so"
mv src/libbitcoind.so "${os_dir}/libbitcoind.so.0.0.0"
cd "${os_dir}"
ln -s libbitcoind.so.0.0.0 libbitcoind.so.0
ln -s libbitcoind.so.0.0.0 libbitcoind.so
elif test -e "${os_dir}/libbitcoind.dylib"; then
mv src/libbitcoind.dylib "${os_dir}/libbitcoind.dylib"
mv src/libbitcoind.dylib "${os_dir}/libbitcoind.0.dylib"
cd "${os_dir}"
ln -s libbitcoind.0.dylib libbitcoind.dylib
fi
echo 'Build finished successfully.'

View File

@ -27,8 +27,8 @@
],
'libraries': [
'-lboost_filesystem',
'-lboost_thread',
'-lbitcoind'
'<!(./platform/os.sh thread)',
'<!(./platform/os.sh lib)'
]
}]
}

View File

@ -2,22 +2,11 @@
exec 2> /dev/null
btcdir() {
if test -d "$(pwd)/libbitcoind"; then
BITCOIN_DIR="$(pwd)/libbitcoind"
elif test -d "${HOME}/bitcoin"; then
BITCOIN_DIR="${HOME}/bitcoin"
fi
}
if test x"$1" = x'btcdir'; then
btcdir
echo $BITCOIN_DIR
exit 0
fi
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
BITCOIN_DIR="${root_dir}/libbitcoind"
os=
ext=so
thread=-lboost_thread
if test -f /etc/centos-release \
|| grep -q 'CentOS' /etc/redhat-release \
@ -31,6 +20,7 @@ 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 \
@ -56,8 +46,9 @@ elif test -d /system && test -d /data/data; then
os=android
fi
os_dir=${root_dir}/platform/${os}
if test -z "$os" -o x"$os" = x'android' -o x"$os" = x'aix'; then
# Maybe someday...
if test "$os" = 'android' -o "$os" = 'aix'; then
echo 'Android or AIX detected!' >& 2
fi
@ -69,12 +60,16 @@ if test x"$1" = x'osdir'; then
echo -n "$(pwd)/platform/${os}"
exit 0
fi
if test -z "$1" -o x"$1" = x'thread'; then
echo -n "${thread}"
fi
if test -z "$1" -o x"$1" = x'lib'; then
btcdir
if test -n "${BITCOIN_DIR}" -a -e "${BITCOIN_DIR}/src/.libs/libbitcoind.${ext}"; then
echo -n "${BITCOIN_DIR}/src/.libs/libbitcoind.${ext}"
else
if test -e "${os_dir}/libbitcoind.${ext}"; then
echo -n "$(pwd)/platform/${os}/libbitcoind.${ext}"
else
echo -n "${BITCOIN_DIR}/src/.libs/libbitcoind.${ext}"
fi
exit 0
fi