1
1
#! /bin/bash
2
2
3
+ # Exit on error and print each command
4
+ set -e
5
+ set -x
6
+
7
+ # Build OpenSSL for macOS
8
+
3
9
OPENSSL_VERSION=" 3.3.1"
4
10
OPENSSL_VERSION_SHORT=" 3"
5
11
NUM_CORES=$( sysctl -n hw.logicalcpu)
@@ -10,19 +16,42 @@ mv openssl-$OPENSSL_VERSION openssl_arm64
10
16
cp -r openssl_arm64 openssl_x86_64
11
17
12
18
cd openssl_arm64
13
- ./Configure shared darwin64-arm64-cc
19
+ ./Configure shared --prefix=" $( pwd) /release" \
20
+ --openssldir=" $( pwd) /release" \
21
+ darwin64-arm64-cc
14
22
make -j$NUM_CORES
23
+ # install into the current directory
24
+ make install_sw
15
25
cd ../
16
26
17
27
cd openssl_x86_64
18
- ./Configure shared darwin64-x86_64-cc
28
+ ./Configure shared --prefix=" $( pwd) /release" \
29
+ --openssldir=" $( pwd) /release" \
30
+ darwin64-x86_64-cc
19
31
make -j$NUM_CORES
32
+ # install into the current directory
33
+ make install_sw
20
34
cd ../
21
35
36
+ mkdir release
37
+
38
+ # shared libraries
39
+ lipo -create openssl_arm64/release/lib/libcrypto.$OPENSSL_VERSION_SHORT .dylib \
40
+ openssl_x86_64/release/lib/libcrypto.$OPENSSL_VERSION_SHORT .dylib \
41
+ -output release/lib/libcrypto.$OPENSSL_VERSION_SHORT .dylib
42
+ lipo -create openssl_arm64/release/lib/libssl.$OPENSSL_VERSION_SHORT .dylib \
43
+ openssl_x86_64/release/lib/libssl.$OPENSSL_VERSION_SHORT .dylib \
44
+ -output release/lib/libssl.$OPENSSL_VERSION_SHORT .dylib
45
+
46
+ # static libraries
47
+ lipo -create openssl_arm64/release/lib/libcrypto.a \
48
+ openssl_x86_64/release/lib/libcrypto.a \
49
+ -output release/lib/libcrypto.a
50
+ lipo -create openssl_arm64/release/lib/libssl.a \
51
+ openssl_x86_64/release/lib/libssl.a \
52
+ -output release/lib/libssl.a
53
+
54
+ cp -r openssl_arm64/release/include release/include
22
55
23
- lipo -create openssl_arm64/libcrypto.$OPENSSL_VERSION_SHORT .dylib \
24
- openssl_x86_64/libcrypto.$OPENSSL_VERSION_SHORT .dylib \
25
- -output libcrypto.$OPENSSL_VERSION_SHORT .dylib
26
- lipo -create openssl_arm64/libssl.$OPENSSL_VERSION_SHORT .dylib \
27
- openssl_x86_64/libssl.$OPENSSL_VERSION_SHORT .dylib \
28
- -output libssl.$OPENSSL_VERSION_SHORT .dylib
56
+ # create a tarball
57
+ tar -czvf openssl-$OPENSSL_VERSION -macos.tar.gz release
0 commit comments