-
Notifications
You must be signed in to change notification settings - Fork 50
/
buildNativeAndroidTivi.sh
56 lines (42 loc) · 1.42 KB
/
buildNativeAndroidTivi.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
#!/usr/bin/env bash
# This script builds the specific variant of zrtpcpp as used by Silent Phone
# on Android. The script always runs on a clean build directory and copies
# the resulting static library to the SPA jni directory.
# The script requires some environment variables which are either set by the
# build system (Jenkins for example) or by a shell script that call this script.
set -x
if [ ! -d "${WORKSPACE}/silentphone2" ]; then
echo '***** Variable WORKSPACE does not point to correct directory *****'
exit 1
fi
if [ "x$ANDROID_NDK" = "x" ]; then
echo '***** Variable ANDROID_NDK not set *****'
exit 1
fi
#if [ "x$SC_BUILD_TYPE" = "xDEVELOP" ]; then
# BUILD_TYPE=Debug
# echo "*** building develop configuration"
#else
# BUILD_TYPE="Release"
# echo "*** building release configuration"
#fi
# remove old build dir and files that may hang around after an unsuccessful build
rm -rf buildTiviAndroid
rm -f buildinfo_*.c
mkdir buildTiviAndroid
pushd buildTiviAndroid
cmake -DTIVI=true -DBUILD_STATIC=true -DAXO=true -DANDROID=true .. # -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
pushd clients/tivi/android
if ndk-build; then
echo "ZRTPCPP Android build OK."
else
echo "ZRTPCPP Android build failed!"
exit 1
fi
cp obj/local/armeabi-v7a/libzrtpcpp.a ${WORKSPACE}/silentphone2/jni/armeabi-v7a/
popd
popd
# remove build dir and generated temporary files
rm -rf buildTiviAndroid
rm buildinfo_*.c
exit 0