diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2003-03-15 01:17:04 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-03-15 01:17:04 -0800 |
commit | fb1e151835e62917eeb93ed2a5f6cef9d8392bf5 (patch) | |
tree | b860f15c8b15fa83ae8814ab7f8fee49d2c58da6 /scripts | |
parent | 0deb87aa87368dd4ef75772aa5be81f1f8e7823e (diff) | |
download | history-fb1e151835e62917eeb93ed2a5f6cef9d8392bf5.tar.gz |
[PATCH] restore old config behaviour for dependencies on 'm'
This restores the old config behaviour for dependencies on 'm',
such entries are only activ if CONFIG_MODULES is enabled as well.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/menu.c | 29 | ||||
-rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 4 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 3 |
3 files changed, 30 insertions, 6 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 24be0ec65f3b4..abfe8d72fbfef 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -54,9 +54,34 @@ void menu_end_menu(void) current_menu = current_menu->parent; } +struct expr *menu_check_dep(struct expr *e) +{ + if (!e) + return e; + + switch (e->type) { + case E_NOT: + e->left.expr = menu_check_dep(e->left.expr); + break; + case E_OR: + case E_AND: + e->left.expr = menu_check_dep(e->left.expr); + e->right.expr = menu_check_dep(e->right.expr); + break; + case E_SYMBOL: + /* change 'm' into 'm' && MODULES */ + if (e->left.sym == &symbol_mod) + return expr_alloc_and(e, expr_alloc_symbol(modules_sym)); + break; + default: + break; + } + return e; +} + void menu_add_dep(struct expr *dep) { - current_entry->dep = expr_alloc_and(current_entry->dep, dep); + current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); } void menu_set_type(int type) @@ -96,7 +121,7 @@ struct property *menu_add_prop(int token, char *prompt, struct symbol *def, stru prop->menu = current_entry; prop->text = prompt; prop->def = def; - E_EXPR(prop->visible) = dep; + E_EXPR(prop->visible) = menu_check_dep(dep); if (prompt) current_entry->prompt = prop; diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index d312cc10dc889..1ec370f8c91ec 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped @@ -1726,12 +1726,14 @@ yyreturn: + void conf_parse(const char *name) { zconf_initscan(name); sym_init(); menu_init(); + modules_sym = sym_lookup("MODULES", 0); rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); //zconfdebug = 1; @@ -1740,8 +1742,6 @@ void conf_parse(const char *name) exit(1); menu_finalize(&rootmenu); - modules_sym = sym_lookup("MODULES", 0); - sym_change_count = 1; } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 8d4abc5c1610a..dff6a117ae9ed 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -423,6 +423,7 @@ void conf_parse(const char *name) sym_init(); menu_init(); + modules_sym = sym_lookup("MODULES", 0); rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); //zconfdebug = 1; @@ -431,8 +432,6 @@ void conf_parse(const char *name) exit(1); menu_finalize(&rootmenu); - modules_sym = sym_lookup("MODULES", 0); - sym_change_count = 1; } |