diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-01 14:45:49 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-01 14:45:49 -0500 |
| commit | 562f36ed28e6faa4245ea2ca1392d90ab98ebbe8 (patch) | |
| tree | 85a5d50df8a72cb98c9096a57b2ab25721603115 /scripts | |
| parent | a659f1598585071eed5c39485840b0f018c9f457 (diff) | |
| parent | cedd55d49dee941d0e4fabb2f2f555d50c53fad7 (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.lib | 28 | ||||
| -rw-r--r-- | scripts/kconfig/Makefile | 14 | ||||
| -rw-r--r-- | scripts/kconfig/conf.c | 25 | ||||
| -rw-r--r-- | scripts/kconfig/confdata.c | 6 | ||||
| -rw-r--r-- | scripts/kconfig/expr.c | 136 | ||||
| -rw-r--r-- | scripts/kconfig/expr.h | 91 | ||||
| -rw-r--r-- | scripts/kconfig/kconf_id.c | 1 | ||||
| -rw-r--r-- | scripts/kconfig/lkc.h | 1 | ||||
| -rw-r--r-- | scripts/kconfig/mconf.c | 2 | ||||
| -rw-r--r-- | scripts/kconfig/menu.c | 186 | ||||
| -rw-r--r-- | scripts/kconfig/symbol.c | 14 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.l | 16 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.lex.c_shipped | 2473 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 2471 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.y | 111 |
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))))))) |
| 187 | endef | 187 | endef |
| 188 | 188 | ||
| 189 | ifdef REGENERATE_PARSERS | ||
| 190 | |||
| 191 | # LEX | 189 | # LEX |
| 192 | # --------------------------------------------------------------------------- | 190 | # --------------------------------------------------------------------------- |
| 193 | LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy) | ||
| 194 | |||
| 195 | quiet_cmd_flex = LEX $@ | 191 | quiet_cmd_flex = LEX $@ |
| 196 | cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $< | 192 | cmd_flex = $(LEX) -o$@ -L $< |
| 197 | 193 | ||
| 194 | ifdef 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) |
| 198 | endif | ||
| 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 | # --------------------------------------------------------------------------- |
| 204 | YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) | ||
| 205 | |||
| 206 | quiet_cmd_bison = YACC $@ | 206 | quiet_cmd_bison = YACC $@ |
| 207 | cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $< | 207 | cmd_bison = $(YACC) -o$@ -t -l $< |
| 208 | 208 | ||
| 209 | ifdef 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) |
| 213 | endif | ||
| 214 | |||
| 215 | .PRECIOUS: $(obj)/%.tab.c | ||
| 216 | $(filter %.tab.c,$(targets)): $(obj)/%.tab.c: $(src)/%.y FORCE | ||
| 217 | $(call if_changed,bison) | ||
| 212 | 218 | ||
| 213 | quiet_cmd_bison_h = YACC $@ | 219 | quiet_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 | ||
| 222 | ifdef 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 | |||
| 220 | endif | 226 | endif |
| 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 | |||
| 34 | nconfig: $(obj)/nconf | 34 | nconfig: $(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. | ||
| 37 | silentoldconfig: $(obj)/conf | 39 | silentoldconfig: $(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. |
| 94 | oldnoconfig: olddefconfig | 96 | oldnoconfig: 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 | ||
| 96 | savedefconfig: $(obj)/conf | 100 | savedefconfig: $(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 | ||
| 192 | hostprogs-y := conf nconf mconf kxgettext qconf gconf | 195 | hostprogs-y := conf nconf mconf kxgettext qconf gconf |
| 193 | 196 | ||
| 197 | targets += zconf.tab.c zconf.lex.c | ||
| 194 | clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck | 198 | clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck |
| 195 | clean-files += zconf.tab.c zconf.lex.c gconf.glade.h | 199 | clean-files += zconf.tab.c zconf.lex.c gconf.glade.h |
| 196 | clean-files += config.pot linux.pot | 200 | clean-files += config.pot linux.pot |
| @@ -205,14 +209,12 @@ always := dochecklxdialog | |||
| 205 | 209 | ||
| 206 | # Add environment specific flags | 210 | # Add environment specific flags |
| 207 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) | 211 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) |
| 212 | HOST_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 |
| 210 | HOSTCFLAGS_zconf.lex.o := -I$(src) | 215 | HOSTCFLAGS_zconf.lex.o := -I$(src) |
| 211 | HOSTCFLAGS_zconf.tab.o := -I$(src) | 216 | HOSTCFLAGS_zconf.tab.o := -I$(src) |
| 212 | 217 | ||
| 213 | LEX_PREFIX_zconf := zconf | ||
| 214 | YACC_PREFIX_zconf := zconf | ||
| 215 | |||
| 216 | HOSTLOADLIBES_qconf = $(KC_QT_LIBS) | 218 | HOSTLOADLIBES_qconf = $(KC_QT_LIBS) |
| 217 | HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) | 219 | HOSTCXXFLAGS_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 | ||
| 21 | static void conf(struct menu *menu); | 21 | static void conf(struct menu *menu); |
| 22 | static void check_conf(struct menu *menu); | 22 | static void check_conf(struct menu *menu); |
| 23 | static void xfgets(char *str, int size, FILE *in); | ||
| 24 | 23 | ||
| 25 | enum input_mode { | 24 | enum 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 | }; |
