Skip to content

Commit

Permalink
kbuild: Use LINUXINCLUDE to specify include/ directory
Browse files Browse the repository at this point in the history
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: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Sam Ravnborg committed Aug 8, 2004
1 parent 64fc2d3 commit cb4f38e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion arch/i386/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subdir- := compressed

host-progs := tools/build

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

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

Expand Down
2 changes: 1 addition & 1 deletion arch/ppc64/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb4f38e

Please sign in to comment.