aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-01 14:45:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-01 14:45:49 -0500
commit562f36ed28e6faa4245ea2ca1392d90ab98ebbe8 (patch)
tree85a5d50df8a72cb98c9096a57b2ab25721603115 /scripts
parenta659f1598585071eed5c39485840b0f018c9f457 (diff)
parentcedd55d49dee941d0e4fabb2f2f555d50c53fad7 (diff)
Merge tag 'kconfig-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kconfig updates from Masahiro Yamada: "A pretty big batch of Kconfig updates. I have to mention the lexer and parser of Kconfig are now built from real .l and .y sources. So, flex and bison are the requirement for building the kernel. Both of them (unlike gperf) have been stable for a long time. This change has been tested several weeks in linux-next, and I did not receive any problem report about this. Summary: - add checks for mistakes, like the choice default is not in choice, help is doubled - document data structure and complex code - fix various memory leaks - change Makefile to build lexer and parser instead of using pre-generated C files - drop 'boolean' keyword, which is equivalent to 'bool' - use default 'yy' prefix and remove unneeded Make variables - fix gettext() check for xconfig - announce that oldnoconfig will be finally removed - make 'Selected by:' and 'Implied by' readable in help and search result - hide silentoldconfig from 'make help' to stop confusing people - fix misc things and cleanups" * tag 'kconfig-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (37 commits) kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help kconfig: make "Selected by:" and "Implied by:" readable kconfig: announce removal of oldnoconfig if used kconfig: fix make xconfig when gettext is missing kconfig: Clarify menu and 'if' dependency propagation kconfig: Document 'if' flattening logic kconfig: Clarify choice dependency propagation kconfig: Document SYMBOL_OPTIONAL logic kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX kconfig: use default 'yy' prefix for lexer and parser kconfig: make conf_unsaved a local variable of conf_read() kconfig: make xfgets() really static kconfig: make input_mode static kconfig: Warn if there is more than one help text kconfig: drop 'boolean' keyword kconfig: use bool instead of boolean for type definition attributes, again kconfig: Remove menu_end_entry() kconfig: Document important expression functions kconfig: Document automatic submenu creation code kconfig: Fix choice symbol expression leak ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib28
-rw-r--r--scripts/kconfig/Makefile14
-rw-r--r--scripts/kconfig/conf.c25
-rw-r--r--scripts/kconfig/confdata.c6
-rw-r--r--scripts/kconfig/expr.c136
-rw-r--r--scripts/kconfig/expr.h91
-rw-r--r--scripts/kconfig/kconf_id.c1
-rw-r--r--scripts/kconfig/lkc.h1
-rw-r--r--scripts/kconfig/mconf.c2
-rw-r--r--scripts/kconfig/menu.c186
-rw-r--r--scripts/kconfig/symbol.c14
-rw-r--r--scripts/kconfig/zconf.l16
-rw-r--r--scripts/kconfig/zconf.lex.c_shipped2473
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped2471
-rw-r--r--scripts/kconfig/zconf.y111
15 files changed, 518 insertions, 5057 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 7dee1da83e2a..5fdc1a19b02c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -186,39 +186,49 @@ $(foreach m, $(notdir $1), \
186 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) 186 $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
187endef 187endef
188 188
189ifdef REGENERATE_PARSERS
190
191# LEX 189# LEX
192# --------------------------------------------------------------------------- 190# ---------------------------------------------------------------------------
193LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
194
195quiet_cmd_flex = LEX $@ 191quiet_cmd_flex = LEX $@
196 cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $< 192 cmd_flex = $(LEX) -o$@ -L $<
197 193
194ifdef REGENERATE_PARSERS
198.PRECIOUS: $(src)/%.lex.c_shipped 195.PRECIOUS: $(src)/%.lex.c_shipped
199$(src)/%.lex.c_shipped: $(src)/%.l 196$(src)/%.lex.c_shipped: $(src)/%.l
200 $(call cmd,flex) 197 $(call cmd,flex)
198endif
199
200.PRECIOUS: $(obj)/%.lex.c
201$(filter %.lex.c,$(targets)): $(obj)/%.lex.c: $(src)/%.l FORCE
202 $(call if_changed,flex)
201 203
202# YACC 204# YACC
203# --------------------------------------------------------------------------- 205# ---------------------------------------------------------------------------
204YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
205
206quiet_cmd_bison = YACC $@ 206quiet_cmd_bison = YACC $@
207 cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $< 207 cmd_bison = $(YACC) -o$@ -t -l $<
208 208
209ifdef REGENERATE_PARSERS
209.PRECIOUS: $(src)/%.tab.c_shipped 210.PRECIOUS: $(src)/%.tab.c_shipped
210$(src)/%.tab.c_shipped: $(src)/%.y 211$(src)/%.tab.c_shipped: $(src)/%.y
211 $(call cmd,bison) 212 $(call cmd,bison)
213endif
214
215.PRECIOUS: $(obj)/%.tab.c
216$(filter %.tab.c,$(targets)): $(obj)/%.tab.c: $(src)/%.y FORCE
217 $(call if_changed,bison)
212 218
213quiet_cmd_bison_h = YACC $@ 219quiet_cmd_bison_h = YACC $@
214 cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $< 220 cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
215 221
222ifdef REGENERATE_PARSERS
216.PRECIOUS: $(src)/%.tab.h_shipped 223.PRECIOUS: $(src)/%.tab.h_shipped
217$(src)/%.tab.h_shipped: $(src)/%.y 224$(src)/%.tab.h_shipped: $(src)/%.y
218 $(call cmd,bison_h) 225 $(call cmd,bison_h)
219
220endif 226endif
221 227
228.PRECIOUS: $(obj)/%.tab.h
229$(filter %.tab.h,$(targets)): $(obj)/%.tab.h: $(src)/%.y FORCE
230 $(call if_changed,bison_h)
231
222# Shipped files 232# Shipped files
223# =========================================================================== 233# ===========================================================================
224 234
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 297c1bf35140..cb3ec53a7c29 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -34,6 +34,8 @@ config: $(obj)/conf
34nconfig: $(obj)/nconf 34nconfig: $(obj)/nconf
35 $< $(silent) $(Kconfig) 35 $< $(silent) $(Kconfig)
36 36
37# This has become an internal implementation detail and is now deprecated
38# for external use.
37silentoldconfig: $(obj)/conf 39silentoldconfig: $(obj)/conf
38 $(Q)mkdir -p include/config include/generated 40 $(Q)mkdir -p include/config include/generated
39 $(Q)test -e include/generated/autoksyms.h || \ 41 $(Q)test -e include/generated/autoksyms.h || \
@@ -92,6 +94,8 @@ PHONY += oldnoconfig savedefconfig defconfig
92# on its behavior (sets new symbols to their default value but not 'n') with the 94# on its behavior (sets new symbols to their default value but not 'n') with the
93# counter-intuitive name. 95# counter-intuitive name.
94oldnoconfig: olddefconfig 96oldnoconfig: olddefconfig
97 @echo " WARNING: \"oldnoconfig\" target will be removed after Linux 4.19"
98 @echo " Please use \"olddefconfig\" instead, which is an alias."
95 99
96savedefconfig: $(obj)/conf 100savedefconfig: $(obj)/conf
97 $< $(silent) --$@=defconfig $(Kconfig) 101 $< $(silent) --$@=defconfig $(Kconfig)
@@ -142,7 +146,6 @@ help:
142 @echo ' oldconfig - Update current config utilising a provided .config as base' 146 @echo ' oldconfig - Update current config utilising a provided .config as base'
143 @echo ' localmodconfig - Update current config disabling modules not loaded' 147 @echo ' localmodconfig - Update current config disabling modules not loaded'
144 @echo ' localyesconfig - Update current config converting local mods to core' 148 @echo ' localyesconfig - Update current config converting local mods to core'
145 @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
146 @echo ' defconfig - New config with default from ARCH supplied defconfig' 149 @echo ' defconfig - New config with default from ARCH supplied defconfig'
147 @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' 150 @echo ' savedefconfig - Save current config as ./defconfig (minimal config)'
148 @echo ' allnoconfig - New config where all options are answered with no' 151 @echo ' allnoconfig - New config where all options are answered with no'
@@ -151,8 +154,8 @@ help:
151 @echo ' alldefconfig - New config with all symbols set to default' 154 @echo ' alldefconfig - New config with all symbols set to default'
152 @echo ' randconfig - New config with random answer to all options' 155 @echo ' randconfig - New config with random answer to all options'
153 @echo ' listnewconfig - List new options' 156 @echo ' listnewconfig - List new options'
154 @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their' 157 @echo ' olddefconfig - Same as oldconfig but sets new symbols to their'
155 @echo ' default value' 158 @echo ' default value without prompting'
156 @echo ' kvmconfig - Enable additional options for kvm guest kernel support' 159 @echo ' kvmconfig - Enable additional options for kvm guest kernel support'
157 @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support' 160 @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
158 @echo ' tinyconfig - Configure the tiniest possible kernel' 161 @echo ' tinyconfig - Configure the tiniest possible kernel'
@@ -191,6 +194,7 @@ gconf-objs := gconf.o zconf.tab.o
191 194
192hostprogs-y := conf nconf mconf kxgettext qconf gconf 195hostprogs-y := conf nconf mconf kxgettext qconf gconf
193 196
197targets += zconf.tab.c zconf.lex.c
194clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck 198clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck
195clean-files += zconf.tab.c zconf.lex.c gconf.glade.h 199clean-files += zconf.tab.c zconf.lex.c gconf.glade.h
196clean-files += config.pot linux.pot 200clean-files += config.pot linux.pot
@@ -205,14 +209,12 @@ always := dochecklxdialog
205 209
206# Add environment specific flags 210# Add environment specific flags
207HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) 211HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
212HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS))
208 213
209# generated files seem to need this to find local include files 214# generated files seem to need this to find local include files
210HOSTCFLAGS_zconf.lex.o := -I$(src) 215HOSTCFLAGS_zconf.lex.o := -I$(src)
211HOSTCFLAGS_zconf.tab.o := -I$(src) 216HOSTCFLAGS_zconf.tab.o := -I$(src)
212 217
213LEX_PREFIX_zconf := zconf
214YACC_PREFIX_zconf := zconf
215
216HOSTLOADLIBES_qconf = $(KC_QT_LIBS) 218HOSTLOADLIBES_qconf = $(KC_QT_LIBS)
217HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) 219HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS)
218 220
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 866369f10ff8..307bc3f7b945 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -20,7 +20,6 @@
20 20
21static void conf(struct menu *menu); 21static void conf(struct menu *menu);
22static void check_conf(struct menu *menu); 22static void check_conf(struct menu *menu);
23static void xfgets(char *str, int size, FILE *in);
24 23
25enum input_mode { 24enum input_mode {
26 oldaskconfig, 25 oldaskconfig,
@@ -35,7 +34,8 @@ enum input_mode {
35 savedefconfig, 34 savedefconfig,
36 listnewconfig, 35 listnewconfig,
37 olddefconfig, 36 olddefconfig,
38} input_mode = oldaskconfig; 37};