#!/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