patch to fix build issue in uClibc testsuite

Jian Peng jipeng at broadcom.com
Fri Apr 8 23:23:49 UTC 2011


In test/Rules.mak, $(KERNEL_HEADERS) will be checked and used to generate
$(KERNEL_INCLUDES) based on absolute or relative path.

The problem is that this check assumes that $(KERNEL_HEADERS) is
single word like /user/me/kernel/include, in case that it is
"/user/me/kernel/include -I/user/me/kernel/arch/mips/include",
$(KERNEL_INCLUDES) will be wrong and leads to unable to find out
kernel header files in build process.

Here I reworked the logic to check each path in $(KERNEL_HEADERS) 
individually, then combine them.

Signed-off-by: Jian Peng <jipeng2005 at gmail.com>
---
 test/Rules.mak |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/test/Rules.mak b/test/Rules.mak
index 2131a7b..e144b0f 100644
--- a/test/Rules.mak
+++ b/test/Rules.mak
@@ -46,14 +46,10 @@ export TARGET_ARCH
 RM_R = $(Q)$(RM) -r
 LN_S = $(Q)$(LN) -fs

+# handle absolute and relative path on each path in $(KERNEL_HEADERS) separately
 ifneq ($(KERNEL_HEADERS),)
-ifeq ($(patsubst /%,/,$(KERNEL_HEADERS)),/)
-# Absolute path in KERNEL_HEADERS
-KERNEL_INCLUDES += -I$(KERNEL_HEADERS)
-else
-# Relative path in KERNEL_HEADERS
-KERNEL_INCLUDES += -I$(top_builddir)$(KERNEL_HEADERS)
-endif
+KERNEL_HEADERS := $(patsubst -I%,%,$(KERNEL_HEADERS))
+KERNEL_INCLUDES += $(addprefix -I,$(foreach i,$(KERNEL_HEADERS),$(patsubst .%,$(top_builddir).%,$i)))
 endif

 XCOMMON_CFLAGS := -I$(top_builddir)test -D_GNU_SOURCE
--
1.7.4.1





More information about the uClibc mailing list