[Vm-dev] [commit][3700]
Add determining of the Clang version to the Mac OS X makefiles and use it to
commits at squeakvm.org
commits at squeakvm.org
Fri May 6 00:00:30 UTC 2016
Revision: 3700
Author: eliot
Date: 2016-05-05 17:00:29 -0700 (Thu, 05 May 2016)
Log Message:
-----------
Add determining of the Clang version to the Mac OS X makefiles and use it to
use the right name for the code model depending on clang version 6.0 or 7.0.0.
Annoyingly clang writes its version info to /dev/tty instead of stdout so ver
determined by ls of directory in Xcode. Sigh.
Modified Paths:
--------------
branches/Cog/build.macos32x86/common/Makefile.flags
branches/Cog/build.macos32x86/common/Makefile.rules
branches/Cog/build.macos64x64/common/Makefile.flags
branches/Cog/build.macos64x64/common/Makefile.rules
Modified: branches/Cog/build.macos32x86/common/Makefile.flags
===================================================================
--- branches/Cog/build.macos32x86/common/Makefile.flags 2016-05-05 22:28:56 UTC (rev 3699)
+++ branches/Cog/build.macos32x86/common/Makefile.flags 2016-05-06 00:00:29 UTC (rev 3700)
@@ -13,13 +13,18 @@
# 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)
+ OBJC_CODE_MODEL := -fno-objc-arc
+else
+ OBJC_CODE_MODEL := -fobjc-weak
+endif
CFLAGS:=$(CFLAGS) -DBUILD_FOR_OSX=1 \
-arch $(TARGET_ARCH) \
-mmacosx-version-min=$(TARGET_VERSION_MIN) -msse4.2 \
-fvisibility=default -fwrapv \
-fmacro-backtrace-limit=0 -fdiagnostics-show-note-include-stack \
-fmessage-length=0 -fpascal-strings -fasm-blocks -fstrict-aliasing \
- -fobjc-weak \
+ $(OBJC_CODE_MODEL) \
-isysroot $(SDK) \
-include $(PLATDIR)/iOS/vm/SqueakPureObjc_Prefix.pch
Modified: branches/Cog/build.macos32x86/common/Makefile.rules
===================================================================
--- branches/Cog/build.macos32x86/common/Makefile.rules 2016-05-05 22:28:56 UTC (rev 3699)
+++ branches/Cog/build.macos32x86/common/Makefile.rules 2016-05-06 00:00:29 UTC (rev 3700)
@@ -4,8 +4,13 @@
# 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
Modified: branches/Cog/build.macos64x64/common/Makefile.flags
===================================================================
--- branches/Cog/build.macos64x64/common/Makefile.flags 2016-05-05 22:28:56 UTC (rev 3699)
+++ branches/Cog/build.macos64x64/common/Makefile.flags 2016-05-06 00:00:29 UTC (rev 3700)
@@ -13,13 +13,14 @@
# 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.
+OBJC_CODE_MODEL := -fobjc-arc
CFLAGS:=$(CFLAGS) -DBUILD_FOR_OSX=1 \
-arch $(TARGET_ARCH) \
-mmacosx-version-min=$(TARGET_VERSION_MIN) -msse4.2 \
-fvisibility=default -fwrapv \
-fmacro-backtrace-limit=0 -fdiagnostics-show-note-include-stack \
-fmessage-length=0 -fpascal-strings -fasm-blocks -fstrict-aliasing \
- -fobjc-arc \
+ $(OBJC_CODE_MODEL) \
-isysroot $(SDK) \
-include $(PLATDIR)/iOS/vm/SqueakPureObjc_Prefix.pch
Modified: branches/Cog/build.macos64x64/common/Makefile.rules
===================================================================
--- branches/Cog/build.macos64x64/common/Makefile.rules 2016-05-05 22:28:56 UTC (rev 3699)
+++ branches/Cog/build.macos64x64/common/Makefile.rules 2016-05-06 00:00:29 UTC (rev 3700)
@@ -4,8 +4,13 @@
# 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