From d4e7d987a39befc9793f83a15f7411e8aef8bc6f Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Thu, 8 Feb 2018 10:20:39 -0600 Subject: [PATCH] Fix MAC_OS_X_VERSION_MIN_REQUIRED for macOS 10.10 and later Manually specifying MACOSX_VERSION_MIN=10.10 or later would use the wrong value for MAC_OS_X_VERSION_MIN_REQUIRED define. 1100 instead of 101000. --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4aa9f519..ee8cbf92 100644 --- a/Makefile +++ b/Makefile @@ -426,8 +426,15 @@ ifeq ($(PLATFORM),darwin) MACOSX_VERSION_MIN=10.7 endif - # Multiply by 100 and then remove decimal. 10.7 -> 1070.0 -> 1070 - MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo '$(MACOSX_VERSION_MIN) * 100' | bc | cut -d. -f1) + MACOSX_MAJOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f1) + MACOSX_MINOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f2) + ifeq ($(shell test $(MACOSX_MINOR) -gt 9; echo $$?),0) + # Multiply and then remove decimal. 10.10 -> 101000.0 -> 101000 + MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_MAJOR) * 10000 + $(MACOSX_MINOR) * 100" | bc | cut -d. -f1) + else + # Multiply by 100 and then remove decimal. 10.7 -> 1070.0 -> 1070 + MAC_OS_X_VERSION_MIN_REQUIRED=$(shell echo "$(MACOSX_VERSION_MIN) * 100" | bc | cut -d. -f1) + endif LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) BASE_CFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) \