OSDN Git Service

Rules.mak: change the way -include is used
authorPeter S. Mazinger <ps.m@gmx.net>
Sun, 20 Mar 2011 03:20:23 +0000 (04:20 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 15 Jun 2012 12:00:30 +0000 (14:00 +0200)
Other compilers do not expect absolute path after -include,
they want to find the included file by path search (-I).
While there, prefer $(TARGET_ARCH) before common path.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Rules.mak

index 320b952..d976d75 100644 (file)
--- a/Rules.mak
+++ b/Rules.mak
@@ -628,11 +628,14 @@ endif
 $(eval $(call check-gcc-var,-nostdlib))
 
 # Collect all CFLAGS components
-CFLAGS := -include $(top_srcdir)include/libc-symbols.h \
-       $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
-       -nostdinc -I$(top_builddir)include -I$(top_srcdir)include -I. \
-       -I$(top_srcdir)libc/sysdeps/linux \
-       -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
+CFLAGS := $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
+       -nostdinc -I$(top_builddir)include \
+       -I$(top_srcdir)include -include libc-symbols.h \
+       -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) \
+       -I$(top_srcdir)libc/sysdeps/linux -I.
+ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
+CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
+endif
 
 # We need this to be checked within libc-symbols.h
 ifneq ($(HAVE_SHARED),y)