[5/12] kbuild: Use LINUXINCLUDE to specify include/ directory

From: Sam Ravnborg
Date: Fri Aug 13 2004 - 15:18:56 EST


# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/08/08 21:54:01+02:00 sam@xxxxxxxxxxxxxxxxx
# kbuild: Use LINUXINCLUDE to specify include/ directory
#
# Peter Chubb <peterc@xxxxxxxxxxxxxxxxxx> 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 <sam@xxxxxxxxxxxx>
#
# arch/ppc64/boot/Makefile
# 2004/08/08 21:53:44+02:00 sam@xxxxxxxxxxxxxxxxx +1 -1
# Introduce usage of LINUXINCLUDE
#
# arch/i386/boot/Makefile
# 2004/08/08 21:53:44+02:00 sam@xxxxxxxxxxxxxxxxx +1 -1
# Use LINUXINCLUDE to enable cross compilation.
# This alos makes build locate the same boot.h when built with and wihtout O=
#
# Makefile
# 2004/08/08 21:53:44+02:00 sam@xxxxxxxxxxxxxxxxx +7 -3
# Introduced LINUXINCLUDE - to allow portable reference to the include/
# directory when assing to HOSTCFLAGS
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile 2004-08-13 21:08:49 +02:00
+++ b/Makefile 2004-08-13 21:08:49 +02:00
@@ -294,8 +294,12 @@

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 @@
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 -Nru a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
--- a/arch/i386/boot/Makefile 2004-08-13 21:08:49 +02:00
+++ b/arch/i386/boot/Makefile 2004-08-13 21:08:49 +02:00
@@ -31,7 +31,7 @@

host-progs := tools/build

-HOSTCFLAGS_build.o := -Iinclude
+HOSTCFLAGS_build.o := $(LINUXINCLUDE)

# ---------------------------------------------------------------------------

diff -Nru a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile
--- a/arch/ppc64/boot/Makefile 2004-08-13 21:08:49 +02:00
+++ b/arch/ppc64/boot/Makefile 2004-08-13 21:08:49 +02:00
@@ -25,7 +25,7 @@

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/