Skip to content

Commit

Permalink
[PATCH] kbuild: permanently fix kernel configuration include mess
Browse files Browse the repository at this point in the history
Include autoconf.h into every kernel compilation via the gcc command line
using -imacros.  This ensures that we have the kernel configuration
included from the start, rather than relying on each file having #include
<linux/config.h> as appropriate.  History has shown that this is something
which is difficult to get right.

Since we now include the kernel configuration automatically, make
configcheck becomes meaningless, so remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Russell King authored and Sam Ravnborg committed Nov 6, 2005
1 parent f912696 commit 2dd34b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ AFLAGS_KERNEL =
# 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)
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-imacros include/linux/autoconf.h

CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)

Expand Down Expand Up @@ -1249,11 +1250,6 @@ tags: FORCE
# Scripts to check various things for consistency
# ---------------------------------------------------------------------------

configcheck:
find * $(RCS_FIND_IGNORE) \
-name '*.[hcS]' -type f -print | sort \
| xargs $(PERL) -w scripts/checkconfig.pl

includecheck:
find * $(RCS_FIND_IGNORE) \
-name '*.[hcS]' -type f -print | sort \
Expand Down
4 changes: 3 additions & 1 deletion include/linux/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H

/* This file is no longer in use and kept only for backward compatibility.
* autoconf.h is now included via -imacros on the commandline
*/
#include <linux/autoconf.h>

#endif

0 comments on commit 2dd34b4

Please sign in to comment.