-
Notifications
You must be signed in to change notification settings - Fork 30
/
build-openssl.sh
executable file
·67 lines (52 loc) · 1.52 KB
/
build-openssl.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
#!/bin/bash
OPENSSL_SUBMODULE_PATH="app/src/main/cpplibs/openssl"
if [ -f "openssl.conf" ] ; then
. openssl.conf
elif [ -f "openssl.conf.example" ]; then
echo "Could not found openssl.conf!"
echo "Try it with openssl.conf.example ..."
. openssl.conf.example
else
echo "You need to create a openssl.conf or have at least the default openssl.conf.example in this folder!"
exit 1
fi
if [ ! -d "$OPENSSL_SUBMODULE_PATH" ]; then
echo "Could not find openssl at $OPENSSL_SUBMODULE_PATH. Seems the submodules are not initialized yet."
exit 1
fi
cd $OPENSSL_SUBMODULE_PATH
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST_TAG
PATH=$TOOLCHAIN/bin:$PATH
./config no-asm -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)'
# arm64
export TARGET_HOST=aarch64-linux-android
./Configure android-arm64 no-shared \
-D__ANDROID_API__=$MIN_SDK_VERSION \
--prefix=$PWD/build/arm64-v8a
make -j"$THREADS"
make install_sw
make clean
# arm
export TARGET_HOST=armv7a-linux-androideabi
./Configure android-arm no-shared \
-D__ANDROID_API__=$MIN_SDK_VERSION \
--prefix=$PWD/build/armeabi-v7a
make -j"$THREADS"
make install_sw
make clean
# x86
export TARGET_HOST=i686-linux-android
./Configure android-x86 no-shared \
-D__ANDROID_API__=$MIN_SDK_VERSION \
--prefix=$PWD/build/x86
make -j"$THREADS"
make install_sw
make clean
# x64
export TARGET_HOST=x86_64-linux-android
./Configure android-x86_64 no-shared \
-D__ANDROID_API__=$MIN_SDK_VERSION \
--prefix=$PWD/build/x86_64
make -j"$THREADS"
make install_sw
make clean