summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-01-23 12:04:06 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-01-23 12:04:06 +0000
commit86c9c9e63900ce0344cb9a4eb34d4e296de843e4 (patch)
treea2e5a2d97a72ee8658412ba07f5e9667a4f1fa23
parent2df4c9eb34e086100e048f7ba9cf42bcf89cb44b (diff)
downloadbuildsystem-86c9c9e63900ce0344cb9a4eb34d4e296de843e4.tar.gz
buildsystem-86c9c9e63900ce0344cb9a4eb34d4e296de843e4.tar.bz2
Detecting apple clang and building universal binaries with clang and gcc on Mac OS X.
svn path=/trunk/tools/buildsystem/; revision=11461
-rw-r--r--makefiles/Makefile.clang15
-rw-r--r--makefiles/Makefile.gcc17
-rw-r--r--makefiles/Makefile.tools6
3 files changed, 38 insertions, 0 deletions
diff --git a/makefiles/Makefile.clang b/makefiles/Makefile.clang
index 1105043..591a325 100644
--- a/makefiles/Makefile.clang
+++ b/makefiles/Makefile.clang
@@ -26,6 +26,21 @@ LDSHR = -shared -Wl,-soname,$(SONAME)
ARFLG := cru
###############################################################################
+# Mac OS X Universal Binaries
+###############################################################################
+
+ifeq ($(TARGET),Darwin)
+ ifneq ($(UNIVERSAL),)
+ UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
+
+ CFLAGS += $(UNIVERSAL_FLAGS)
+ LDFLAGS += $(UNIVERSAL_FLAGS)
+ CXXFLAGS += $(UNIVERSAL_FLAGS)
+ ARFLAGS += -s
+ endif
+endif
+
+###############################################################################
# Other settings
###############################################################################
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index 3115889..7d11b24 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -58,6 +58,23 @@ ifeq ($(COMPONENT_TYPE),riscos-module)
endif
###############################################################################
+# Mac OS X Universal Binaries
+###############################################################################
+
+ifeq ($(TARGET),Darwin)
+ ifneq ($(UNIVERSAL),)
+ UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
+ CC_CAN_BUILD_AND_DEP := no
+ CC_CANNOT_DEP := yes
+
+ CFLAGS += $(UNIVERSAL_FLAGS)
+ LDFLAGS += $(UNIVERSAL_FLAGS)
+ CXXFLAGS += $(UNIVERSAL_FLAGS)
+ ARFLAGS += -s
+ endif
+endif
+
+###############################################################################
# Other settings
###############################################################################
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index a5148a2..6ac78a5 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -372,6 +372,12 @@ else
ifeq ($(word 1,$(ccvsn)),clang)
toolchain := clang
endif
+ ifeq ($(word 1,$(ccvsn)),Apple)
+ ifeq ($(word 2,$(ccvsn)),clang)
+ # Apple clang
+ toolchain := clang
+ endif
+ endif
endif
ifeq ($(toolchain),)