-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeSLLios.sh
executable file
·86 lines (61 loc) · 2.05 KB
/
makeSLLios.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
#export ANDROID_NDK_ROOT=/some/where/android-ndk-10d
OPENSSL_TAG=openssl-3.0.9
OPENSSL_LIB_PREFIX=_3.so
TMP_DIR=../build_openssl
CROSS_TOP_SIM="`xcode-select --print-path`/Platforms/iPhoneSimulator.platform/Developer"
CROSS_SDK_SIM="iPhoneSimulator.sdk"
CROSS_TOP_IOS="`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer"
CROSS_SDK_IOS="iPhoneOS.sdk"
export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"
export CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
realpath() {
path=`eval echo "$1"`
folder=$(dirname "$path")
echo $(cd "$folder"; pwd)/$(basename "$path");
}
BASE_DIR=$(dirname "$(realpath "$0")")
BASE_PATH=$PATH
cd $BASE_DIR
if [ -d "$BASE_DIR/openssl" ]; then
echo "opens ssl alredy cloned"
else
git clone https://github.com/openssl/openssl.git
fi
cd openssl
OLD_PWD=$PWD
git fetch
git clean -xdf
git checkout .
git submodule foreach --recursive git clean -xdf
git submodule foreach --recursive git checkout .
git checkout $OPENSSL_TAG
git submodule update --init --recursive
GENERAL_OPTIONS=" -no-shared -no-tests -no-ui-console -no-ssl3 -no-comp -no-engine"
function build_for ()
{
PLATFORM=$1
CROSS_TOP_ENV=CROSS_TOP_$2
CROSS_SDK_ENV=CROSS_SDK_$2
echo "#####BUILD FOR $PLATFORM#####"
export CROSS_TOP="${!CROSS_TOP_ENV}"
export CROSS_SDK="${!CROSS_SDK_ENV}"
export SSL_PREFIX_DIR=$BASE_DIR/$PLATFORM
git clean -xdf
git submodule foreach --recursive git clean -xdf
rm -rdf $SSL_PREFIX_DIR
echo "./Configure $GENERAL_OPTIONS $PLATFORM --prefix=${SSL_PREFIX_DIR} --openssldir=${SSL_PREFIX_DIR}"
./Configure $GENERAL_OPTIONS $PLATFORM --prefix=${SSL_PREFIX_DIR} --openssldir=${SSL_PREFIX_DIR}
echo "make -j12 "
make -j12
make install_sw
unset SSL_PREFIX_DIR
}
# Arm 32 build
build_for ios-cross IOS
# Arm 64 build
build_for ios64-cross IOS
# create configuration fpor build for simulators
patch Configurations/10-main.conf < ../patch-conf.patch
# Amd 64 build
build_for ios64sim-cross SIM