From 258e4ad850097f334beb033031b62a1039e3575b Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Thu, 20 Mar 2014 22:22:17 +0100 Subject: OS X: detect clang and build for x86 target only. Newer versions of Xcode / OS X don't support PPC code anymore and replace gcc with clang. When clang is detected assume we want to build for the default architecture only and change the minimum OS X version to 10.5. Change-Id: I5843fa9bb3d957ec6f0a537e857608ad99c31517 --- rbutil/libtools.make | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'rbutil/libtools.make') diff --git a/rbutil/libtools.make b/rbutil/libtools.make index 4623808f94..7a125f98ea 100644 --- a/rbutil/libtools.make +++ b/rbutil/libtools.make @@ -63,7 +63,12 @@ $(info Compiler creates $(COMPILETARGET) binaries) # OS X specifics. Needs to consider cross compiling for Windows. ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) -# when building libs for OS X build for both i386 and ppc at the same time. +# When building for 10.4+ we need to use gcc. Otherwise clang is used, so use +# that to determine if we need to set arch and isysroot. +ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__) +CFLAGS += -mmacosx-version-min=10.5 +else +# when building libs for OS X 10.4+ build for both i386 and ppc at the same time. # This creates fat objects, and ar can only create the archive but not operate # on it. As a result the ar call must NOT use the u (update) flag. ARCHFLAGS += -arch ppc -arch i386 @@ -73,6 +78,7 @@ CC = gcc-4.0 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 NATIVECC = gcc-4.0 endif +endif WINDRES = windres BUILD_DIR ?= $(TARGET_DIR)build$(COMPILETARGET) -- cgit v1.2.3