summaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorAndreas Biessmann <andreas.devel@googlemail.com>2010-05-22 13:17:21 +0200
committerWolfgang Denk <wd@denx.de>2010-05-26 22:31:55 +0200
commitc7da8c19b5f7fd58b5b4b1d247648851af56e1f0 (patch)
tree02ed2f3f39d039f8eed2b9167daa73efb2d40d86 /config.mk
parent6ece2550d1c0c5c811b302b1639ea35c2e485203 (diff)
config.mk: use different host compiler for OS X 10.6
Compiling tools subdirectory on Mac OS X 10.6 (Snow Leopard) complains about wrong syntax in system includes. In file included from /usr/include/stdio.h:444, from ../source/u-boot/include/compiler.h:26, from ../source/u-boot/lib/crc32.c:15: /usr/include/secure/_stdio.h:46: error: syntax error in macro parameter list This can be fixed by reverting the workaround for prior OS X releases in config.mk conditionally for OS X 10.6+. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk14
1 files changed, 11 insertions, 3 deletions
diff --git a/config.mk b/config.mk
index 73b5195cb63..c4ad223bfac 100644
--- a/config.mk
+++ b/config.mk
@@ -64,9 +64,17 @@ HOSTSTRIP = strip
#
ifeq ($(HOSTOS),darwin)
-HOSTCC = cc
-HOSTCFLAGS += -traditional-cpp
-HOSTLDFLAGS += -multiply_defined suppress
+# get major and minor product version (e.g. '10' and '6' for Snow Leopard)
+DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.')
+DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.')
+
+before-snow-leopard = $(shell if [ $(DARWIN_MAJOR_VERSION) -le 10 -a \
+ $(DARWIN_MINOR_VERSION) -le 5 ] ; then echo "$(1)"; else echo "$(2)"; fi ;)
+
+# Snow Leopards build environment has no longer restrictions as described above
+HOSTCC = $(call before-snow-leopard, "cc", "gcc")
+HOSTCFLAGS += $(call before-snow-leopard, "-traditional-cpp")
+HOSTLDFLAGS += $(call before-snow-leopard, "-multiply_defined suppress")
else
HOSTCC = gcc
endif