]> git.hungrycats.org Git - linux/commitdiff
[PATCH] restore old config behaviour for dependencies on 'm'
authorRoman Zippel <zippel@linux-m68k.org>
Sat, 15 Mar 2003 09:17:04 +0000 (01:17 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 15 Mar 2003 09:17:04 +0000 (01:17 -0800)
This restores the old config behaviour for dependencies on 'm',
such entries are only activ if CONFIG_MODULES is enabled as well.

scripts/kconfig/menu.c
scripts/kconfig/zconf.tab.c_shipped
scripts/kconfig/zconf.y

index 24be0ec65f3b4a51b3f8c952980e61187bd7147e..abfe8d72fbfefe8e7fb8868e8f8defb7a4c0ffd3 100644 (file)
@@ -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;
index d312cc10dc8894cb86b05cecc0d7828f740f935f..1ec370f8c91ec76a95de71c3c88d1f38b20170c0 100644 (file)
@@ -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;
 }
 
index 8d4abc5c1610a469986dcd2e59ddabd6cbbe80ff..dff6a117ae9ed4907836d419317c066d53da609f 100644 (file)
@@ -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;
 }