-
Notifications
You must be signed in to change notification settings - Fork 91
/
build_android_fat.sh
executable file
·50 lines (38 loc) · 1011 Bytes
/
build_android_fat.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
#!/bin/bash
set -e
if [ -z ${FIPS} ]; then
FIPS=false
fi
mkdir -p build_android/output_fat && cd build_android
# Build all the native modules
for ARCH in armeabi-v7a x86 x86_64 arm64-v8a
do
mkdir build_android_${ARCH}
cd build_android_${ARCH}
if [ "${ARCH}" != "arm64-v8a" ]; then
_FIPS=false
else
_FIPS=${FIPS}
fi
_FLAGS="-s"
echo "Building for arch ${ARCH}. FIPS=${_FIPS} AWS_LC=${AWS_LC} FLAGS=${_FLAGS}"
cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DBUILD_OPENSSL=true \
-DANDROID_NATIVE_API_LEVEL=21 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS=${_FLAGS} \
-DFIPS=${_FIPS} \
-DANDROID_ABI=${ARCH} \
-DCMAKE_INSTALL_PREFIX=../output_fat \
-DBUILD_JAVA=ON ../../
make
make install
cd ..
done
cd output_fat/android
chmod +x gradlew
./gradlew assembleRelease || exit $?
if [ "$1" == "--push" ]; then
./gradlew artifactoryPublish || exit $?
fi
exit $?