From 60c80e4b786b32b292347c428104727d7a503f09 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 22 Mar 2019 00:07:38 -0500 Subject: [PATCH] make: Use the MacOSX 10.13 SDK for x86 support. Bugfix - CFLAGS += instead of CFLAGS = because it would get overwritten otherwise. Also allow overwriting of XCODE_PATH for non-standard path. Download the 10.13 SDK from https://github.com/phracker/MacOSX-SDKs/releases ```bash wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz xz --uncompress MacOSX10.13.sdk.tar.xz tar xvf MacOSX10.13.sdk.tar mv MacOSX10.13.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ ``` --- GNUmakefile | 4 +++- vm/Config.macosx.x86.32 | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 2a779b4855..1f43b333bb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,9 +13,11 @@ ifdef CONFIG CXX=$(SHELL_CXX) endif + XCODE_PATH ?= /Applications/Xcode.app + include $(CONFIG) - CFLAGS = -Wall \ + CFLAGS += -Wall \ -pedantic \ -DFACTOR_VERSION="$(VERSION)" \ -DFACTOR_GIT_LABEL="$(GIT_LABEL)" \ diff --git a/vm/Config.macosx.x86.32 b/vm/Config.macosx.x86.32 index 5c0d4e0ede..68eaa9c0d1 100644 --- a/vm/Config.macosx.x86.32 +++ b/vm/Config.macosx.x86.32 @@ -1,2 +1,6 @@ include vm/Config.macosx include vm/Config.x86.32 + +# The last SDK to support x86 +CFLAGS += --sysroot=$(XCODE_PATH)/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk +CXXFLAGS += --sysroot=$(XCODE_PATH)/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk