kconfig: do not special-case 'MODULES' symbol

Currently, the 'MODULES' symbol is hard-coded to be the default symbol
that enables/disables tristates, if no other symbol was declared with
'option modules'.

While this used to be needed for the Linux kernel, we now have an
explicit 'option modules' attached to the 'MODULES' symbol (since
cset 11097a036), so we no longer need to special-case it in the
kconfig code.

Furthermore, kconfig is extensively used out of the Linux kernel, and
other projects may have another meaning for a symbol named 'MODULES'.

This patch changes the way we enable/disable tristates: if a symbol was
found with 'option modules' attached to it, then that symbol controls
enabling tristates. Otherwise, tristates are disabled, even if a symbol
named 'MODULES' exists.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
Yann E. MORIN 2013-09-03 17:07:18 +02:00 committed by Michal Marek
parent c8272faf5e
commit 6902dccfda
2 changed files with 3 additions and 13 deletions

View file

@ -197,12 +197,9 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
void menu_add_option(int token, char *arg) void menu_add_option(int token, char *arg)
{ {
struct property *prop;
switch (token) { switch (token) {
case T_OPT_MODULES: case T_OPT_MODULES:
prop = prop_alloc(P_DEFAULT, modules_sym); modules_sym = current_entry->sym;
prop->expr = expr_alloc_symbol(current_entry->sym);
break; break;
case T_OPT_DEFCONFIG_LIST: case T_OPT_DEFCONFIG_LIST:
if (!sym_defconfig_list) if (!sym_defconfig_list)

View file

@ -493,9 +493,6 @@ void conf_parse(const char *name)
sym_init(); sym_init();
_menu_init(); _menu_init();
modules_sym = sym_lookup(NULL, 0);
modules_sym->type = S_BOOLEAN;
modules_sym->flags |= SYMBOL_AUTO;
rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
if (getenv("ZCONF_DEBUG")) if (getenv("ZCONF_DEBUG"))
@ -503,12 +500,8 @@ void conf_parse(const char *name)
zconfparse(); zconfparse();
if (zconfnerrs) if (zconfnerrs)
exit(1); exit(1);
if (!modules_sym->prop) { if (!modules_sym)
struct property *prop; modules_sym = sym_find( "n" );
prop = prop_alloc(P_DEFAULT, modules_sym);
prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
}
rootmenu.prompt->text = _(rootmenu.prompt->text); rootmenu.prompt->text = _(rootmenu.prompt->text);
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);