X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=config.mk;h=ce8e5f2dff510799c2db8c50548a320af8e88c49;hb=14d0a02a168b36e87665b8d7f42fa3e88263d26d;hp=73b5195cb639370fc32884d76d89ba4ea3e9679e;hpb=83653121d7382fccfe329cb732f77f116341ef1d;p=oweals%2Fu-boot.git diff --git a/config.mk b/config.mk index 73b5195cb6..ce8e5f2dff 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 '.') + +os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \ + $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;) + +# Snow Leopards build environment has no longer restrictions as described above +HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc") +HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") +HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") else HOSTCC = gcc endif @@ -158,8 +166,8 @@ gccincdir := $(shell $(CC) -print-file-name=include) CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \ -D__KERNEL__ -ifneq ($(TEXT_BASE),) -CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) +ifneq ($(CONFIG_SYS_TEXT_BASE),) +CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) endif ifneq ($(RESET_VECTOR_ADDRESS),) @@ -183,14 +191,6 @@ endif CFLAGS += $(call cc-option,-fno-stack-protector) -# avoid trigraph warnings while parsing pci.h (produced by NIOS gcc-2.9) -# this option have to be placed behind -Wall -- that's why it is here -ifeq ($(ARCH),nios) -ifeq ($(findstring 2.9,$(shell $(CC) --version)),2.9) -CFLAGS := $(CPPFLAGS) -Wall -Wno-trigraphs -endif -endif - # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g # option to the assembler. AFLAGS_DEBUG := @@ -205,8 +205,8 @@ endif AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) LDFLAGS += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS) -ifneq ($(TEXT_BASE),) -LDFLAGS += -Ttext $(TEXT_BASE) +ifneq ($(CONFIG_SYS_TEXT_BASE),) +LDFLAGS += -Ttext $(CONFIG_SYS_TEXT_BASE) endif # Location of a usable BFD library, where we define "usable" as @@ -236,7 +236,7 @@ endif export HOSTCC HOSTCFLAGS HOSTLDFLAGS PEDCFLAGS HOSTSTRIP CROSS_COMPILE \ AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP MAKE -export TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS +export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS #########################################################################