hunting/external/openssl/build_openssl.sh
2024-06-15 08:30:24 +08:00

62 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
#编译curl库
platform=$1
CMAKE_SOURCE_DIR=$2
echo "Compile openssl, platform = $platform, cmake source dir = $CMAKE_SOURCE_DIR."
export ROOT_PATH=$PWD
# if [ ! -d "./openssl-3.1.0" ];then
# echo "tar zxvf openssl-3.1.0.tar.gz"
# tar zxvf openssl-3.1.0.tar.gz
# fi
# if [ -d "./openssl-3.1.0" ];then
# echo "cd ./openssl-3.1.0"
# cd ./openssl-3.1.0
# fi
if [ ! -d "./openssl-1.1.1s" ];then
echo "tar zxvf openssl-1.1.1s.tar.gz"
tar zxvf openssl-1.1.1s.tar.gz
fi
if [ -d "./openssl-1.1.1s" ];then
cd ./openssl-1.1.1s
fi
exit
tailor="no-asm no-async no-md2 no-mdc2 no-poly1305 no-blake2 \
no-siphash no-sm3 no-rc2 no-rc4 no-rc5 no-idea no-aria no-bf no-cast \
no-camellia no-chacha no-ec no-sm2 no-dso \
no-err no-comp no-cms no-ts no-cmac no-ct \
no-hw-padlock no-nextprotoneg no-psk no-rfc3779 no-srtp \
no-dgram no-dynamic-engine no-ec2m no-filenames no-gost \
no-afalgeng no-async no-autoalginit no-autoerrinit no-capieng \
no-tests \
no-ssl-trace no-static-engine no-stdio no-threads no-deprecated no-makedepend \
no-multiblock"
echo $tailor
# if [ -d "./build" ];then
# mkdir build
# fi
if [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgtest.a" ] || [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgmock.a" ];then
echo "make openssl"
case $platform in
"linux")
echo "==Compile linux."
./Configure $tailor linux-x86_64 --prefix=$ROOT_PATH/build --openssldir=$ROOT_PATH/build --cross-compile-prefix=
# ./Configure no-asm shared --prefix=$ROOT_PATH/build --openssldir=$ROOT_PATH/build
make
make install
;;
"sigmastart_333DE")
echo "==Compile sigmastart_333DE."
./Configure $tailor linux-armv4 --prefix=$ROOT_PATH/build --openssldir=$ROOT_PATH/build --cross-compile-prefix=arm-linux-gnueabihf-9.1.0-
make
make install
;;
*)
echo "Compile gtest failed."
;;
esac
fi
cd $ROOT_PATH
echo "Exit build_openssl.sh."