Makefile: gate --enable-harden to ELF platforms (fix macOS make binary)

ober

0c763353b58e2f2a3d5dd27282980c53319ac6b9

diff --git a/Makefile b/Makefile
index c43b894..1e06315 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,19 @@ SCHEME ?= $(CHEZ_PREFIX)/bin/scheme
 # pattern contains parens that confuse Make's $(shell ...) scanner.
 CHEZ_MACHINE_TYPE := $(shell $(JERBOA_HOME)/support/detect-chez-machine.sh)
 
+# `--enable-harden` makes Chez's configure add ELF-only hardening linker flags
+# (-Wl,-z,relro,-z,now) to the bundled zlib/lz4 sub-builds. Apple's Mach-O linker
+# rejects them ("ld: unknown options: -z"), breaking `make binary` on macOS. Gate
+# it to ELF platforms (Linux, FreeBSD); macOS relies on its own RO/ASLR defaults.
+CHEZ_UNAME_S := $(shell uname -s)
+ifeq ($(CHEZ_UNAME_S),Darwin)
+CHEZ_HARDEN ?=
+else
+CHEZ_HARDEN ?= --enable-harden
+endif
+
 CHEZ_INSTALL_FLAGS = \
-		--enable-harden \
+		$(CHEZ_HARDEN) \
 		--installprefix=$(CHEZ_PREFIX) \
 		--installbin=$(CHEZ_PREFIX)/bin \
 		--installlib=$(CHEZ_PREFIX)/lib \