From 4f0f108494019a856656f915607d15b2d364421b Mon Sep 17 00:00:00 2001
From: marcobaye <marcobaye@4df02467-bbd4-4a76-a152-e7ce94205b78>
Date: Mon, 20 Mar 2023 09:33:17 +0000
Subject: [PATCH] Added MacOS build script provided by Claus. Thanks Claus!

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@325 4df02467-bbd4-4a76-a152-e7ce94205b78
---
 src/acme.c         |  4 ++--
 src/build_macos.sh | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100755 src/build_macos.sh

diff --git a/src/acme.c b/src/acme.c
index 6e60b60..bbb8d6c 100644
--- a/src/acme.c
+++ b/src/acme.c
@@ -338,7 +338,7 @@ static void keyword_to_dynabuf(const char keyword[])
 }
 
 
-// set output format (the output format tree must be set up at this point!)
+// set output format
 static void set_output_format(const char format_name[])
 {
 	// caution, name may be NULL!
@@ -356,7 +356,7 @@ static void set_output_format(const char format_name[])
 }
 
 
-// set CPU type (the cpu type tree must be set up at this point!)
+// set CPU type
 static void set_starting_cpu(const char cpu_name[])
 {
 	const struct cpu_type	*new_cpu_type;
diff --git a/src/build_macos.sh b/src/build_macos.sh
new file mode 100755
index 0000000..2540519
--- /dev/null
+++ b/src/build_macos.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# from Claus:
+# with the new ARM platforms it seems to make sense to build macOS
+# binaries as universal x86/arm in the future. I did not find an
+# elegant way to do it in a Makefile, but maybe you want to add this
+# handy script to your repo?
+
+make clean
+make CFLAGS="-target x86_64-apple-macos10.12"
+mv acme acme_x86
+make clean
+make CFLAGS="-target arm64-apple-macos11"
+mv acme acme_arm
+lipo -create -output acme acme_x86 acme_arm
+rm acme_x86
+rm acme_arm