-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_build_openssl.sh
More file actions
executable file
·37 lines (31 loc) · 1.04 KB
/
_build_openssl.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.04 KB
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
#!/bin/bash
set -xe
_PKG=openssl-1.1.1l
_PREFIX="$1"
_SCRATCH_DIR="$2"
_NO_TESTS="$3"
if [[ ! -e "$_PREFIX/include/openssl" ]]
then
cd "$_SCRATCH_DIR"
while ! shasum -cs <<< "0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 *$_PKG.tar.gz"
do
curl -OkfSL "https://ftp.openssl.org/source/$_PKG.tar.gz"
done
rm -rf "$_PKG"
tar -xf "$_PKG.tar.gz"
cd "$_PKG"
# Fix CommonRandom.h error on CLT 9.x
sed -i '' $'s|^\\(# *include <CommonCrypto/Common\\)Random.h>|\\1CryptoError.h>\\\n&|' \
crypto/rand/rand_unix.c
# enable-ec_nistp_64_gcc_128
perl Configure darwin64-x86_64-cc "--prefix=$_PREFIX" no-shared \
enable-static-engine $([[ "$_NO_TESTS" == 0 ]] || echo no-tests)
# Build lib only
sed -i- 's,^\(LIBS *= *\)apps/libapps\.a ,\1,' Makefile
make -j2 install_dev install_engines
if [[ "$_NO_TESTS" == 0 ]]; then
curl -skfSL 'https://github.com/openssl/openssl/commit/{'\
'73db5d82489b3ec09ccc772dfcee14fef0e8e908,b7ce611887cfac633aacc052b2e71a7f195418b8}.patch' | patch -p1
make test
fi
fi