-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·77 lines (62 loc) · 1.6 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -e
while getopts "a:" opt; do
case $opt in
a)
ARCH=$OPTARG ;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
if [[ -z "${ARCH}" ]] ; then
echo 'You need to input arch with -a ARCH.'
echo 'Supported archs are:'
echo -e '\tarm arm64 x86 x86_64'
exit 1
fi
source ../../AVP/android-setup-light.sh
LOCAL_PATH=$($READLINK -f .)
case "${ARCH}" in
'arm')
ABI='armeabi-v7a' ;;
'arm64')
ABI='arm64-v8a' ;;
'x86')
ABI='x86' ;;
'x86_64')
ABI='x86_64' ;;
*)
echo "Arch ${ARCH} is not supported."
exit 1 ;;
esac
if [ ! -d libtorrent ]; then
git clone --recursive https://github.com/arvidn/libtorrent -b v2.0.10
fi
cd libtorrent
export BOOST_VERSION=1.84.0
export BOOST_ROOT=${REPO_TOP_DIR}/native/boost/boost-${BOOST_VERSION}
BOOST=boost-${BOOST_VERSION}
echo BOOST_ROOT $BOOST_ROOT
export BOOST_BUILD_PATH=$REPO_TOP_DIR/native/boost/boost-${BOOST_VERSION}-${ABI}
echo BOOST_BUILD_PATH $BOOST_BUILD_PATH
$BOOST_ROOT/b2 \
--build-dir=../../boost/${BOOST}-${ABI} \
--stagedir=../../boost/${BOOST}-${ABI}/stage \
--user-config=../../boost/${BOOST}-${ABI}/user-config.jam \
openssl-lib=${REPO_TOP_DIR}/native/openssl-android-builder/dist-${ABI}/lib \
openssl-include=${REPO_TOP_DIR}/native/openssl-android-builder/dist-${ABI}/include \
crypto=openssl \
cxxstd=14 \
binary-format=elf \
variant=release \
threading=multi \
threadapi=pthread \
toolset=clang-android \
link=static \
runtime-link=static \
target-os=android \
release \
-j${CORES}
echo "Done!"