summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk9
-rwxr-xr-xosxcrossbuild24
2 files changed, 29 insertions, 4 deletions
diff --git a/config.mk b/config.mk
index 3012d1f..aacdeb6 100644
--- a/config.mk
+++ b/config.mk
@@ -5,19 +5,20 @@ RELDATE = 2015-07-28
# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
+OPENSSL = /home/nick/tmp/openssl-1.1.1m
LIBS = -lssl -lcrypto
-CFLAGS = -std=c99 -pedantic -Wall -Wextra -Werror -g -D_POSIX_C_SOURCE=200112L \
- -DVERSION=\"$(VERSION)\"
+CFLAGS = -std=c99 -pedantic -Wall -Wextra -g -D_POSIX_C_SOURCE=200112L \
+ -DVERSION=\"$(VERSION)\" -I$(OPENSSL)/include
# glibc dynamic
CC = cc
LDFLAGS = $(LIBS)
# musl static
-#CC = musl-gcc
-#LDFLAGS = $(LIBS) -static #-s
+#CC = musl-gcc -static
+#LDFLAGS = $(LIBS) -L$(OPENSSL) -static #-s
# mingw
#W32TCLKIT = win-build-deps/tclkit-gui-8_6_11-twapi-4_5_2-x86-max.exe
diff --git a/osxcrossbuild b/osxcrossbuild
new file mode 100755
index 0000000..89bb50b
--- /dev/null
+++ b/osxcrossbuild
@@ -0,0 +1,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