forked from litespeedtech/openlitespeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdlossl.sh
executable file
·65 lines (51 loc) · 1.6 KB
/
dlossl.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
#! /bin/sh
#
# This script is to download openssl latest stable and make the static library ready
# Or,
# Use your pre-built boringSSL
#For openssl, always use the latest officially released version
VERSION=OpenSSL_1_1_1a
if [ "x$1" = "xuse_bssl" ] ; then
if [ "x$2" != "x" ] ; then
mkdir ssl
cp $2/build/ssl/libssl.a ssl/
cp $2/build/crypto/libcrypto.a ssl/
cp $2/build/decrepit/libdecrepit.a ssl/
cp -r $2/include/ ssl/
fi
if [ ! -f ssl/libcrypto.a ] ; then
echo -e "\033[38;5;148mError: boringSSL libraries not found.\033[39m"
else
echo -e "\033[38;5;148mOK, boringSSL libraries copied.\033[39m"
fi
exit 0;
fi
cd `dirname "$0"`
echo "Checking openssl ..."
if [ ! -f ssl/libcrypto.a ] ; then
echo -e "\033[38;5;148mDownload openssl $VERSION and building, it will take several minutes ...\033[39m"
echo -e "\033[38;5;148mThe url is https://github.com/openssl/openssl/archive/$VERSION.tar.gz\033[39m"
DL=`which curl`
DLCMD="$DL -k -L -o ossl.tar.gz"
$DLCMD https://github.com/openssl/openssl/archive/$VERSION.tar.gz
tar xf ossl.tar.gz
rm -rf ssl
mv openssl-$VERSION ssl
rm ossl.tar.gz
cd ssl
./config
make depend
make
if [ ! -f libcrypto.a ] ; then
echo -e "\033[38;5;148mError: failed to make openssl libraries.\033[39m"
exit 1
else
echo -e "\033[38;5;148mOK, openssl libraries made.\033[39m"
fi
cd ..
else
echo "openssl libraries exists."
exit 0
fi
echo "OK, openssl libraries exists."
exit 0