[PATCH] Add CONFIG_HEADERS_CHECK option to automatically run 'make headers_check'
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 11 Oct 2006 08:21:43 +0000 (01:21 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 11 Oct 2006 18:14:21 +0000 (11:14 -0700)
In order to encourage people to notice when they break the exported
headers, add a config option which automatically runs the sanity checks
when building vmlinux.  That way, those who use allyesconfig will notice
failures.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Makefile
lib/Kconfig.debug

index 274b780029b19edf4a8e01c747a19fb1f9711602..f242829c4f0bd85a11dd092ac1f5bc2587608f5e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -741,6 +741,9 @@ endif # ifdef CONFIG_KALLSYMS
 
 # vmlinux image - including updated kernel symbols
 vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
 
 # vmlinux image - including updated kernel symbols
 vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
+ifdef CONFIG_HEADERS_CHECK
+       $(Q)$(MAKE) headers_check
+endif
        $(call if_changed_rule,vmlinux__)
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
        $(Q)rm -f .old_version
        $(call if_changed_rule,vmlinux__)
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
        $(Q)rm -f .old_version
index 2d7cb0d04fc8a9762b5460a95cce80f042a0d362..8fd2dbf7eb5b411053ad697b493012e42dcf678c 100644 (file)
@@ -371,6 +371,19 @@ config FORCED_INLINING
          become the default in the future, until then this option is there to
          test gcc for this.
 
          become the default in the future, until then this option is there to
          test gcc for this.
 
+config HEADERS_CHECK
+       bool "Run 'make headers_check' when building vmlinux"
+       help
+         This option will extract the user-visible kernel headers whenever
+         building the kernel, and will run basic sanity checks on them to
+         ensure that exported files do not attempt to include files which
+         were not exported, etc.
+
+         If you're making modifications to header files which are
+         relevant for userspace, say 'Y', and check the headers
+         exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
+         your build tree), to make sure they're suitable.
+
 config RCU_TORTURE_TEST
        tristate "torture tests for RCU"
        depends on DEBUG_KERNEL
 config RCU_TORTURE_TEST
        tristate "torture tests for RCU"
        depends on DEBUG_KERNEL