[Vm-dev] [commit][3702] Rescue the Mac OS X build pre clang 7.3

commits at squeakvm.org commits at squeakvm.org
Fri May 6 19:06:50 UTC 2016


Revision: 3702
Author:   eliot
Date:     2016-05-06 12:06:49 -0700 (Fri, 06 May 2016)
Log Message:
-----------
Rescue the Mac OS X build pre clang 7.3

Modified Paths:
--------------
    branches/Cog/build.macos32x86/common/Makefile.flags
    branches/Cog/build.macos32x86/common/Makefile.rules

Added Paths:
-----------
    branches/Cog/build.macos32x86/common/Makefile.clangversion

Added: branches/Cog/build.macos32x86/common/Makefile.clangversion
===================================================================
--- branches/Cog/build.macos32x86/common/Makefile.clangversion	                        (rev 0)
+++ branches/Cog/build.macos32x86/common/Makefile.clangversion	2016-05-06 19:06:49 UTC (rev 3702)
@@ -0,0 +1,26 @@
+#############################################################################
+# Determine clang version and set CLANG_7_3_OR_ABOVE & CLANG_7_2_OR_BELOW as so
+#
+
+XCODETOOLCHAINS := /Applications/Xcode.app/Contents/Developer/Toolchains
+XCODETOOLCHAIN := $(XCODETOOLCHAINS)/XcodeDefault.xctoolchain
+
+# /usr/bin/clang, a.k.a. $(XCODETOOLCHAIN)/usr/bin/clang
+CC := clang
+# convoluted, but clang -version writes to /dev/tty, /not/ stdout :-(
+CLVERSION:= $(shell ls $(XCODETOOLCHAIN)/usr/lib/clang)
+CLVERMAJ := $(shell echo $(CLVERSION) | cut -f1 -d.)
+CLVERMIN := $(shell echo $(CLVERSION) | cut -f2 -d.)
+
+# One glaring deficiency of GNU Make is the absence of arithmetic support
+ifneq ($(filter 0 1 2 3 4 5 6,$(CLVERMAJ)),)
+	 CLANG_7_2_OR_BELOW:=true
+else ifeq ($(CLVERMAJ), 7)
+	ifneq ($(filter 0 1 2,$(CLVERMIN)),)
+		 CLANG_7_2_OR_BELOW:=true
+	else
+		CLANG_7_3_OR_ABOVE:=true
+	endif
+else
+	CLANG_7_3_OR_ABOVE:=true
+endif

Modified: branches/Cog/build.macos32x86/common/Makefile.flags
===================================================================
--- branches/Cog/build.macos32x86/common/Makefile.flags	2016-05-06 00:18:27 UTC (rev 3701)
+++ branches/Cog/build.macos32x86/common/Makefile.flags	2016-05-06 19:06:49 UTC (rev 3702)
@@ -13,10 +13,11 @@
 
 # N.B. ARC isn't supported by the os-x 32-bit legacy Objective-C runtime kernel.
 # ARC is supported only on 64-bits, and then only for the 10.7 SDK and later.
-ifeq ($(CCVERSION),6.0)
+include ../common/Makefile.clangversion
+ifdef CLANG_7_3_OR_ABOVE
+	OBJC_CODE_MODEL := -fobjc-weak
+else
 	OBJC_CODE_MODEL := -fno-objc-arc
-else
-	OBJC_CODE_MODEL := -fobjc-weak
 endif
 CFLAGS:=$(CFLAGS) -DBUILD_FOR_OSX=1 \
 		-arch $(TARGET_ARCH) \

Modified: branches/Cog/build.macos32x86/common/Makefile.rules
===================================================================
--- branches/Cog/build.macos32x86/common/Makefile.rules	2016-05-06 00:18:27 UTC (rev 3701)
+++ branches/Cog/build.macos32x86/common/Makefile.rules	2016-05-06 19:06:49 UTC (rev 3702)
@@ -4,13 +4,7 @@
 # See http://make.mad-scientist.net/papers/advanced-auto-dependency-generation
 # for an explanation of the dependency management scheme.
 
-XCODETOOLCHAINS := /Applications/Xcode.app/Contents/Developer/Toolchains
-XCODETOOLCHAIN := $(XCODETOOLCHAINS)/XcodeDefault.xctoolchain
-
-# /usr/bin/clang, a.k.a. /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 CC := clang
-# convoluted, but clang -version writes to /dev/tty, /not/ stdout :-(
-CCVERSION = $(shell ls $(XCODETOOLCHAIN)/usr/lib/clang)
 LD := clang
 LDCXX := clang++ # For linking c++ bundles
 



More information about the Vm-dev mailing list