move boot related packages to their own folder
[openwrt/staging/wigyori.git] / package / boot / uboot-ar71xx / patches / 021-darwin_compat.patch
1 --- a/config.mk
2 +++ b/config.mk
3 @@ -64,9 +64,17 @@ HOSTSTRIP = strip
4 #
5
6 ifeq ($(HOSTOS),darwin)
7 -HOSTCC = cc
8 -HOSTCFLAGS += -traditional-cpp
9 -HOSTLDFLAGS += -multiply_defined suppress
10 +#get the major and minor product version (e.g. '10' and '6' for Snow Leopard)
11 +DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.')
12 +DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.')
13 +
14 +before-snow-leopard = $(shell if [ $(DARWIN_MAJOR_VERSION) -le 10 -a \
15 + $(DARWIN_MINOR_VERSION) -le 5 ] ; then echo "$(1)"; else echo "$(2)"; fi ;)
16 +
17 +# Snow Leopards build environment has no longer restrictions as described above
18 +HOSTCC = $(call before-snow-leopard, "cc", "gcc")
19 +HOSTCFLAGS += $(call before-snow-leopard, "-traditional-cpp")
20 +HOSTLDFLAGS += $(call before-snow-leopard, "-multiply_defined suppress")
21 else
22 HOSTCC = gcc
23 endif