summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-15 00:54:08 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-04-15 00:54:08 +0000
commit6397aeb8b1a26d7eb2ae14e5de8fa86141aa92b3 (patch)
tree02143a54d7288c0e0a4980838c114909aab19af0
parente6350dee8265664ba9c5bb2813cbe0de8f1b841f (diff)
downloadmtk-20170518-6397aeb8b1a26d7eb2ae14e5de8fa86141aa92b3.zip
mtk-20170518-6397aeb8b1a26d7eb2ae14e5de8fa86141aa92b3.tar.gz
mtk-20170518-6397aeb8b1a26d7eb2ae14e5de8fa86141aa92b3.tar.bz2
uboot-ar71xx: fix compile on mac os x (patch from #9124)
SVN-Revision: 26676
-rw-r--r--package/uboot-ar71xx/patches/021-darwin_compat.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/package/uboot-ar71xx/patches/021-darwin_compat.patch b/package/uboot-ar71xx/patches/021-darwin_compat.patch
new file mode 100644
index 0000000..dde83d4
--- /dev/null
+++ b/package/uboot-ar71xx/patches/021-darwin_compat.patch
@@ -0,0 +1,23 @@
+--- 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 the 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