-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_all.sh
executable file
·124 lines (90 loc) · 2.1 KB
/
build_all.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
export NDK_ROOT="$NDK_ROOT"
if [ -z "$NDK_ROOT" ]; then
echo "Please set your NDK_ROOT environment variable first"
exit 1
fi
if [ ! -d "./toolchain" ]; then
mkdir toolchain
fi
APP_ABI=(
'arm'
'arm64'
'x86'
'x86_64'
# 'mips'
# 'mips64'
)
toolchains=(
'arm-linux-androideabi-4.9'
'aarch64-linux-android-4.9'
'x86-4.9'
'x86_64-4.9'
# 'mipsel-linux-android-4.9'
# 'mips64el-linux-android-4.9'
)
toolchains_build=(
'arm-linux-androideabi'
'aarch64-linux-android'
'i686-linux-android'
'x86_64-linux-android'
# 'mips-linux-android'
# 'mips64-linux-android'
)
num=${#APP_ABI[@]}
for ((i=0;i<$num;i++))
do
if [ ! -d "./toolchain/${APP_ABI[i]}" ]; then
$NDK_ROOT/build/tools/make-standalone-toolchain.sh --arch=${APP_ABI[i]} --install-dir=./toolchain/${APP_ABI[i]} --toolchain=${toolchains[i]} --force
fi
done
if [ ! -d "./source/zlib" ]; then
tar -zxvf ./source/zlib-1.2.11.tar.gz
mv -f ./zlib-1.2.11 ./source/zlib
fi
if [ ! -d "./source/openssl" ]; then
tar -zxvf ./source/openssl-1.1.1d.tar.gz
mv -f ./openssl-1.1.1d ./source/openssl
fi
if [ ! -d "./source/nghttp2" ]; then
tar -zxvf ./source/nghttp2-1.39.2.tar.gz
mv -f ./nghttp2-1.39.2 ./source/nghttp2
fi
if [ ! -d "./source/curl" ]; then
tar -zxvf ./source/curl-7.66.0.tar.gz
mv -f ./curl-7.66.0 ./source/curl
fi
build_for_zlib(){
chmod +x ./build_zlib.sh
for ((i=0;i<$num;i++))
do
sh ./build_zlib.sh ${APP_ABI[i]} ${toolchains[i]} ${toolchains_build[i]}
done
}
build_for_openssl(){
chmod +x ./build_openssl.sh
for ((i=0;i<$num;i++))
do
sh ./build_openssl.sh ${APP_ABI[i]} ${toolchains[i]} ${toolchains_build[i]}
done
}
build_for_nghttp2(){
chmod +x ./build_nghttp2.sh
for ((i=0;i<$num;i++))
do
sh ./build_nghttp2.sh ${APP_ABI[i]} ${toolchains[i]} ${toolchains_build[i]}
done
}
build_for_curl(){
chmod +x ./build_curl.sh
for ((i=0;i<$num;i++))
do
sh ./build_curl.sh ${APP_ABI[i]} ${toolchains[i]} ${toolchains_build[i]}
done
}
# echo '----1----'
build_for_zlib
build_for_openssl
build_for_nghttp2
build_for_curl
# sh build_openssl.sh