]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blobdiff - scripts/kconfig/menu.c
kconfig: add an option to determine a menu's visibility
[mcf548x/linux.git] / scripts / kconfig / menu.c
index 7e83aef42c6d41c63051664b2669c922356bff3a..b9d9aa18e6d62bbaa40c34cf7062c00c8bb15e35 100644 (file)
@@ -152,6 +152,12 @@ struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr
        return menu_add_prop(type, prompt, NULL, dep);
 }
 
+void menu_add_visibility(struct expr *expr)
+{
+       current_entry->visibility = expr_alloc_and(current_entry->visibility,
+           expr);
+}
+
 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
 {
        menu_add_prop(type, NULL, expr, dep);
@@ -410,6 +416,11 @@ bool menu_is_visible(struct menu *menu)
        if (!menu->prompt)
                return false;
 
+       if (menu->visibility) {
+               if (expr_calc_value(menu->visibility) == no)
+                       return no;
+       }
+
        sym = menu->sym;
        if (sym) {
                sym_calc_value(sym);