[PATCH] add make listconfig (show all kconfig symbols seen by parser)

From: Al Viro
Date: Fri May 26 2006 - 08:35:22 EST


Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

---

scripts/kconfig/Makefile | 8 ++++++--
scripts/kconfig/confsyms.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 scripts/kconfig/confsyms.c

9af44436bd3940c50b7cf68a8f2bf14e07ad2081
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fd518f0..b655f60 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -2,7 +2,7 @@ # ======================================
# Kernel configuration targets
# These targets are used from top-level makefile

-PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
+PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config listconfig

xconfig: $(obj)/qconf
$< arch/$(ARCH)/Kconfig
@@ -23,6 +23,9 @@ oldconfig: $(obj)/conf
silentoldconfig: $(obj)/conf
$< -s arch/$(ARCH)/Kconfig

+listconfig: $(obj)/confsyms
+ $< arch/$(ARCH)/Kconfig
+
update-po-config: $(obj)/kxgettext
xgettext --default-domain=linux \
--add-comments --keyword=_ --keyword=N_ \
@@ -95,10 +98,11 @@ # gconf: Used for the gconfig target
# Based on GTK which needs to be installed to compile it
# object files used by all kconfig flavours

-hostprogs-y := conf mconf qconf gconf kxgettext
+hostprogs-y := conf mconf qconf gconf kxgettext confsyms
conf-objs := conf.o zconf.tab.o
mconf-objs := mconf.o zconf.tab.o
kxgettext-objs := kxgettext.o zconf.tab.o
+confsyms-objs := confsyms.o zconf.tab.o

ifeq ($(MAKECMDGOALS),xconfig)
qconf-target := 1
diff --git a/scripts/kconfig/confsyms.c b/scripts/kconfig/confsyms.c
new file mode 100644
index 0000000..3b20065
--- /dev/null
+++ b/scripts/kconfig/confsyms.c
@@ -0,0 +1,31 @@
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+static char type[] = {
+ [S_BOOLEAN] = 'b',
+ [S_TRISTATE] = 't',
+ [S_INT] = 'i',
+ [S_HEX] = 'h',
+ [S_STRING] = 's',
+};
+
+static void list_symbols(struct menu *m)
+{
+ for (m = m->list; m; m = m->next) {
+ struct symbol *s = m->sym;
+ if (s && !sym_is_choice(s)) {
+ char c = s->type >= sizeof(type) ? '\0' : type[s->type];
+ printf("%c %s\n", c ? c : '?', s->name);
+ }
+ list_symbols(m);
+ }
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1) {
+ conf_parse(argv[1]);
+ list_symbols(&rootmenu);
+ }
+ return 0;
+}
--
1.3.GIT

-
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/