Skip to content

Commit 7a88488

Browse files
Roman ZippelLinus Torvalds
authored andcommitted
[PATCH] kconfig: use gperf for kconfig keywords
Use gperf to generate a hash for the kconfig keywords. This greatly reduces the size of the generated scanner and makes it easier to extend kconfig. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 491d711 commit 7a88488

8 files changed

Lines changed: 760 additions & 1805 deletions

File tree

‎scripts/kconfig/Makefile‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ gconf-objs := gconf.o kconfig_load.o zconf.tab.o
114114
endif
115115

116116
clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
117-
.tmp_gtkcheck zconf.tab.c lex.zconf.c
117+
.tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
118118

119119
# Needed for systems without gettext
120120
KBUILD_HAVE_NLS := $(shell \
@@ -201,7 +201,7 @@ $(obj)/.tmp_gtkcheck:
201201
fi
202202
endif
203203

204-
$(obj)/zconf.tab.o: $(obj)/lex.zconf.c
204+
$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
205205

206206
$(obj)/kconfig_load.o: $(obj)/lkc_defs.h
207207

@@ -217,7 +217,7 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
217217

218218

219219
###
220-
# The following requires flex/bison
220+
# The following requires flex/bison/gperf
221221
# By default we use the _shipped versions, uncomment the following line if
222222
# you are modifying the flex/bison src.
223223
# LKC_GENPARSER := 1
@@ -226,6 +226,7 @@ ifdef LKC_GENPARSER
226226

227227
$(obj)/zconf.tab.c: $(src)/zconf.y
228228
$(obj)/lex.zconf.c: $(src)/zconf.l
229+
$(obj)/zconf.hash.c: $(src)/zconf.gperf
229230

230231
%.tab.c: %.y
231232
bison -l -b $* -p $(notdir $*) $<
@@ -235,4 +236,8 @@ lex.%.c: %.l
235236
flex -L -P$(notdir $*) -o$@ $<
236237
cp $@ $@_shipped
237238

239+
%.hash.c: %.gperf
240+
gperf < $< > $@
241+
cp $@ $@_shipped
242+
238243
endif

0 commit comments

Comments
 (0)