summaryrefslogtreecommitdiff
path: root/osxcrossbuild
blob: 89bb50b5bc55b11a0fa4cfe9702c4de5ceac0279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

OPENSSL="$HOME/tmp/openssl-1.1.1m-universal"
OSXCROSSBIN="$HOME/src/osxcross/target/bin"

export PATH="$PATH:$OSXCROSSBIN"

make clean || exit 1
rm -f getgbook.amd64 getgbook.arm64

make LDFLAGS="-lssl -lcrypto -L$OPENSSL" CC=o64-clang AR=x86_64-apple-darwin20.4-ar getgbook || exit 1
x86_64-apple-darwin20.4-install_name_tool -change /usr/local/lib/libssl.1.1.dylib @executable_path/libssl.1.1.dylib getgbook
x86_64-apple-darwin20.4-install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib getgbook || exit 1
mv getgbook getgbook.amd64

make clean || exit 1

make LDFLAGS="-lssl -lcrypto -L$OPENSSL" CC=oa64-clang AR=x86_64-apple-darwin20.4-ar getgbook || exit 1
arm64-apple-darwin20.4-install_name_tool -change /usr/local/lib/libssl.1.1.dylib @executable_path/libssl.1.1.dylib getgbook || exit 1
arm64-apple-darwin20.4-install_name_tool -change /usr/local/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib getgbook || exit 1
mv getgbook getgbook.arm64

lipo -create getgbook.amd64 getgbook.arm64 -output getgbook || exit 1
rm getgbook.amd64 getgbook.arm64