]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - scripts/kconfig/menu.c
kconfig: allow build-time definition of the internal config prefix
[karo-tx-linux.git] / scripts / kconfig / menu.c
index 203632cc30bdbe12ad0644c3aff15ed07a4e7c0d..64da30c76894cb67d2bbceb81d110af8e18fa88b 100644 (file)
@@ -58,6 +58,8 @@ void menu_add_entry(struct symbol *sym)
        *last_entry_ptr = menu;
        last_entry_ptr = &menu->next;
        current_entry = menu;
+       if (sym)
+               menu_add_symbol(P_SYMBOL, sym, NULL);
 }
 
 void menu_end_entry(void)
@@ -105,6 +107,7 @@ static struct expr *menu_check_dep(struct expr *e)
 void menu_add_dep(struct expr *dep)
 {
        current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
+       current_entry->dir_dep = current_entry->dep;
 }
 
 void menu_set_type(int type)
@@ -288,6 +291,10 @@ void menu_finalize(struct menu *parent)
                for (menu = parent->list; menu; menu = menu->next)
                        menu_finalize(menu);
        } else if (sym) {
+               /* ignore inherited dependencies for dir_dep */
+               sym->dir_dep.expr = expr_transform(expr_copy(parent->dir_dep));
+               sym->dir_dep.expr = expr_eliminate_dups(sym->dir_dep.expr);
+
                basedep = parent->prompt ? parent->prompt->visible.expr : NULL;
                basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
                basedep = expr_eliminate_dups(expr_transform(basedep));
@@ -419,9 +426,13 @@ bool menu_is_visible(struct menu *menu)
        if (!sym || sym_get_tristate_value(menu->sym) == no)
                return false;
 
-       for (child = menu->list; child; child = child->next)
-               if (menu_is_visible(child))
+       for (child = menu->list; child; child = child->next) {
+               if (menu_is_visible(child)) {
+                       if (sym)
+                               sym->flags |= SYMBOL_DEF_USER;
                        return true;
+               }
+       }
 
        return false;
 }
@@ -501,9 +512,19 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
        bool hit;
        struct property *prop;
 
-       if (sym && sym->name)
+       if (sym && sym->name) {
                str_printf(r, "Symbol: %s [=%s]\n", sym->name,
                           sym_get_string_value(sym));
+               str_printf(r, "Type  : %s\n", sym_type_name(sym->type));
+               if (sym->type == S_INT || sym->type == S_HEX) {
+                       prop = sym_get_range_prop(sym);
+                       if (prop) {
+                               str_printf(r, "Range : ");
+                               expr_gstr_print(prop->expr, r);
+                               str_append(r, "\n");
+                       }
+               }
+       }
        for_all_prompts(sym, prop)
                get_prompt_str(r, prop);
        hit = false;
@@ -545,7 +566,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help)
 
        if (menu_has_help(menu)) {
                if (sym->name) {
-                       str_printf(help, "CONFIG_%s:\n\n", sym->name);
+                       str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
                        str_append(help, _(menu_get_help(menu)));
                        str_append(help, "\n");
                }