[PATCH] KBUILD: Allow generalization of "unifdef" utility.

From: Robert P. J. Day
Date: Mon Mar 03 2008 - 15:27:43 EST



Allow the user to override the selection of "unifdef" utility when
generating user-space header files. This allows the user to select
the more powerful "sunifdef" program, which is more stringent with
respect to cleaning and syntax checking.

Signed-off-by: Robert P. J. Day <rpjday@xxxxxxxxxxxxxx>

---

obviously, if a user chooses to not take advantage of this feature,
it should make no difference whatsoever. but "sunifdef" is more
strict in terms of cleaning compound preprocessor directives, and it
also flags questionable preprocessor directives like this:

UNIFDEF include/linux/netlink.h
sunifdef: /home/rpjday/k/git/include/linux/netlink.h: line 206:
warning 0x02070: Garbage following preprocessor directive in "#if
PAGE_SIZE < 8192UL" (#if line 152 depth 2)


diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 53dae3e..e98e6b2 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -7,7 +7,8 @@
#
# ==========================================================================

-UNIFDEF := scripts/unifdef -U__KERNEL__
+UNIFDEF_CMD ?= scripts/unifdef
+UNIFDEF := $(UNIFDEF_CMD) -U__KERNEL__

# Eliminate the contents of (and inclusions of) compiler.h
HDRSED := sed -e "s/ inline / __inline__ /g" \


========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================
--
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/