Commit cb4f38e1 authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: Use LINUXINCLUDE to specify include/ directory

Peter Chubb <peterc@gelato.unsw.edu.au> 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: default avatarSam Ravnborg <sam@ravnborg.org>
parent 64fc2d35
......@@ -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
......
......@@ -31,7 +31,7 @@ subdir- := compressed
host-progs := tools/build
HOSTCFLAGS_build.o := -Iinclude
HOSTCFLAGS_build.o := $(LINUXINCLUDE)
# ---------------------------------------------------------------------------
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment