2016-02-01 17:22:10 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-07-24 22:22:22 +03:00
|
|
|
SCM_URL=https://github.com/openssl/openssl/releases/download/
|
|
|
|
SCM_TAG=openssl-3.3.1
|
|
|
|
SCM_HASH=777cd596284c883375a2a7a11bf5d2786fc5413255efab20c50d6ffe6d020b7e
|
2016-02-01 17:22:10 +03:00
|
|
|
|
|
|
|
COMPILER=4.9
|
|
|
|
|
|
|
|
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
|
|
|
|
|
|
|
function build {
|
2020-04-08 13:37:36 +03:00
|
|
|
if [ $# -ne 2 ];
|
2016-02-01 17:22:10 +03:00
|
|
|
then
|
|
|
|
echo "Invalid arguments $@"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
CONFIG=$1
|
2020-04-08 13:37:36 +03:00
|
|
|
DST_PREFIX=$2
|
2016-02-01 17:22:10 +03:00
|
|
|
|
2020-04-08 13:37:36 +03:00
|
|
|
common_run export CC=clang
|
|
|
|
common_run export PATH=$(${SCRIPT_PATH}/toolchains_path.py --ndk ${ANDROID_NDK}):$ORG_PATH
|
2020-11-15 06:38:11 +03:00
|
|
|
common_run export ANDROID_NDK
|
2016-02-01 17:22:10 +03:00
|
|
|
|
|
|
|
echo "CONFIG=$CONFIG"
|
|
|
|
echo "DST_PREFIX=$DST_PREFIX"
|
|
|
|
echo "PATH=$PATH"
|
|
|
|
|
|
|
|
BASE=$(pwd)
|
|
|
|
DST_DIR=$BUILD_DST/$DST_PREFIX
|
|
|
|
common_run cd $BUILD_SRC
|
2020-04-08 13:37:36 +03:00
|
|
|
common_run ./Configure ${CONFIG} -D__ANDROID_API__=$NDK_TARGET
|
|
|
|
common_run make SHLIB_EXT=.so -j build_libs
|
2016-02-01 17:22:10 +03:00
|
|
|
|
|
|
|
if [ ! -d $DST_DIR ];
|
|
|
|
then
|
|
|
|
common_run mkdir -p $DST_DIR
|
|
|
|
fi
|
|
|
|
|
2020-04-08 13:37:36 +03:00
|
|
|
common_run cp *.so $DST_DIR/
|
2016-02-01 17:22:10 +03:00
|
|
|
common_run cd $BASE
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run the main program.
|
|
|
|
common_parse_arguments $@
|
2024-07-24 22:22:22 +03:00
|
|
|
common_update "$SCM_URL/$SCM_TAG" $SCM_TAG $BUILD_SRC $SCM_HASH
|
2016-02-01 17:22:10 +03:00
|
|
|
|
|
|
|
ORG_PATH=$PATH
|
|
|
|
for ARCH in $BUILD_ARCH
|
|
|
|
do
|
|
|
|
|
|
|
|
case $ARCH in
|
|
|
|
"armeabi-v7a")
|
2020-04-08 13:37:36 +03:00
|
|
|
build "android-arm" "armeabi-v7a"
|
|
|
|
;;
|
2016-02-01 17:22:10 +03:00
|
|
|
"x86")
|
2020-04-08 13:37:36 +03:00
|
|
|
build "android-x86" "x86"
|
2016-02-01 17:22:10 +03:00
|
|
|
;;
|
|
|
|
"arm64-v8a")
|
2020-04-08 13:37:36 +03:00
|
|
|
build "android-arm64" "arm64-v8a"
|
2016-02-01 17:22:10 +03:00
|
|
|
;;
|
|
|
|
"x86_64")
|
2020-04-08 13:37:36 +03:00
|
|
|
build "android-x86_64" "x86_64"
|
2016-02-01 17:22:10 +03:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "[WARNING] Skipping unsupported architecture $ARCH"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2017-03-09 11:30:38 +03:00
|
|
|
if [ ! -d $BUILD_DST/$ARCH/include ];
|
2016-02-01 17:22:10 +03:00
|
|
|
then
|
2017-03-09 11:30:38 +03:00
|
|
|
common_run mkdir -p $BUILD_DST/$ARCH/include
|
2016-02-01 17:22:10 +03:00
|
|
|
fi
|
2017-03-09 11:30:38 +03:00
|
|
|
common_run cp -L -R $BUILD_SRC/include/openssl $BUILD_DST/$ARCH/include/
|
2016-02-01 17:22:10 +03:00
|
|
|
|