aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r--scripts/kconfig/menu.c49
1 files changed, 42 insertions, 7 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index f9d0d91a3fe4..fdad17367f61 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -15,7 +15,7 @@ static struct menu **last_entry_ptr;
15struct file *file_list; 15struct file *file_list;
16struct file *current_file; 16struct file *current_file;
17 17
18static void menu_warn(struct menu *menu, const char *fmt, ...) 18void menu_warn(struct menu *menu, const char *fmt, ...)
19{ 19{
20 va_list ap; 20 va_list ap;
21 va_start(ap, fmt); 21 va_start(ap, fmt);
@@ -172,6 +172,9 @@ void menu_add_option(int token, char *arg)
172 else if (sym_defconfig_list != current_entry->sym) 172 else if (sym_defconfig_list != current_entry->sym)
173 zconf_error("trying to redefine defconfig symbol"); 173 zconf_error("trying to redefine defconfig symbol");
174 break; 174 break;
175 case T_OPT_ENV:
176 prop_add_env(arg);
177 break;
175 } 178 }
176} 179}
177 180
@@ -239,9 +242,11 @@ void menu_finalize(struct menu *parent)
239 for (menu = parent->list; menu; menu = menu->next) { 242 for (menu = parent->list; menu; menu = menu->next) {
240 if (menu->sym) { 243 if (menu->sym) {
241 current_entry = parent; 244 current_entry = parent;
242 menu_set_type(menu->sym->type); 245 if (sym->type == S_UNKNOWN)
246 menu_set_type(menu->sym->type);
243 current_entry = menu; 247 current_entry = menu;
244 menu_set_type(sym->type); 248 if (menu->sym->type == S_UNKNOWN)
249 menu_set_type(sym->type);
245 break; 250 break;
246 } 251 }
247 } 252 }
@@ -326,12 +331,42 @@ void menu_finalize(struct menu *parent)
326 "values not supported"); 331 "values not supported");
327 } 332 }
328 current_entry = menu; 333 current_entry = menu;
329 menu_set_type(sym->type); 334 if (menu->sym->type == S_UNKNOWN)
335 menu_set_type(sym->type);
336 /* Non-tristate choice values of tristate choices must
337 * depend on the choice being set to Y. The choice
338 * values' dependencies were propagated to their
339 * properties above, so the change here must be re-
340 * propagated. */
341 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) {
342 basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes);
343 basedep = expr_alloc_and(basedep, menu->dep);
344 basedep = expr_eliminate_dups(basedep);
345 menu->dep = basedep;
346 for (prop = menu->sym->prop; prop; prop = prop->next) {
347 if (prop->menu != menu)
348 continue;
349 dep = expr_alloc_and(expr_copy(basedep),
350 prop->visible.expr);
351 dep = expr_eliminate_dups(dep);
352 dep = expr_trans_bool(dep);
353 prop->visible.expr = dep;
354 if (prop->type == P_SELECT) {
355 struct symbol *es = prop_get_symbol(prop);
356 dep2 = expr_alloc_symbol(menu->sym);
357 dep = expr_alloc_and(dep2,
358 expr_copy(dep));
359 dep = expr_alloc_or(es->rev_dep.expr, dep);
360 dep = expr_eliminate_dups(dep);
361 es->rev_dep.expr = dep;
362 }
363 }
364 }
330 menu_add_symbol(P_CHOICE, sym, NULL); 365 menu_add_symbol(P_CHOICE, sym, NULL);
331 prop = sym_get_choice_prop(sym); 366 prop = sym_get_choice_prop(sym);
332 for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) 367 for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr)
333 ; 368 ;
334 *ep = expr_alloc_one(E_CHOICE, NULL); 369 *ep = expr_alloc_one(E_LIST, NULL);
335 (*ep)->right.sym = menu->sym; 370 (*ep)->right.sym = menu->sym;
336 } 371 }
337 if (menu->list && (!menu->prompt || !menu->prompt->text)) { 372 if (menu->list && (!menu->prompt || !menu->prompt->text)) {
@@ -394,9 +429,9 @@ bool menu_is_visible(struct menu *menu)
394const char *menu_get_prompt(struct menu *menu) 429const char *menu_get_prompt(struct menu *menu)
395{ 430{
396 if (menu->prompt) 431 if (menu->prompt)
397 return _(menu->prompt->text); 432 return menu->prompt->text;
398 else if (menu->sym) 433 else if (menu->sym)
399 return _(menu->sym->name); 434 return menu->sym->name;
400 return NULL; 435 return NULL;
401} 436}
402 437