From cb4f38e1a55c8af15306261a99fc2be1be27d421 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 9 Aug 2004 01:54:01 +0200 Subject: [PATCH] kbuild: Use LINUXINCLUDE to specify include/ directory Peter Chubb reported that building i386 on a non-i386 platform failed, because gcc could not locate boot.h. Root cause was the extra include2 directory used when using O= to specify the output directory. Added LINUXINCLUDE as a portable way to specify the include/ directory, and changed the two users. This avoids hardcoding 'include2' in non-kbuild core files. Signed-off-by: Sam Ravnborg --- Makefile | 10 +++++++--- arch/i386/boot/Makefile | 2 +- arch/ppc64/boot/Makefile | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index aef2e1e6f26c06..56b4a072fa962c 100644 --- a/Makefile +++ b/Makefile @@ -294,8 +294,12 @@ AFLAGS_KERNEL = NOSTDINC_FLAGS = -nostdinc -iwithprefix include -CPPFLAGS := -D__KERNEL__ -Iinclude \ - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) +# Use LINUXINCLUDE when you must reference the include/ directory. +# Needed to be compatible with the O= option +LINUXINCLUDE := -Iinclude \ + $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) + +CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common @@ -306,7 +310,7 @@ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK -export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS +export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile index d70853d9921589..ac2b3cd5c56d71 100644 --- a/arch/i386/boot/Makefile +++ b/arch/i386/boot/Makefile @@ -31,7 +31,7 @@ subdir- := compressed host-progs := tools/build -HOSTCFLAGS_build.o := -Iinclude +HOSTCFLAGS_build.o := $(LINUXINCLUDE) # --------------------------------------------------------------------------- diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile index 9d6431dd6a1213..0099f1cfc2b7bf 100644 --- a/arch/ppc64/boot/Makefile +++ b/arch/ppc64/boot/Makefile @@ -25,7 +25,7 @@ CROSS32_COMPILE ?= BOOTCC := $(CROSS32_COMPILE)gcc HOSTCC := gcc -BOOTCFLAGS := $(HOSTCFLAGS) -Iinclude -fno-builtin +BOOTCFLAGS := $(HOSTCFLAGS) $(LINUXINCLUDE) -fno-builtin BOOTAS := $(CROSS32_COMPILE)as BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional BOOTLD := $(CROSS32_COMPILE)ld