diff options
Diffstat (limited to 'scripts/kconfig/zconf.y')
-rw-r--r-- | scripts/kconfig/zconf.y | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 1f61fba6aa28..ab44feb3c600 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -71,6 +71,7 @@ static struct menu *current_menu, *current_entry; | |||
71 | %token <id>T_DEFAULT | 71 | %token <id>T_DEFAULT |
72 | %token <id>T_SELECT | 72 | %token <id>T_SELECT |
73 | %token <id>T_RANGE | 73 | %token <id>T_RANGE |
74 | %token <id>T_OPTION | ||
74 | %token <id>T_ON | 75 | %token <id>T_ON |
75 | %token <string> T_WORD | 76 | %token <string> T_WORD |
76 | %token <string> T_WORD_QUOTE | 77 | %token <string> T_WORD_QUOTE |
@@ -91,6 +92,7 @@ static struct menu *current_menu, *current_entry; | |||
91 | %type <id> end | 92 | %type <id> end |
92 | %type <id> option_name | 93 | %type <id> option_name |
93 | %type <menu> if_entry menu_entry choice_entry | 94 | %type <menu> if_entry menu_entry choice_entry |
95 | %type <string> symbol_option_arg | ||
94 | 96 | ||
95 | %destructor { | 97 | %destructor { |
96 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", | 98 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", |
@@ -173,6 +175,7 @@ menuconfig_stmt: menuconfig_entry_start config_option_list | |||
173 | config_option_list: | 175 | config_option_list: |
174 | /* empty */ | 176 | /* empty */ |
175 | | config_option_list config_option | 177 | | config_option_list config_option |
178 | | config_option_list symbol_option | ||
176 | | config_option_list depends | 179 | | config_option_list depends |
177 | | config_option_list help | 180 | | config_option_list help |
178 | | config_option_list option_error | 181 | | config_option_list option_error |
@@ -215,6 +218,26 @@ config_option: T_RANGE symbol symbol if_expr T_EOL | |||
215 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); | 218 | printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); |
216 | }; | 219 | }; |
217 | 220 | ||
221 | symbol_option: T_OPTION symbol_option_list T_EOL | ||
222 | ; | ||
223 | |||
224 | symbol_option_list: | ||
225 | /* empty */ | ||
226 | | symbol_option_list T_WORD symbol_option_arg | ||
227 | { | ||
228 | struct kconf_id *id = kconf_id_lookup($2, strlen($2)); | ||
229 | if (id && id->flags & TF_OPTION) | ||
230 | menu_add_option(id->token, $3); | ||
231 | else | ||
232 | zconfprint("warning: ignoring unknown option %s", $2); | ||
233 | free($2); | ||
234 | }; | ||
235 | |||
236 | symbol_option_arg: | ||
237 | /* empty */ { $$ = NULL; } | ||
238 | | T_EQUAL prompt { $$ = $2; } | ||
239 | ; | ||
240 | |||
218 | /* choice entry */ | 241 | /* choice entry */ |
219 | 242 | ||
220 | choice: T_CHOICE T_EOL | 243 | choice: T_CHOICE T_EOL |
@@ -458,7 +481,9 @@ void conf_parse(const char *name) | |||
458 | 481 | ||
459 | sym_init(); | 482 | sym_init(); |
460 | menu_init(); | 483 | menu_init(); |
461 | modules_sym = sym_lookup("MODULES", 0); | 484 | modules_sym = sym_lookup(NULL, 0); |
485 | modules_sym->type = S_BOOLEAN; | ||
486 | modules_sym->flags |= SYMBOL_AUTO; | ||
462 | rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); | 487 | rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); |
463 | 488 | ||
464 | #if YYDEBUG | 489 | #if YYDEBUG |
@@ -468,6 +493,12 @@ void conf_parse(const char *name) | |||
468 | zconfparse(); | 493 | zconfparse(); |
469 | if (zconfnerrs) | 494 | if (zconfnerrs) |
470 | exit(1); | 495 | exit(1); |
496 | if (!modules_sym->prop) { | ||
497 | struct property *prop; | ||
498 | |||
499 | prop = prop_alloc(P_DEFAULT, modules_sym); | ||
500 | prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); | ||
501 | } | ||
471 | menu_finalize(&rootmenu); | 502 | menu_finalize(&rootmenu); |
472 | for_all_symbols(i, sym) { | 503 | for_all_symbols(i, sym) { |
473 | sym_check_deps(sym); | 504 | sym_check_deps(sym); |