-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreatelibs
executable file
·52 lines (44 loc) · 1.01 KB
/
createlibs
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
#!/bin/bash
echo ""
print_usage() {
me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
echo ""
echo ""
echo " Usage: $me : <Target Architecture CPU> <Android NDK Path> <optional:job count>"
echo ""
echo " Target Architecture CPU : arm, x86 (comma seperated)"
echo " Android NDK Path : path to NDK"
echo " e.g. /android/android-ndk-r11c"
echo " Job Count : number of threads to build with"
echo ""
exit -1
}
build_lib() {
CPU=$1
./configure "$CPU" "$ANDROID_NDK"
ret=$?
if [ $ret -eq 0 ]; then
./build $CPU $ANDROID_NDK $JOBS
ret=$?
fi
return $ret
}
IFS=', ' read -r -a CPU_TYPES <<< "$1"
ANDROID_NDK=$2
JOBS=$3
if [ "$ANDROID_NDK" == "" ]; then
echo "Missing Android NDK Path parameter"
print_usage
fi
for i in "${CPU_TYPES[@]}"
do
build_lib "$i"
ret=$?
if [ $ret -ne 0 ]; then
echo "Could not create $i"
exit -1
fi
done
echo ""
echo "Finished creating libs"
echo ""