History

Merge branch 'kbuild/kconfig/kbuild-generic-v7' of http://github.com/lacombar/linux-2.6 into kbuild/kconfig

* 'kbuild/kconfig/kbuild-generic-v7' of http://github.com/lacombar/linux-2.6: kbuild: migrate all arch to the kconfig mainmenu upgrade kconfig: expand file names kconfig: use the file's name of sourced file kconfig: constify file name kconfig: don't emit warning upon rootmenu's prompt redefinition kconfig: replace KERNELVERSION usage by the mainmenu's prompt kconfig: delay gconf window initialization kconfig: expand by default the rootmenu's prompt kconfig: add a symbol string expansion helper kconfig: regen parser kconfig: implement the `mainmenu' directive kconfig: allow PACKAGE to be defined on the compiler's command-line kconfig: rephrase help texts/comments not to include the package name kconfig: allow build-time definition of the internal config prefix kconfig: rephrase help text not to mention the internal prefix kconfig: replace a `switch()' statement by a more flexible `if()' statement

Michal Marek committed 16 years ago

Commit 04550292 parents 8c41e5e 838a2e542 files · +501 −560Browse files

Showing the changes to scripts (17 of 42 files). Show all

Unified · Split

17 files
  1. scripts/kconfig/Makefile +1 −1
  2. scripts/kconfig/conf.c +6 −7
  3. scripts/kconfig/confdata.c +37 −44
  4. scripts/kconfig/expr.h +1 −1
  5. scripts/kconfig/gconf.c +8 −12
  6. scripts/kconfig/lex.zconf.c_shipped +4 −3
  7. scripts/kconfig/lkc.h +7 −1
  8. scripts/kconfig/lkc_proto.h +1 −0
  9. scripts/kconfig/mconf.c +29 −35
  10. scripts/kconfig/menu.c +3 −3
  11. scripts/kconfig/nconf.c +32 −41
  12. scripts/kconfig/qconf.cc +3 −3
  13. scripts/kconfig/symbol.c +49 −0
  14. scripts/kconfig/util.c +5 −2
  15. scripts/kconfig/zconf.l +4 −3
  16. scripts/kconfig/zconf.tab.c_shipped +283 −264
  17. scripts/kconfig/zconf.y +15 −3
scripts/kconfig/Makefile+1−1
@@ -8,7 +8,7 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-c · 7 unmodified lines
88 ifdef KBUILD_KCONFIG
99 Kconfig := $(KBUILD_KCONFIG)
1010 else
11−Kconfig := arch/$(SRCARCH)/Kconfig
11+Kconfig := Kconfig
1212 endif
1313
1414 xconfig: $(obj)/qconf
scripts/kconfig/conf.c+6−7
@@ -425,7 +425,7 @@ static void check_conf(struct menu *menu) · 424 unmodified lines
425425 (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
426426 if (input_mode == listnewconfig) {
427427 if (sym->name && !sym_is_choice_value(sym)) {
428− printf("CONFIG_%s\n", sym->name);
428+ printf("%s%s\n", CONFIG_, sym->name);
429429 }
430430 } else if (input_mode != oldnoconfig) {
431431 if (!conf_cnt++)
@@ -508,8 +508,7 @@ int main(int ac, char **av) · 76 unmodified lines
508508 name = conf_get_configname();
509509 if (stat(name, &tmpstat)) {
510510 fprintf(stderr, _("***\n"
511− "*** You have not yet configured your kernel!\n"
512− "*** (missing kernel config file \"%s\")\n"
511+ "*** Configuration file \"%s\" not found!\n"
513512 "***\n"
514513 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
515514 "*** \"make menuconfig\" or \"make xconfig\").\n"
@@ -571,7 +570,7 @@ int main(int ac, char **av) · 55 unmodified lines
571570 name = getenv("KCONFIG_NOSILENTUPDATE");
572571 if (name && *name) {
573572 fprintf(stderr,
574− _("\n*** Kernel configuration requires explicit update.\n\n"));
573+ _("\n*** The configuration requires explicit update.\n\n"));
575574 return 1;
576575 }
577576 }
@@ -623,11 +622,11 @@ int main(int ac, char **av) · 45 unmodified lines
623622 * All other commands are only used to generate a config.
624623 */
625624 if (conf_get_changed() && conf_write(NULL)) {
626− fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
625+ fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
627626 exit(1);
628627 }
629628 if (conf_write_autoconf()) {
630− fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n"));
629+ fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
631630 return 1;
632631 }
633632 } else if (input_mode == savedefconfig) {
@@ -638,7 +637,7 @@ int main(int ac, char **av) · 4 unmodified lines
638637 }
639638 } else if (input_mode != listnewconfig) {
640639 if (conf_write(NULL)) {
641− fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
640+ fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
642641 exit(1);
643642 }
644643 }
scripts/kconfig/confdata.c+37−44
@@ -221,24 +221,23 @@ load: · 220 unmodified lines
221221 while (fgets(line, sizeof(line), in)) {
222222 conf_lineno++;
223223 sym = NULL;
224− switch (line[0]) {
225− case '#':
226− if (memcmp(line + 2, "CONFIG_", 7))
224+ if (line[0] == '#') {
225+ if (memcmp(line + 2, CONFIG_, strlen(CONFIG_)))
227226 continue;
228− p = strchr(line + 9, ' ');
227+ p = strchr(line + 2 + strlen(CONFIG_), ' ');
229228 if (!p)
230229 continue;
231230 *p++ = 0;
232231 if (strncmp(p, "is not set", 10))
233232 continue;
234233 if (def == S_DEF_USER) {
235− sym = sym_find(line + 9);
234+ sym = sym_find(line + 2 + strlen(CONFIG_));
236235 if (!sym) {
237236 sym_add_change_count(1);
238237 break;
239238 }
240239 } else {
241− sym = sym_lookup(line + 9, 0);
240+ sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
242241 if (sym->type == S_UNKNOWN)
243242 sym->type = S_BOOLEAN;
244243 }
@@ -254,13 +253,8 @@ load: · 9 unmodified lines
254253 default:
255254 ;
256255 }
257− break;
258− case 'C':
259− if (memcmp(line, "CONFIG_", 7)) {
260− conf_warning("unexpected data");
261− continue;
262− }
263− p = strchr(line + 7, '=');
256+ } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) {
257+ p = strchr(line + strlen(CONFIG_), '=');
264258 if (!p)
265259 continue;
266260 *p++ = 0;
@@ -271,13 +265,13 @@ load: · 4 unmodified lines
271265 *p2 = 0;
272266 }
273267 if (def == S_DEF_USER) {
274− sym = sym_find(line + 7);
268+ sym = sym_find(line + strlen(CONFIG_));
275269 if (!sym) {
276270 sym_add_change_count(1);
277271 break;
278272 }
279273 } else {
280− sym = sym_lookup(line + 7, 0);
274+ sym = sym_lookup(line + strlen(CONFIG_), 0);
281275 if (sym->type == S_UNKNOWN)
282276 sym->type = S_OTHER;
283277 }
@@ -286,12 +280,9 @@ load: · 2 unmodified lines
286280 }
287281 if (conf_set_sym_val(sym, def, def_flags, p))
288282 continue;
289− break;
290− case '\r':
291− case '\n':
292− break;
293− default:
294− conf_warning("unexpected data");
283+ } else {
284+ if (line[0] != '\r' && line[0] != '\n')
285+ conf_warning("unexpected data");
295286 continue;
296287 }
297288 if (sym && sym_is_choice_value(sym)) {
@@ -406,9 +397,9 @@ static void conf_write_string(bool headerfile, const char *name, · 108 unmodified lines
406397 {
407398 int l;
408399 if (headerfile)
409− fprintf(out, "#define CONFIG_%s \"", name);
400+ fprintf(out, "#define %s%s \"", CONFIG_, name);
410401 else
411− fprintf(out, "CONFIG_%s=\"", name);
402+ fprintf(out, "%s%s=\"", CONFIG_, name);
412403
413404 while (1) {
414405 l = strcspn(str, "\"\\");
@@ -434,13 +425,14 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type, · 19 unmodified lines
434425 switch (sym_get_tristate_value(sym)) {
435426 case no:
436427 if (write_no)
437− fprintf(out, "# CONFIG_%s is not set\n", sym->name);
428+ fprintf(out, "# %s%s is not set\n",
429+ CONFIG_, sym->name);
438430 break;
439431 case mod:
440− fprintf(out, "CONFIG_%s=m\n", sym->name);
432+ fprintf(out, "%s%s=m\n", CONFIG_, sym->name);
441433 break;
442434 case yes:
443− fprintf(out, "CONFIG_%s=y\n", sym->name);
435+ fprintf(out, "%s%s=y\n", CONFIG_, sym->name);
444436 break;
445437 }
446438 break;
@@ -450,7 +442,7 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type, · 3 unmodified lines
450442 case S_HEX:
451443 case S_INT:
452444 str = sym_get_string_value(sym);
453− fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
445+ fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str);
454446 break;
455447 case S_OTHER:
456448 case S_UNKNOWN:
@@ -582,8 +574,6 @@ int conf_write(const char *name) · 125 unmodified lines
582574 if (!out)
583575 return 1;
584576
585− sym = sym_lookup("KERNELVERSION", 0);
586− sym_calc_value(sym);
587577 time(&now);
588578 env = getenv("KCONFIG_NOTIMESTAMP");
589579 if (env && *env)
@@ -591,10 +581,10 @@ int conf_write(const char *name) · 1 unmodified line
591581
592582 fprintf(out, _("#\n"
593583 "# Automatically generated make config: don't edit\n"
594− "# Linux kernel version: %s\n"
584+ "# %s\n"
595585 "%s%s"
596586 "#\n"),
597− sym_get_string_value(sym),
587+ rootmenu.prompt->text,
598588 use_timestamp ? "# " : "",
599589 use_timestamp ? ctime(&now) : "");
600590
@@ -805,25 +795,23 @@ int conf_write_autoconf(void) · 204 unmodified lines
805795 return 1;
806796 }
807797
808− sym = sym_lookup("KERNELVERSION", 0);
809− sym_calc_value(sym);
810798 time(&now);
811799 fprintf(out, "#\n"
812800 "# Automatically generated make config: don't edit\n"
813− "# Linux kernel version: %s\n"
801+ "# %s\n"
814802 "# %s"
815803 "#\n",
816− sym_get_string_value(sym), ctime(&now));
804+ rootmenu.prompt->text, ctime(&now));
817805 fprintf(tristate, "#\n"
818806 "# Automatically generated - do not edit\n"
819807 "\n");
820808 fprintf(out_h, "/*\n"
821809 " * Automatically generated C config: don't edit\n"
822− " * Linux kernel version: %s\n"
810+ " * %s\n"
823811 " * %s"
824812 " */\n"
825813 "#define AUTOCONF_INCLUDED\n",
826− sym_get_string_value(sym), ctime(&now));
814+ rootmenu.prompt->text, ctime(&now));
827815
828816 for_all_symbols(i, sym) {
829817 sym_calc_value(sym);
@@ -841,14 +829,17 @@ int conf_write_autoconf(void) · 11 unmodified lines
841829 case no:
842830 break;
843831 case mod:
844− fprintf(tristate, "CONFIG_%s=M\n", sym->name);
845− fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
832+ fprintf(tristate, "%s%s=M\n",
833+ CONFIG_, sym->name);
834+ fprintf(out_h, "#define %s%s_MODULE 1\n",
835+ CONFIG_, sym->name);
846836 break;
847837 case yes:
848838 if (sym->type == S_TRISTATE)
849− fprintf(tristate, "CONFIG_%s=Y\n",
850− sym->name);
851− fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
839+ fprintf(tristate,"%s%s=Y\n",
840+ CONFIG_, sym->name);
841+ fprintf(out_h, "#define %s%s 1\n",
842+ CONFIG_, sym->name);
852843 break;
853844 }
854845 break;
@@ -858,12 +849,14 @@ int conf_write_autoconf(void) · 3 unmodified lines
858849 case S_HEX:
859850 str = sym_get_string_value(sym);
860851 if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
861− fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
852+ fprintf(out_h, "#define %s%s 0x%s\n",
853+ CONFIG_, sym->name, str);
862854 break;
863855 }
864856 case S_INT:
865857 str = sym_get_string_value(sym);
866− fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
858+ fprintf(out_h, "#define %s%s %s\n",
859+ CONFIG_, sym->name, str);
867860 break;
868861 default:
869862 break;
scripts/kconfig/expr.h+1−1
@@ -18,7 +18,7 @@ extern "C" { · 17 unmodified lines
1818 struct file {
1919 struct file *next;
2020 struct file *parent;
21− char *name;
21+ const char *name;
2222 int lineno;
2323 int flags;
2424 };
scripts/kconfig/gconf.c+8−12
@@ -133,7 +133,6 @@ void init_main_window(const gchar * glade_file) · 132 unmodified lines
133133 GladeXML *xml;
134134 GtkWidget *widget;
135135 GtkTextBuffer *txtbuf;
136− char title[256];
137136 GtkStyle *style;
138137
139138 xml = glade_xml_new(glade_file, "window1", NULL);
@@ -210,9 +209,7 @@ void init_main_window(const gchar * glade_file) · 70 unmodified lines
210209 /*"style", PANGO_STYLE_OBLIQUE, */
211210 NULL);
212211
213− sprintf(title, _("Linux Kernel v%s Configuration"),
214− getenv("KERNELVERSION"));
215− gtk_window_set_title(GTK_WINDOW(main_wnd), title);
212+ gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text);
216213
217214 gtk_widget_show(main_wnd);
218215 }
@@ -671,8 +668,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) · 452 unmodified lines
671668 {
672669 GtkWidget *dialog;
673670 const gchar *intro_text = _(
674− "Welcome to gkc, the GTK+ graphical kernel configuration tool\n"
675− "for Linux.\n"
671+ "Welcome to gkc, the GTK+ graphical configuration tool\n"
676672 "For each option, a blank box indicates the feature is disabled, a\n"
677673 "check indicates it is enabled, and a dot indicates that it is to\n"
678674 "be compiled as a module. Clicking on the box will cycle through the three states.\n"
@@ -1531,12 +1527,6 @@ int main(int ac, char *av[]) · 852 unmodified lines
15311527 else
15321528 glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL);
15331529
1534− /* Load the interface and connect signals */
1535− init_main_window(glade_file);
1536− init_tree_model();
1537− init_left_tree();
1538− init_right_tree();
1539−
15401530 /* Conf stuffs */
15411531 if (ac > 1 && av[1][0] == '-') {
15421532 switch (av[1][1]) {
@@ -1556,6 +1546,12 @@ int main(int ac, char *av[]) · 13 unmodified lines
15561546 fixup_rootmenu(&rootmenu);
15571547 conf_read(NULL);
15581548
1549+ /* Load the interface and connect signals */
1550+ init_main_window(glade_file);
1551+ init_tree_model();
1552+ init_left_tree();
1553+ init_right_tree();
1554+
15591555 switch (view_mode) {
15601556 case SINGLE_VIEW:
15611557 display_tree_part();
scripts/kconfig/lex.zconf.c_shipped+4−3
@@ -2373,9 +2373,10 @@ void zconf_nextfile(const char *name) · 2372 unmodified lines
23732373 memset(buf, 0, sizeof(*buf));
23742374
23752375 current_buf->state = YY_CURRENT_BUFFER;
2376− zconfin = zconf_fopen(name);
2376+ zconfin = zconf_fopen(file->name);
23772377 if (!zconfin) {
2378− printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
2378+ printf("%s:%d: can't open file \"%s\"\n",
2379+ zconf_curname(), zconf_lineno(), file->name);
23792380 exit(1);
23802381 }
23812382 zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
@@ -2422,7 +2423,7 @@ int zconf_lineno(void) · 40 unmodified lines
24222423 return current_pos.lineno;
24232424 }
24242425
2425−char *zconf_curname(void)
2426+const char *zconf_curname(void)
24262427 {
24272428 return current_pos.file ? current_pos.file->name : "<none>";
24282429 }
scripts/kconfig/lkc.h+7−1
@@ -31,12 +31,18 @@ extern "C" { · 30 unmodified lines
3131
3232 #define SRCTREE "srctree"
3333
34+#ifndef PACKAGE
3435 #define PACKAGE "linux"
36+#endif
37+
3538 #define LOCALEDIR "/usr/share/locale"
3639
3740 #define _(text) gettext(text)
3841 #define N_(text) (text)
3942
43+#ifndef CONFIG_
44+#define CONFIG_ "CONFIG_"
45+#endif
4046
4147 #define TF_COMMAND 0x0001
4248 #define TF_PARAM 0x0002
@@ -70,7 +76,7 @@ FILE *zconf_fopen(const char *name); · 27 unmodified lines
7076 void zconf_initscan(const char *name);
7177 void zconf_nextfile(const char *name);
7278 int zconf_lineno(void);
73−char *zconf_curname(void);
79+const char *zconf_curname(void);
7480
7581 /* conf.c */
7682 void xfgets(char *str, int size, FILE *in);
scripts/kconfig/lkc_proto.h+1−0
@@ -28,6 +28,7 @@ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); · 27 unmodified lines
2828
2929 P(sym_lookup,struct symbol *,(const char *name, int flags));
3030 P(sym_find,struct symbol *,(const char *name));
31+P(sym_expand_string_value,const char *,(const char *in));
3132 P(sym_re_search,struct symbol **,(const char *pattern));
3233 P(sym_type_name,const char *,(enum symbol_type type));
3334 P(sym_calc_value,void,(struct symbol *sym));
scripts/kconfig/mconf.c+29−35
@@ -25,11 +25,9 @@ · 24 unmodified lines
2525 static const char mconf_readme[] = N_(
2626 "Overview\n"
2727 "--------\n"
28−"Some kernel features may be built directly into the kernel.\n"
29−"Some may be made into loadable runtime modules. Some features\n"
30−"may be completely removed altogether. There are also certain\n"
31−"kernel parameters which are not really features, but must be\n"
32−"entered in as decimal or hexadecimal numbers or possibly text.\n"
28+"This interface let you select features and parameters for the build.\n"
29+"Features can either be built-in, modularized, or ignored. Parameters\n"
30+"must be entered in as decimal or hexadecimal numbers or text.\n"
3331 "\n"
3432 "Menu items beginning with following braces represent features that\n"
3533 " [ ] can be built in or removed\n"
@@ -117,7 +115,7 @@ static const char mconf_readme[] = N_( · 81 unmodified lines
117115 "-----------------------------\n"
118116 "Menuconfig supports the use of alternate configuration files for\n"
119117 "those who, for various reasons, find it necessary to switch\n"
120−"between different kernel configurations.\n"
118+"between different configurations.\n"
121119 "\n"
122120 "At the end of the main menu you will find two options. One is\n"
123121 "for saving the current configuration to a file of your choosing.\n"
@@ -150,9 +148,9 @@ static const char mconf_readme[] = N_( · 26 unmodified lines
150148 "\n"
151149 "Optional personality available\n"
152150 "------------------------------\n"
153−"If you prefer to have all of the kernel options listed in a single\n"
154−"menu, rather than the default multimenu hierarchy, run the menuconfig\n"
155−"with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
151+"If you prefer to have all of the options listed in a single menu, rather\n"
152+"than the default multimenu hierarchy, run the menuconfig with\n"
153+"MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
156154 "\n"
157155 "make MENUCONFIG_MODE=single_menu menuconfig\n"
158156 "\n"
@@ -207,12 +205,12 @@ load_config_text[] = N_( · 48 unmodified lines
207205 "last retrieved. Leave blank to abort."),
208206 load_config_help[] = N_(
209207 "\n"
210− "For various reasons, one may wish to keep several different kernel\n"
208+ "For various reasons, one may wish to keep several different\n"
211209 "configurations available on a single machine.\n"
212210 "\n"
213211 "If you have saved a previous configuration in a file other than the\n"
214− "kernel's default, entering the name of the file here will allow you\n"
215− "to modify that configuration.\n"
212+ "default one, entering its name here will allow you to modify that\n"
213+ "configuration.\n"
216214 "\n"
217215 "If you are uncertain, then you have probably never used alternate\n"
218216 "configuration files. You should therefore leave this blank to abort.\n"),
@@ -221,8 +219,8 @@ save_config_text[] = N_( · 2 unmodified lines
221219 "as an alternate. Leave blank to abort."),
222220 save_config_help[] = N_(
223221 "\n"
224− "For various reasons, one may wish to keep different kernel\n"
225− "configurations available on a single machine.\n"
222+ "For various reasons, one may wish to keep different configurations\n"
223+ "available on a single machine.\n"
226224 "\n"
227225 "Entering a file name here will allow you to later retrieve, modify\n"
228226 "and use the current configuration as an alternate to whatever\n"
@@ -232,7 +230,7 @@ save_config_help[] = N_( · 3 unmodified lines
232230 "leave this blank.\n"),
233231 search_help[] = N_(
234232 "\n"
235− "Search for CONFIG_ symbols and display their relations.\n"
233+ "Search for symbols and display their relations.\n"
236234 "Regular expressions are allowed.\n"
237235 "Example: search for \"^FOO\"\n"
238236 "Result:\n"
@@ -249,7 +247,7 @@ search_help[] = N_( · 10 unmodified lines
249247 "Selected by: BAR\n"
250248 "-----------------------------------------------------------------\n"
251249 "o The line 'Prompt:' shows the text used in the menu structure for\n"
252− " this CONFIG_ symbol\n"
250+ " this symbol\n"
253251 "o The 'Defined at' line tell at what file / line number the symbol\n"
254252 " is defined\n"
255253 "o The 'Depends on:' line tell what symbols needs to be defined for\n"
@@ -265,9 +263,9 @@ search_help[] = N_( · 9 unmodified lines
265263 "Only relevant lines are shown.\n"
266264 "\n\n"
267265 "Search examples:\n"
268− "Examples: USB => find all CONFIG_ symbols containing USB\n"
269− " ^USB => find all CONFIG_ symbols starting with USB\n"
270− " USB$ => find all CONFIG_ symbols ending with USB\n"
266+ "Examples: USB => find all symbols containing USB\n"
267+ " ^USB => find all symbols starting with USB\n"
268+ " USB$ => find all symbols ending with USB\n"
271269 "\n");
272270
273271 static int indent;
@@ -290,13 +288,9 @@ static void set_config_filename(const char *config_filename) · 16 unmodified lines
290288 {
291289 static char menu_backtitle[PATH_MAX+128];
292290 int size;
293− struct symbol *sym;
294291
295− sym = sym_lookup("KERNELVERSION", 0);
296− sym_calc_value(sym);
297292 size = snprintf(menu_backtitle, sizeof(menu_backtitle),
298− _("%s - Linux Kernel v%s Configuration"),
299− config_filename, sym_get_string_value(sym));
293+ "%s - %s", config_filename, rootmenu.prompt->text);
300294 if (size >= sizeof(menu_backtitle))
301295 menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
302296 set_dialog_backtitle(menu_backtitle);
@@ -316,8 +310,8 @@ static void search_conf(void) · 13 unmodified lines
316310 again:
317311 dialog_clear();
318312 dres = dialog_inputbox(_("Search Configuration Parameter"),
319− _("Enter CONFIG_ (sub)string to search for "
320− "(with or without \"CONFIG\")"),
313+ _("Enter " CONFIG_ " (sub)string to search for "
314+ "(with or without \"" CONFIG_ "\")"),
321315 10, 75, "");
322316 switch (dres) {
323317 case 0:
@@ -329,10 +323,10 @@ again: · 5 unmodified lines
329323 return;
330324 }
331325
332− /* strip CONFIG_ if necessary */
326+ /* strip the prefix if necessary */
333327 dialog_input = dialog_input_result;
334− if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
335− dialog_input += 7;
328+ if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
329+ dialog_input += strlen(CONFIG_);
336330
337331 sym_arr = sym_re_search(dialog_input);
338332 res = get_relations_str(sym_arr);
@@ -834,7 +828,7 @@ int main(int ac, char **av) · 495 unmodified lines
834828 if (conf_get_changed())
835829 res = dialog_yesno(NULL,
836830 _("Do you wish to save your "
837− "new kernel configuration?\n"
831+ "new configuration?\n"
838832 "<ESC><ESC> to continue."),
839833 6, 60);
840834 else
@@ -846,20 +840,20 @@ int main(int ac, char **av) · 5 unmodified lines
846840 case 0:
847841 if (conf_write(filename)) {
848842 fprintf(stderr, _("\n\n"
849− "Error during writing of the kernel configuration.\n"
850− "Your kernel configuration changes were NOT saved."
843+ "Error while writing of the configuration.\n"
844+ "Your configuration changes were NOT saved."
851845 "\n\n"));
852846 return 1;
853847 }
854848 case -1:
855849 printf(_("\n\n"
856− "*** End of Linux kernel configuration.\n"
857− "*** Execute 'make' to build the kernel or try 'make help'."
850+ "*** End of the configuration.\n"
851+ "*** Execute 'make' to start the build or try 'make help'."
858852 "\n\n"));
859853 break;
860854 default:
861855 fprintf(stderr, _("\n\n"
862− "Your kernel configuration changes were NOT saved."
856+ "Your configuration changes were NOT saved."
863857 "\n\n"));
864858 }
865859
scripts/kconfig/menu.c+3−3
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include "lkc.h"
1111
1212 static const char nohelp_text[] = N_(
13− "There is no help available for this kernel option.\n");
13+ "There is no help available for this option.\n");
1414
1515 struct menu rootmenu;
1616 static struct menu **last_entry_ptr;
@@ -139,7 +139,7 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e · 122 unmodified lines
139139 while (isspace(*prompt))
140140 prompt++;
141141 }
142− if (current_entry->prompt)
142+ if (current_entry->prompt && current_entry != &rootmenu)
143143 prop_warn(prop, "prompt redefined");
144144 current_entry->prompt = prop;
145145 }
@@ -566,7 +566,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) · 420 unmodified lines
566566
567567 if (menu_has_help(menu)) {
568568 if (sym->name) {
569− str_printf(help, "CONFIG_%s:\n\n", sym->name);
569+ str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
570570 str_append(help, _(menu_get_help(menu)));
571571 str_append(help, "\n");
572572 }
scripts/kconfig/nconf.c+32−41
@@ -15,11 +15,9 @@ · 14 unmodified lines
1515 static const char nconf_readme[] = N_(
1616 "Overview\n"
1717 "--------\n"
18−"Some kernel features may be built directly into the kernel.\n"
19−"Some may be made into loadable runtime modules. Some features\n"
20−"may be completely removed altogether. There are also certain\n"
21−"kernel parameters which are not really features, but must be\n"
22−"entered in as decimal or hexadecimal numbers or possibly text.\n"
18+"This interface let you select features and parameters for the build.\n"
19+"Features can either be built-in, modularized, or ignored. Parameters\n"
20+"must be entered in as decimal or hexadecimal numbers or text.\n"
2321 "\n"
2422 "Menu items beginning with following braces represent features that\n"
2523 " [ ] can be built in or removed\n"
@@ -95,7 +93,7 @@ static const char nconf_readme[] = N_( · 69 unmodified lines
9593 "-----------------------------\n"
9694 "nconfig supports the use of alternate configuration files for\n"
9795 "those who, for various reasons, find it necessary to switch\n"
98−"between different kernel configurations.\n"
96+"between different configurations.\n"
9997 "\n"
10098 "At the end of the main menu you will find two options. One is\n"
10199 "for saving the current configuration to a file of your choosing.\n"
@@ -128,9 +126,9 @@ static const char nconf_readme[] = N_( · 26 unmodified lines
128126 "\n"
129127 "Optional personality available\n"
130128 "------------------------------\n"
131−"If you prefer to have all of the kernel options listed in a single\n"
132−"menu, rather than the default multimenu hierarchy, run the nconfig\n"
133−"with NCONFIG_MODE environment variable set to single_menu. Example:\n"
129+"If you prefer to have all of the options listed in a single menu, rather\n"
130+"than the default multimenu hierarchy, run the nconfig with NCONFIG_MODE\n"
131+"environment variable set to single_menu. Example:\n"
134132 "\n"
135133 "make NCONFIG_MODE=single_menu nconfig\n"
136134 "\n"
@@ -185,19 +183,19 @@ setmod_text[] = N_( · 48 unmodified lines
185183 "has been configured as a module.\n"
186184 "As a result, this feature will be built as a module."),
187185 nohelp_text[] = N_(
188−"There is no help available for this kernel option.\n"),
186+"There is no help available for this option.\n"),
189187 load_config_text[] = N_(
190188 "Enter the name of the configuration file you wish to load.\n"
191189 "Accept the name shown to restore the configuration you\n"
192190 "last retrieved. Leave blank to abort."),
193191 load_config_help[] = N_(
194192 "\n"
195−"For various reasons, one may wish to keep several different kernel\n"
193+"For various reasons, one may wish to keep several different\n"
196194 "configurations available on a single machine.\n"
197195 "\n"
198196 "If you have saved a previous configuration in a file other than the\n"
199−"kernel's default, entering the name of the file here will allow you\n"
200−"to modify that configuration.\n"
197+"default one, entering its name here will allow you to modify that\n"
198+"configuration.\n"
201199 "\n"
202200 "If you are uncertain, then you have probably never used alternate\n"
203201 "configuration files. You should therefor leave this blank to abort.\n"),
@@ -206,8 +204,8 @@ save_config_text[] = N_( · 2 unmodified lines
206204 "as an alternate. Leave blank to abort."),
207205 save_config_help[] = N_(
208206 "\n"
209−"For various reasons, one may wish to keep different kernel\n"
210−"configurations available on a single machine.\n"
207+"For various reasons, one may wish to keep different configurations\n"
208+"available on a single machine.\n"
211209 "\n"
212210 "Entering a file name here will allow you to later retrieve, modify\n"
213211 "and use the current configuration as an alternate to whatever\n"
@@ -217,8 +215,8 @@ save_config_help[] = N_( · 3 unmodified lines
217215 "leave this blank.\n"),
218216 search_help[] = N_(
219217 "\n"
220−"Search for CONFIG_ symbols and display their relations.\n"
221−"Regular expressions are allowed.\n"
218+"Search for symbols and display their relations. Regular expressions\n"
219+"are allowed.\n"
222220 "Example: search for \"^FOO\"\n"
223221 "Result:\n"
224222 "-----------------------------------------------------------------\n"
@@ -234,7 +232,7 @@ search_help[] = N_( · 9 unmodified lines
234232 "Selected by: BAR\n"
235233 "-----------------------------------------------------------------\n"
236234 "o The line 'Prompt:' shows the text used in the menu structure for\n"
237−" this CONFIG_ symbol\n"
235+" this symbol\n"
238236 "o The 'Defined at' line tell at what file / line number the symbol\n"
239237 " is defined\n"
240238 "o The 'Depends on:' line tell what symbols needs to be defined for\n"
@@ -250,9 +248,9 @@ search_help[] = N_( · 9 unmodified lines
250248 "Only relevant lines are shown.\n"
251249 "\n\n"
252250 "Search examples:\n"
253−"Examples: USB = > find all CONFIG_ symbols containing USB\n"
254−" ^USB => find all CONFIG_ symbols starting with USB\n"
255−" USB$ => find all CONFIG_ symbols ending with USB\n"
251+"Examples: USB = > find all symbols containing USB\n"
252+" ^USB => find all symbols starting with USB\n"
253+" USB$ => find all symbols ending with USB\n"
256254 "\n");
257255
258256 struct mitem {
@@ -635,13 +633,9 @@ static char menu_backtitle[PATH_MAX+128]; · 376 unmodified lines
635633 static const char *set_config_filename(const char *config_filename)
636634 {
637635 int size;
638− struct symbol *sym;
639636
640− sym = sym_lookup("KERNELVERSION", 0);
641− sym_calc_value(sym);
642637 size = snprintf(menu_backtitle, sizeof(menu_backtitle),
643− _("%s - Linux Kernel v%s Configuration"),
644− config_filename, sym_get_string_value(sym));
638+ "%s - %s", config_filename, rootmenu.prompt->text);
645639 if (size >= sizeof(menu_backtitle))
646640 menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
647641
@@ -681,8 +675,7 @@ static int do_exit(void) · 33 unmodified lines
681675 return 0;
682676 }
683677 res = btn_dialog(main_window,
684− _("Do you wish to save your "
685− "new kernel configuration?\n"
678+ _("Do you wish to save your new configuration?\n"
686679 "<ESC> to cancel and resume nconfig."),
687680 2,
688681 " <save> ",
@@ -701,18 +694,16 @@ static int do_exit(void) · 12 unmodified lines
701694 if (res)
702695 btn_dialog(
703696 main_window,
704− _("Error during writing of the kernel "
705− "configuration.\n"
706− "Your kernel configuration "
707− "changes were NOT saved."),
697+ _("Error during writing of configuration.\n"
698+ "Your configuration changes were NOT saved."),
708699 1,
709700 "<OK>");
710701 else {
711702 char buf[1024];
712703 snprintf(buf, 1024,
713704 _("Configuration written to %s\n"
714− "End of Linux kernel configuration.\n"
715− "Execute 'make' to build the kernel or try"
705+ "End of the configuration.\n"
706+ "Execute 'make' to start the build or try"
716707 " 'make help'."), filename);
717708 btn_dialog(
718709 main_window,
@@ -724,7 +715,7 @@ static int do_exit(void) · 5 unmodified lines
724715 default:
725716 btn_dialog(
726717 main_window,
727− _("Your kernel configuration changes were NOT saved."),
718+ _("Your configuration changes were NOT saved."),
728719 1,
729720 "<OK>");
730721 break;
@@ -744,8 +735,8 @@ static void search_conf(void) · 13 unmodified lines
744735 again:
745736 dres = dialog_inputbox(main_window,
746737 _("Search Configuration Parameter"),
747− _("Enter CONFIG_ (sub)string to search for "
748− "(with or without \"CONFIG\")"),
738+ _("Enter " CONFIG_ " (sub)string to search for "
739+ "(with or without \"" CONFIG_ "\")"),
749740 "", dialog_input_result, 99);
750741 switch (dres) {
751742 case 0:
@@ -758,10 +749,10 @@ again: · 6 unmodified lines
758749 return;
759750 }
760751
761− /* strip CONFIG_ if necessary */
752+ /* strip the prefix if necessary */
762753 dialog_input = dialog_input_result;
763− if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
764− dialog_input += 7;
754+ if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
755+ dialog_input += strlen(CONFIG_);
765756
766757 sym_arr = sym_re_search(dialog_input);
767758 res = get_relations_str(sym_arr);
@@ -1261,7 +1252,7 @@ static void show_help(struct menu *menu) · 493 unmodified lines
12611252
12621253 if (menu && menu->sym && menu_has_help(menu)) {
12631254 if (menu->sym->name) {
1264− str_printf(&help, "CONFIG_%s:\n\n", menu->sym->name);
1255+ str_printf(&help, "%s%s:\n\n", CONFIG_, menu->sym->name);
12651256 str_append(&help, _(menu_get_help(menu)));
12661257 str_append(&help, "\n");
12671258 get_symbol_str(&help, menu->sym);
scripts/kconfig/qconf.cc+3−3
@@ -1274,8 +1274,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 1273 unmodified lines
12741274 char title[256];
12751275
12761276 QDesktopWidget *d = configApp->desktop();
1277− snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration%s"),
1278− getenv("KERNELVERSION"),
1277+ snprintf(title, sizeof(title), "%s%s",
1278+ rootmenu.prompt->text,
12791279 #if QT_VERSION < 0x040000
12801280 " (Qt3)"
12811281 #else
@@ -1655,7 +1655,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) · 373 unmodified lines
16551655
16561656 void ConfigMainWindow::showIntro(void)
16571657 {
1658− static const QString str = _("Welcome to the qconf graphical kernel configuration tool for Linux.\n\n"
1658+ static const QString str = _("Welcome to the qconf graphical configuration tool.\n\n"
16591659 "For each option, a blank box indicates the feature is disabled, a check\n"
16601660 "indicates it is enabled, and a dot indicates that it is to be compiled\n"
16611661 "as a module. Clicking on the box will cycle through the three states.\n\n"
scripts/kconfig/symbol.c+49−0
@@ -840,6 +840,55 @@ struct symbol *sym_find(const char *name) · 839 unmodified lines
840840 return symbol;
841841 }
842842
843+/*
844+ * Expand symbol's names embedded in the string given in argument. Symbols'
845+ * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to
846+ * the empty string.
847+ */
848+const char *sym_expand_string_value(const char *in)
849+{
850+ const char *src;
851+ char *res;
852+ size_t reslen;
853+
854+ reslen = strlen(in) + 1;
855+ res = malloc(reslen);
856+ res[0] = '\0';
857+
858+ while ((src = strchr(in, '$'))) {
859+ char *p, name[SYMBOL_MAXLENGTH];
860+ const char *symval = "";
861+ struct symbol *sym;
862+ size_t newlen;
863+
864+ strncat(res, in, src - in);
865+ src++;
866+
867+ p = name;
868+ while (isalnum(*src) || *src == '_')
869+ *p++ = *src++;
870+ *p = '\0';
871+
872+ sym = sym_find(name);
873+ if (sym != NULL) {
874+ sym_calc_value(sym);
875+ symval = sym_get_string_value(sym);
876+ }
877+
878+ newlen = strlen(res) + strlen(symval) + strlen(src);
879+ if (newlen > reslen) {
880+ reslen = newlen;
881+ realloc(res, reslen);
882+ }
883+
884+ strcat(res, symval);
885+ in = src;
886+ }
887+ strcat(res, in);
888+
889+ return res;
890+}
891+
843892 struct symbol **sym_re_search(const char *pattern)
844893 {
845894 struct symbol *sym, **sym_arr = NULL;
scripts/kconfig/util.c+5−2
@@ -12,15 +12,18 @@ · 11 unmodified lines
1212 struct file *file_lookup(const char *name)
1313 {
1414 struct file *file;
15+ const char *file_name = sym_expand_string_value(name);
1516
1617 for (file = file_list; file; file = file->next) {
17− if (!strcmp(name, file->name))
18+ if (!strcmp(name, file->name)) {
19+ free((void *)file_name);
1820 return file;
21+ }
1922 }
2023
2124 file = malloc(sizeof(*file));
2225 memset(file, 0, sizeof(*file));
23− file->name = strdup(name);
26+ file->name = file_name;
2427 file->next = file_list;
2528 file_list = file;
2629 return file;
scripts/kconfig/zconf.l+4−3
@@ -304,9 +304,10 @@ void zconf_nextfile(const char *name) · 303 unmodified lines
304304 memset(buf, 0, sizeof(*buf));
305305
306306 current_buf->state = YY_CURRENT_BUFFER;
307− yyin = zconf_fopen(name);
307+ yyin = zconf_fopen(file->name);
308308 if (!yyin) {
309− printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name);
309+ printf("%s:%d: can't open file \"%s\"\n",
310+ zconf_curname(), zconf_lineno(), file->name);
310311 exit(1);
311312 }
312313 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
@@ -353,7 +354,7 @@ int zconf_lineno(void) · 40 unmodified lines
353354 return current_pos.lineno;
354355 }
355356
356−char *zconf_curname(void)
357+const char *zconf_curname(void)
357358 {
358359 return current_pos.file ? current_pos.file->name : "<none>";
359360 }
scripts/kconfig/zconf.tab.c_shipped+283−264
@@ -417,18 +417,18 @@ union yyalloc · 416 unmodified lines
417417 #endif
418418
419419 /* YYFINAL -- State number of the termination state. */
420−#define YYFINAL 3
420+#define YYFINAL 11
421421 /* YYLAST -- Last index in YYTABLE. */
422−#define YYLAST 259
422+#define YYLAST 277
423423
424424 /* YYNTOKENS -- Number of terminals. */
425425 #define YYNTOKENS 35
426426 /* YYNNTS -- Number of nonterminals. */
427−#define YYNNTS 46
427+#define YYNNTS 48
428428 /* YYNRULES -- Number of rules. */
429−#define YYNRULES 110
429+#define YYNRULES 113
430430 /* YYNRULES -- Number of states. */
431−#define YYNSTATES 180
431+#define YYNSTATES 185
432432
433433 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
434434 #define YYUNDEFTOK 2
@@ -476,73 +476,74 @@ static const yytype_uint8 yytranslate[] = · 41 unmodified lines
476476 YYRHS. */
477477 static const yytype_uint16 yyprhs[] =
478478 {
479− 0, 0, 3, 5, 6, 9, 12, 15, 20, 23,
480− 28, 33, 37, 39, 41, 43, 45, 47, 49, 51,
481− 53, 55, 57, 59, 61, 63, 67, 70, 74, 77,
482− 81, 84, 85, 88, 91, 94, 97, 100, 103, 107,
483− 112, 117, 122, 128, 132, 133, 137, 138, 141, 145,
484− 148, 150, 154, 155, 158, 161, 164, 167, 170, 175,
485− 179, 182, 187, 188, 191, 195, 197, 201, 202, 205,
486− 208, 211, 215, 218, 220, 224, 225, 228, 231, 234,
487− 238, 242, 245, 248, 251, 252, 255, 258, 261, 266,
488− 267, 270, 272, 274, 277, 280, 283, 285, 288, 289,
489− 292, 294, 298, 302, 306, 309, 313, 317, 319, 321,
490− 322
479+ 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
480+ 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
481+ 52, 54, 56, 58, 60, 62, 64, 66, 70, 73,
482+ 77, 80, 84, 87, 88, 91, 94, 97, 100, 103,
483+ 106, 110, 115, 120, 125, 131, 135, 136, 140, 141,
484+ 144, 148, 151, 153, 157, 158, 161, 164, 167, 170,
485+ 173, 178, 182, 185, 190, 191, 194, 198, 200, 204,
486+ 205, 208, 211, 214, 218, 222, 225, 227, 231, 232,
487+ 235, 238, 241, 245, 249, 252, 255, 258, 259, 262,
488+ 265, 268, 273, 274, 277, 279, 281, 284, 287, 290,
489+ 292, 295, 296, 299, 301, 305, 309, 313, 316, 320,
490+ 324, 326, 328, 329
491491 };
492492
493493 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
494494 static const yytype_int8 yyrhs[] =
495495 {
496− 36, 0, -1, 37, -1, -1, 37, 39, -1, 37,
497− 53, -1, 37, 64, -1, 37, 3, 74, 76, -1,
498− 37, 75, -1, 37, 25, 1, 30, -1, 37, 38,
499− 1, 30, -1, 37, 1, 30, -1, 16, -1, 18,
500− -1, 19, -1, 21, -1, 17, -1, 22, -1, 20,
501− -1, 30, -1, 59, -1, 68, -1, 42, -1, 44,
502− -1, 66, -1, 25, 1, 30, -1, 1, 30, -1,
503− 10, 25, 30, -1, 41, 45, -1, 11, 25, 30,
504− -1, 43, 45, -1, -1, 45, 46, -1, 45, 47,
505− -1, 45, 72, -1, 45, 70, -1, 45, 40, -1,
506− 45, 30, -1, 19, 73, 30, -1, 18, 74, 77,
507− 30, -1, 20, 78, 77, 30, -1, 21, 25, 77,
508− 30, -1, 22, 79, 79, 77, 30, -1, 23, 48,
509− 30, -1, -1, 48, 25, 49, -1, -1, 33, 74,
510− -1, 7, 80, 30, -1, 50, 54, -1, 75, -1,
511− 51, 56, 52, -1, -1, 54, 55, -1, 54, 72,
512− -1, 54, 70, -1, 54, 30, -1, 54, 40, -1,
513− 18, 74, 77, 30, -1, 19, 73, 30, -1, 17,
514− 30, -1, 20, 25, 77, 30, -1, -1, 56, 39,
515− -1, 14, 78, 76, -1, 75, -1, 57, 60, 58,
516− -1, -1, 60, 39, -1, 60, 64, -1, 60, 53,
517− -1, 4, 74, 30, -1, 61, 71, -1, 75, -1,
518− 62, 65, 63, -1, -1, 65, 39, -1, 65, 64,
519− -1, 65, 53, -1, 6, 74, 30, -1, 9, 74,
520− 30, -1, 67, 71, -1, 12, 30, -1, 69, 13,
521− -1, -1, 71, 72, -1, 71, 30, -1, 71, 40,
522− -1, 16, 24, 78, 30, -1, -1, 74, 77, -1,
523− 25, -1, 26, -1, 5, 30, -1, 8, 30, -1,
524− 15, 30, -1, 30, -1, 76, 30, -1, -1, 14,
525− 78, -1, 79, -1, 79, 33, 79, -1, 79, 27,
526− 79, -1, 29, 78, 28, -1, 34, 78, -1, 78,
527− 31, 78, -1, 78, 32, 78, -1, 25, -1, 26,
528− -1, -1, 25, -1
496+ 36, 0, -1, 78, 37, -1, 37, -1, 62, 38,
497+ -1, 38, -1, -1, 38, 40, -1, 38, 54, -1,
498+ 38, 66, -1, 38, 77, -1, 38, 25, 1, 30,
499+ -1, 38, 39, 1, 30, -1, 38, 1, 30, -1,
500+ 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
501+ 22, -1, 20, -1, 30, -1, 60, -1, 70, -1,
502+ 43, -1, 45, -1, 68, -1, 25, 1, 30, -1,
503+ 1, 30, -1, 10, 25, 30, -1, 42, 46, -1,
504+ 11, 25, 30, -1, 44, 46, -1, -1, 46, 47,
505+ -1, 46, 48, -1, 46, 74, -1, 46, 72, -1,
506+ 46, 41, -1, 46, 30, -1, 19, 75, 30, -1,
507+ 18, 76, 79, 30, -1, 20, 80, 79, 30, -1,
508+ 21, 25, 79, 30, -1, 22, 81, 81, 79, 30,
509+ -1, 23, 49, 30, -1, -1, 49, 25, 50, -1,
510+ -1, 33, 76, -1, 7, 82, 30, -1, 51, 55,
511+ -1, 77, -1, 52, 57, 53, -1, -1, 55, 56,
512+ -1, 55, 74, -1, 55, 72, -1, 55, 30, -1,
513+ 55, 41, -1, 18, 76, 79, 30, -1, 19, 75,
514+ 30, -1, 17, 30, -1, 20, 25, 79, 30, -1,
515+ -1, 57, 40, -1, 14, 80, 78, -1, 77, -1,
516+ 58, 61, 59, -1, -1, 61, 40, -1, 61, 66,
517+ -1, 61, 54, -1, 3, 76, 78, -1, 4, 76,
518+ 30, -1, 63, 73, -1, 77, -1, 64, 67, 65,
519+ -1, -1, 67, 40, -1, 67, 66, -1, 67, 54,
520+ -1, 6, 76, 30, -1, 9, 76, 30, -1, 69,
521+ 73, -1, 12, 30, -1, 71, 13, -1, -1, 73,
522+ 74, -1, 73, 30, -1, 73, 41, -1, 16, 24,
523+ 80, 30, -1, -1, 76, 79, -1, 25, -1, 26,
524+ -1, 5, 30, -1, 8, 30, -1, 15, 30, -1,
525+ 30, -1, 78, 30, -1, -1, 14, 80, -1, 81,
526+ -1, 81, 33, 81, -1, 81, 27, 81, -1, 29,
527+ 80, 28, -1, 34, 80, -1, 80, 31, 80, -1,
528+ 80, 32, 80, -1, 25, -1, 26, -1, -1, 25,
529+ -1
529530 };
530531
531532 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
532533 static const yytype_uint16 yyrline[] =
533534 {
534− 0, 107, 107, 109, 111, 112, 113, 114, 115, 116,
535− 117, 121, 125, 125, 125, 125, 125, 125, 125, 129,
536− 130, 131, 132, 133, 134, 138, 139, 145, 153, 159,
537− 167, 177, 179, 180, 181, 182, 183, 184, 187, 195,
538− 201, 211, 217, 223, 226, 228, 239, 240, 245, 254,
539− 259, 267, 270, 272, 273, 274, 275, 276, 279, 285,
540− 296, 302, 312, 314, 319, 327, 335, 338, 340, 341,
541− 342, 347, 354, 359, 367, 370, 372, 373, 374, 377,
542− 385, 392, 399, 405, 412, 414, 415, 416, 419, 427,
543− 429, 434, 435, 438, 439, 440, 444, 445, 448, 449,
544− 452, 453, 454, 455, 456, 457, 458, 461, 462, 465,
545− 466
535+ 0, 107, 107, 107, 109, 109, 111, 113, 114, 115,
536+ 116, 117, 118, 122, 126, 126, 126, 126, 126, 126,
537+ 126, 130, 131, 132, 133, 134, 135, 139, 140, 146,
538+ 154, 160, 168, 178, 180, 181, 182, 183, 184, 185,
539+ 188, 196, 202, 212, 218, 224, 227, 229, 240, 241,
540+ 246, 255, 260, 268, 271, 273, 274, 275, 276, 277,
541+ 280, 286, 297, 303, 313, 315, 320, 328, 336, 339,
542+ 341, 342, 343, 348, 355, 362, 367, 375, 378, 380,
543+ 381, 382, 385, 393, 400, 407, 413, 420, 422, 423,
544+ 424, 427, 435, 437, 442, 443, 446, 447, 448, 452,
545+ 453, 456, 457, 460, 461, 462, 463, 464, 465, 466,
546+ 469, 470, 473, 474
546547 };
547548 #endif
548549
@@ -557,17 +558,17 @@ static const char *const yytname[] = · 8 unmodified lines
557558 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
558559 "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
559560 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
560− "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt",
561− "option_error", "config_entry_start", "config_stmt",
561+ "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
562+ "common_stmt", "option_error", "config_entry_start", "config_stmt",
562563 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
563564 "config_option", "symbol_option", "symbol_option_list",
564565 "symbol_option_arg", "choice", "choice_entry", "choice_end",
565566 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
566− "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry",
567− "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment",
568− "comment_stmt", "help_start", "help", "depends_list", "depends",
569− "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol",
570− "word_opt", 0
567+ "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
568+ "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
569+ "comment", "comment_stmt", "help_start", "help", "depends_list",
570+ "depends", "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr",
571+ "symbol", "word_opt", 0
571572 };
572573 #endif
573574
@@ -586,35 +587,35 @@ static const yytype_uint16 yytoknum[] = · 12 unmodified lines
586587 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
587588 static const yytype_uint8 yyr1[] =
588589 {
589− 0, 35, 36, 37, 37, 37, 37, 37, 37, 37,
590− 37, 37, 38, 38, 38, 38, 38, 38, 38, 39,
591− 39, 39, 39, 39, 39, 40, 40, 41, 42, 43,
592− 44, 45, 45, 45, 45, 45, 45, 45, 46, 46,
593− 46, 46, 46, 47, 48, 48, 49, 49, 50, 51,
594− 52, 53, 54, 54, 54, 54, 54, 54, 55, 55,
595− 55, 55, 56, 56, 57, 58, 59, 60, 60, 60,
596− 60, 61, 62, 63, 64, 65, 65, 65, 65, 66,
597− 67, 68, 69, 70, 71, 71, 71, 71, 72, 73,
598− 73, 74, 74, 75, 75, 75, 76, 76, 77, 77,
599− 78, 78, 78, 78, 78, 78, 78, 79, 79, 80,
600− 80
590+ 0, 35, 36, 36, 37, 37, 38, 38, 38, 38,
591+ 38, 38, 38, 38, 39, 39, 39, 39, 39, 39,
592+ 39, 40, 40, 40, 40, 40, 40, 41, 41, 42,
593+ 43, 44, 45, 46, 46, 46, 46, 46, 46, 46,
594+ 47, 47, 47, 47, 47, 48, 49, 49, 50, 50,
595+ 51, 52, 53, 54, 55, 55, 55, 55, 55, 55,
596+ 56, 56, 56, 56, 57, 57, 58, 59, 60, 61,
597+ 61, 61, 61, 62, 63, 64, 65, 66, 67, 67,
598+ 67, 67, 68, 69, 70, 71, 72, 73, 73, 73,
599+ 73, 74, 75, 75, 76, 76, 77, 77, 77, 78,
600+ 78, 79, 79, 80, 80, 80, 80, 80, 80, 80,
601+ 81, 81, 82, 82
601602 };
602603
603604 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
604605 static const yytype_uint8 yyr2[] =
605606 {
606− 0, 2, 1, 0, 2, 2, 2, 4, 2, 4,
607− 4, 3, 1, 1, 1, 1, 1, 1, 1, 1,
608− 1, 1, 1, 1, 1, 3, 2, 3, 2, 3,
609− 2, 0, 2, 2, 2, 2, 2, 2, 3, 4,
610− 4, 4, 5, 3, 0, 3, 0, 2, 3, 2,
611− 1, 3, 0, 2, 2, 2, 2, 2, 4, 3,
612− 2, 4, 0, 2, 3, 1, 3, 0, 2, 2,
613− 2, 3, 2, 1, 3, 0, 2, 2, 2, 3,
614− 3, 2, 2, 2, 0, 2, 2, 2, 4, 0,
615− 2, 1, 1, 2, 2, 2, 1, 2, 0, 2,
616− 1, 3, 3, 3, 2, 3, 3, 1, 1, 0,
617− 1
607+ 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
608+ 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
609+ 1, 1, 1, 1, 1, 1, 1, 3, 2, 3,
610+ 2, 3, 2, 0, 2, 2, 2, 2, 2, 2,
611+ 3, 4, 4, 4, 5, 3, 0, 3, 0, 2,
612+ 3, 2, 1, 3, 0, 2, 2, 2, 2, 2,
613+ 4, 3, 2, 4, 0, 2, 3, 1, 3, 0,
614+ 2, 2, 2, 3, 3, 2, 1, 3, 0, 2,
615+ 2, 2, 3, 3, 2, 2, 2, 0, 2, 2,
616+ 2, 4, 0, 2, 1, 1, 2, 2, 2, 1,
617+ 2, 0, 2, 1, 3, 3, 3, 2, 3, 3,
618+ 1, 1, 0, 1
618619 };
619620
620621 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -622,158 +623,165 @@ static const yytype_uint8 yyr2[] = · 1 unmodified line
622623 means the default is an error. */
623624 static const yytype_uint8 yydefact[] =
624625 {
625− 3, 0, 0, 1, 0, 0, 0, 0, 0, 109,
626− 0, 0, 0, 0, 0, 0, 12, 16, 13, 14,
627− 18, 15, 17, 0, 19, 0, 4, 31, 22, 31,
628− 23, 52, 62, 5, 67, 20, 84, 75, 6, 24,
629− 84, 21, 8, 11, 91, 92, 0, 0, 93, 0,
630− 110, 0, 94, 0, 0, 0, 107, 108, 0, 0,
631− 0, 100, 95, 0, 0, 0, 0, 0, 0, 0,
632− 0, 0, 0, 96, 7, 71, 79, 48, 80, 27,
633− 29, 0, 104, 0, 0, 64, 0, 0, 9, 10,
634− 0, 0, 0, 0, 89, 0, 0, 0, 44, 0,
635− 37, 36, 32, 33, 0, 35, 34, 0, 0, 89,
636− 0, 56, 57, 53, 55, 54, 63, 51, 50, 68,
637− 70, 66, 69, 65, 86, 87, 85, 76, 78, 74,
638− 77, 73, 97, 103, 105, 106, 102, 101, 26, 82,
639− 0, 98, 0, 98, 98, 98, 0, 0, 0, 83,
640− 60, 98, 0, 98, 0, 0, 0, 38, 90, 0,
641− 0, 98, 46, 43, 25, 0, 59, 0, 88, 99,
642− 39, 40, 41, 0, 0, 45, 58, 61, 42, 47
626+ 6, 0, 99, 0, 3, 0, 6, 6, 94, 95,
627+ 0, 1, 0, 0, 0, 0, 112, 0, 0, 0,
628+ 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
629+ 0, 21, 0, 7, 33, 24, 33, 25, 54, 64,
630+ 8, 69, 22, 87, 78, 9, 26, 87, 23, 10,
631+ 0, 100, 2, 73, 13, 0, 96, 0, 113, 0,
632+ 97, 0, 0, 0, 110, 111, 0, 0, 0, 103,
633+ 98, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634+ 0, 74, 82, 50, 83, 29, 31, 0, 107, 0,
635+ 0, 66, 0, 0, 11, 12, 0, 0, 0, 0,
636+ 92, 0, 0, 0, 46, 0, 39, 38, 34, 35,
637+ 0, 37, 36, 0, 0, 92, 0, 58, 59, 55,
638+ 57, 56, 65, 53, 52, 70, 72, 68, 71, 67,
639+ 89, 90, 88, 79, 81, 77, 80, 76, 106, 108,
640+ 109, 105, 104, 28, 85, 0, 101, 0, 101, 101,
641+ 101, 0, 0, 0, 86, 62, 101, 0, 101, 0,
642+ 0, 0, 40, 93, 0, 0, 101, 48, 45, 27,
643+ 0, 61, 0, 91, 102, 41, 42, 43, 0, 0,
644+ 47, 60, 63, 44, 49
643645 };
644646
645647 /* YYDEFGOTO[NTERM-NUM]. */
646648 static const yytype_int16 yydefgoto[] =
647649 {
648− -1, 1, 2, 25, 26, 101, 27, 28, 29, 30,
649− 65, 102, 103, 147, 175, 31, 32, 117, 33, 67,
650− 113, 68, 34, 121, 35, 69, 36, 37, 129, 38,
651− 71, 39, 40, 41, 104, 105, 70, 106, 142, 143,
652− 42, 74, 156, 60, 61, 51
650+ -1, 3, 4, 5, 32, 33, 107, 34, 35, 36,
651+ 37, 73, 108, 109, 152, 180, 38, 39, 123, 40,
652+ 75, 119, 76, 41, 127, 42, 77, 6, 43, 44,
653+ 135, 45, 79, 46, 47, 48, 110, 111, 78, 112,
654+ 147, 148, 49, 7, 161, 68, 69, 59
653655 };
654656
655657 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
656658 STATE-NUM. */
657−#define YYPACT_NINF -80
659+#define YYPACT_NINF -89
658660 static const yytype_int16 yypact[] =
659661 {
660− -80, 2, 132, -80, -13, -1, -1, -2, -1, 9,
661− 33, -1, 27, 40, -3, 38, -80, -80, -80, -80,
662− -80, -80, -80, 71, -80, 77, -80, -80, -80, -80,
663− -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
664− -80, -80, -80, -80, -80, -80, 57, 61, -80, 63,
665− -80, 76, -80, 87, 101, 133, -80, -80, -3, -3,
666− 195, -6, -80, 136, 149, 39, 104, 65, 150, 5,
667− 194, 5, 167, -80, 176, -80, -80, -80, -80, -80,
668− -80, 68, -80, -3, -3, 176, 72, 72, -80, -80,
669− 177, 187, 78, -1, -1, -3, 196, 72, -80, 222,
670− -80, -80, -80, -80, 221, -80, -80, 205, -1, -1,
671− 211, -80, -80, -80, -80, -80, -80, -80, -80, -80,
672− -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
673− -80, -80, -80, -80, 206, -80, -80, -80, -80, -80,
674− -3, 223, 209, 223, 197, 223, 72, 7, 210, -80,
675− -80, 223, 212, 223, 201, -3, 213, -80, -80, 214,
676− 215, 223, 208, -80, -80, 216, -80, 217, -80, 113,
677− -80, -80, -80, 218, -1, -80, -80, -80, -80, -80
662+ 3, 4, -89, 20, -89, 100, -89, 7, -89, -89,
663+ -8, -89, 17, 4, 28, 4, 37, 36, 4, 68,
664+ 87, -18, 69, -89, -89, -89, -89, -89, -89, -89,
665+ 128, -89, 138, -89, -89, -89, -89, -89, -89, -89,
666+ -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
667+ 127, -89, -89, 110, -89, 126, -89, 136, -89, 137,
668+ -89, 147, 150, 152, -89, -89, -18, -18, 171, -14,
669+ -89, 153, 157, 34, 67, 180, 233, 220, 207, 220,
670+ 154, -89, -89, -89, -89, -89, -89, 0, -89, -18,
671+ -18, 110, 44, 44, -89, -89, 163, 174, 182, 4,
672+ 4, -18, 194, 44, -89, 219, -89, -89, -89, -89,
673+ 223, -89, -89, 203, 4, 4, 215, -89, -89, -89,
674+ -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
675+ -89, -89, -89, -89, -89, -89, -89, -89, -89, 213,
676+ -89, -89, -89, -89, -89, -18, 232, 227, 232, -5,
677+ 232, 44, 35, 234, -89, -89, 232, 235, 232, 224,
678+ -18, 236, -89, -89, 237, 238, 232, 216, -89, -89,
679+ 240, -89, 241, -89, 71, -89, -89, -89, 242, 4,
680+ -89, -89, -89, -89, -89
678681 };
679682
680683 /* YYPGOTO[NTERM-NUM]. */
681684 static const yytype_int16 yypgoto[] =
682685 {
683− -80, -80, -80, -80, 122, -34, -80, -80, -80, -80,
684− 220, -80, -80, -80, -80, -80, -80, -80, 59, -80,
685− -80, -80, -80, -80, -80, -80, -80, -80, -80, 125,
686− -80, -80, -80, -80, -80, 183, 219, 22, 142, -5,
687− 147, 192, 69, -54, -79, -80
686+ -89, -89, 255, 267, -89, 47, -57, -89, -89, -89,
687+ -89, 239, -89, -89, -89, -89, -89, -89, -89, 130,
688+ -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
689+ -89, 181, -89, -89, -89, -89, -89, 199, 229, 16,
690+ 162, -1, 74, -7, 103, -65, -88, -89
688691 };
689692
690693 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
691694 positive, shift that token. If negative, reduce the rule which
692695 number is the opposite. If zero, do what YYDEFACT says.
693696 If YYTABLE_NINF, syntax error. */
694−#define YYTABLE_NINF -82
697+#define YYTABLE_NINF -85
695698 static const yytype_int16 yytable[] =
696699 {
697− 46, 47, 3, 49, 81, 82, 53, 136, 137, 6,
698− 7, 8, 9, 10, 11, 12, 13, 43, 146, 14,
699− 15, 86, 56, 57, 44, 45, 58, 87, 48, 134,
700− 135, 59, 162, 112, 50, 24, 125, 163, 125, -28,
701− 90, 144, -28, -28, -28, -28, -28, -28, -28, -28,
702− -28, 91, 54, -28, -28, 92, -28, 93, 94, 95,
703− 96, 97, 98, 52, 99, 55, 90, 161, 62, 100,
704− -49, -49, 63, -49, -49, -49, -49, 91, 64, -49,
705− -49, 92, 107, 108, 109, 110, 154, 73, 141, 115,
706− 99, 75, 126, 76, 126, 111, 133, 56, 57, 83,
707− 84, 169, 140, 151, -30, 90, 77, -30, -30, -30,
708− -30, -30, -30, -30, -30, -30, 91, 78, -30, -30,
709− 92, -30, 93, 94, 95, 96, 97, 98, 120, 99,
710− 128, 79, -2, 4, 100, 5, 6, 7, 8, 9,
711− 10, 11, 12, 13, 83, 84, 14, 15, 16, 17,
712− 18, 19, 20, 21, 22, 7, 8, 23, 10, 11,
713− 12, 13, 24, 80, 14, 15, 88, -81, 90, 179,
714− -81, -81, -81, -81, -81, -81, -81, -81, -81, 89,
715− 24, -81, -81, 92, -81, -81, -81, -81, -81, -81,
716− 116, 119, 99, 127, 122, 90, 130, 124, -72, -72,
717− -72, -72, -72, -72, -72, -72, 132, 138, -72, -72,
718− 92, 155, 158, 159, 160, 118, 123, 139, 131, 99,
719− 165, 145, 167, 148, 124, 73, 83, 84, 83, 84,
720− 173, 168, 83, 84, 149, 150, 153, 155, 84, 157,
721− 164, 174, 166, 170, 171, 172, 176, 177, 178, 66,
722− 114, 152, 85, 0, 0, 0, 0, 0, 0, 72
700+ 10, 87, 88, 53, 141, 142, 1, 64, 65, 160,
701+ 1, 66, 55, 92, 57, 151, 67, 61, 118, 93,
702+ 11, 131, 2, 131, 139, 140, 89, 90, 138, 8,
703+ 9, 89, 90, 2, -30, 96, 149, 51, -30, -30,
704+ -30, -30, -30, -30, -30, -30, 97, 54, -30, -30,
705+ 98, -30, 99, 100, 101, 102, 103, 104, 56, 105,
706+ 167, 91, 58, 166, 106, 168, 60, -32, 96, 64,
707+ 65, -32, -32, -32, -32, -32, -32, -32, -32, 97,
708+ 159, -32, -32, 98, -32, 99, 100, 101, 102, 103,
709+ 104, 121, 105, 62, 132, 174, 132, 106, 146, 70,
710+ -5, 12, 89, 90, 13, 14, 15, 16, 17, 18,
711+ 19, 20, 63, 156, 21, 22, 23, 24, 25, 26,
712+ 27, 28, 29, 122, 125, 30, 133, -4, 12, 71,
713+ 31, 13, 14, 15, 16, 17, 18, 19, 20, 72,
714+ 51, 21, 22, 23, 24, 25, 26, 27, 28, 29,
715+ 124, 129, 30, 137, -84, 96, 81, 31, -84, -84,
716+ -84, -84, -84, -84, -84, -84, 82, 83, -84, -84,
717+ 98, -84, -84, -84, -84, -84, -84, 84, 184, 105,
718+ 85, 96, 86, 94, 130, -51, -51, 95, -51, -51,
719+ -51, -51, 97, 143, -51, -51, 98, 113, 114, 115,
720+ 116, 2, 89, 90, 144, 105, 145, 126, 96, 134,
721+ 117, -75, -75, -75, -75, -75, -75, -75, -75, 150,
722+ 153, -75, -75, 98, 13, 14, 15, 16, 17, 18,
723+ 19, 20, 105, 155, 21, 22, 154, 130, 14, 15,
724+ 158, 17, 18, 19, 20, 90, 160, 21, 22, 179,
725+ 31, 163, 164, 165, 173, 89, 90, 162, 128, 170,
726+ 136, 172, 52, 31, 169, 171, 175, 176, 177, 178,
727+ 181, 182, 183, 50, 120, 74, 80, 157
723728 };
724729
725−static const yytype_int16 yycheck[] =
730+static const yytype_uint8 yycheck[] =
726731 {
727− 5, 6, 0, 8, 58, 59, 11, 86, 87, 4,
728− 5, 6, 7, 8, 9, 10, 11, 30, 97, 14,
729− 15, 27, 25, 26, 25, 26, 29, 33, 30, 83,
730− 84, 34, 25, 67, 25, 30, 70, 30, 72, 0,
731− 1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
732− 11, 12, 25, 14, 15, 16, 17, 18, 19, 20,
733− 21, 22, 23, 30, 25, 25, 1, 146, 30, 30,
734− 5, 6, 1, 8, 9, 10, 11, 12, 1, 14,
735− 15, 16, 17, 18, 19, 20, 140, 30, 93, 67,
736− 25, 30, 70, 30, 72, 30, 28, 25, 26, 31,
737− 32, 155, 24, 108, 0, 1, 30, 3, 4, 5,
732+ 1, 66, 67, 10, 92, 93, 3, 25, 26, 14,
733+ 3, 29, 13, 27, 15, 103, 34, 18, 75, 33,
734+ 0, 78, 30, 80, 89, 90, 31, 32, 28, 25,
735+ 26, 31, 32, 30, 0, 1, 101, 30, 4, 5,
738736 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
739− 16, 17, 18, 19, 20, 21, 22, 23, 69, 25,
740− 71, 30, 0, 1, 30, 3, 4, 5, 6, 7,
741− 8, 9, 10, 11, 31, 32, 14, 15, 16, 17,
742− 18, 19, 20, 21, 22, 5, 6, 25, 8, 9,
743− 10, 11, 30, 30, 14, 15, 30, 0, 1, 174,
744− 3, 4, 5, 6, 7, 8, 9, 10, 11, 30,
737+ 16, 17, 18, 19, 20, 21, 22, 23, 30, 25,
738+ 25, 68, 25, 151, 30, 30, 30, 0, 1, 25,
739+ 26, 4, 5, 6, 7, 8, 9, 10, 11, 12,
740+ 145, 14, 15, 16, 17, 18, 19, 20, 21, 22,
741+ 23, 75, 25, 25, 78, 160, 80, 30, 99, 30,
742+ 0, 1, 31, 32, 4, 5, 6, 7, 8, 9,
743+ 10, 11, 25, 114, 14, 15, 16, 17, 18, 19,
744+ 20, 21, 22, 76, 77, 25, 79, 0, 1, 1,
745+ 30, 4, 5, 6, 7, 8, 9, 10, 11, 1,
745746 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
746− 68, 69, 25, 71, 69, 1, 71, 30, 4, 5,
747+ 76, 77, 25, 79, 0, 1, 30, 30, 4, 5,
747748 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
748− 16, 14, 143, 144, 145, 68, 69, 30, 71, 25,
749− 151, 25, 153, 1, 30, 30, 31, 32, 31, 32,
750− 161, 30, 31, 32, 13, 30, 25, 14, 32, 30,
751− 30, 33, 30, 30, 30, 30, 30, 30, 30, 29,
752− 67, 109, 60, -1, -1, -1, -1, -1, -1, 40
749+ 16, 17, 18, 19, 20, 21, 22, 30, 179, 25,
750+ 30, 1, 30, 30, 30, 5, 6, 30, 8, 9,
751+ 10, 11, 12, 30, 14, 15, 16, 17, 18, 19,
752+ 20, 30, 31, 32, 30, 25, 24, 77, 1, 79,
753+ 30, 4, 5, 6, 7, 8, 9, 10, 11, 25,
754+ 1, 14, 15, 16, 4, 5, 6, 7, 8, 9,
755+ 10, 11, 25, 30, 14, 15, 13, 30, 5, 6,
756+ 25, 8, 9, 10, 11, 32, 14, 14, 15, 33,
757+ 30, 148, 149, 150, 30, 31, 32, 30, 77, 156,
758+ 79, 158, 7, 30, 30, 30, 30, 30, 30, 166,
759+ 30, 30, 30, 6, 75, 36, 47, 115
753760 };
754761
755762 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
756763 symbol of state STATE-NUM. */
757764 static const yytype_uint8 yystos[] =
758765 {
759− 0, 36, 37, 0, 1, 3, 4, 5, 6, 7,
760− 8, 9, 10, 11, 14, 15, 16, 17, 18, 19,
761− 20, 21, 22, 25, 30, 38, 39, 41, 42, 43,
762− 44, 50, 51, 53, 57, 59, 61, 62, 64, 66,
763− 67, 68, 75, 30, 25, 26, 74, 74, 30, 74,
764− 25, 80, 30, 74, 25, 25, 25, 26, 29, 34,
765− 78, 79, 30, 1, 1, 45, 45, 54, 56, 60,
766− 71, 65, 71, 30, 76, 30, 30, 30, 30, 30,
767− 30, 78, 78, 31, 32, 76, 27, 33, 30, 30,
768− 1, 12, 16, 18, 19, 20, 21, 22, 23, 25,
769− 30, 40, 46, 47, 69, 70, 72, 17, 18, 19,
770− 20, 30, 40, 55, 70, 72, 39, 52, 75, 39,
771− 53, 58, 64, 75, 30, 40, 72, 39, 53, 63,
772− 64, 75, 30, 28, 78, 78, 79, 79, 30, 30,
773− 24, 74, 73, 74, 78, 25, 79, 48, 1, 13,
774− 30, 74, 73, 25, 78, 14, 77, 30, 77, 77,
775− 77, 79, 25, 30, 30, 77, 30, 77, 30, 78,
776− 30, 30, 30, 77, 33, 49, 30, 30, 30, 74
766+ 0, 3, 30, 36, 37, 38, 62, 78, 25, 26,
767+ 76, 0, 1, 4, 5, 6, 7, 8, 9, 10,
768+ 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
769+ 25, 30, 39, 40, 42, 43, 44, 45, 51, 52,
770+ 54, 58, 60, 63, 64, 66, 68, 69, 70, 77,
771+ 38, 30, 37, 78, 30, 76, 30, 76, 25, 82,
772+ 30, 76, 25, 25, 25, 26, 29, 34, 80, 81,
773+ 30, 1, 1, 46, 46, 55, 57, 61, 73, 67,
774+ 73, 30, 30, 30, 30, 30, 30, 80, 80, 31,
775+ 32, 78, 27, 33, 30, 30, 1, 12, 16, 18,
776+ 19, 20, 21, 22, 23, 25, 30, 41, 47, 48,
777+ 71, 72, 74, 17, 18, 19, 20, 30, 41, 56,
778+ 72, 74, 40, 53, 77, 40, 54, 59, 66, 77,
779+ 30, 41, 74, 40, 54, 65, 66, 77, 28, 80,
780+ 80, 81, 81, 30, 30, 24, 76, 75, 76, 80,
781+ 25, 81, 49, 1, 13, 30, 76, 75, 25, 80,
782+ 14, 79, 30, 79, 79, 79, 81, 25, 30, 30,
783+ 79, 30, 79, 30, 80, 30, 30, 30, 79, 33,
784+ 50, 30, 30, 30, 76
777785 };
778786
779787 #define yyerrok (yyerrstatus = 0)
@@ -1284,7 +1292,7 @@ yydestruct (yymsg, yytype, yyvaluep) · 504 unmodified lines
12841292
12851293 switch (yytype)
12861294 {
1287− case 51: /* "choice_entry" */
1295+ case 52: /* "choice_entry" */
12881296
12891297 {
12901298 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
@@ -1294,7 +1302,7 @@ yydestruct (yymsg, yytype, yyvaluep) · 3 unmodified lines
12941302 };
12951303
12961304 break;
1297− case 57: /* "if_entry" */
1305+ case 58: /* "if_entry" */
12981306
12991307 {
13001308 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
@@ -1304,7 +1312,7 @@ yydestruct (yymsg, yytype, yyvaluep) · 3 unmodified lines
13041312 };
13051313
13061314 break;
1307− case 62: /* "menu_entry" */
1315+ case 64: /* "menu_entry" */
13081316
13091317 {
13101318 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
@@ -1614,39 +1622,39 @@ yyreduce: · 303 unmodified lines
16141622 YY_REDUCE_PRINT (yyn);
16151623 switch (yyn)
16161624 {
1617− case 8:
1625+ case 10:
16181626
16191627 { zconf_error("unexpected end statement"); ;}
16201628 break;
16211629
1622− case 9:
1630+ case 11:
16231631
16241632 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
16251633 break;
16261634
1627− case 10:
1635+ case 12:
16281636
16291637 {
16301638 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
16311639 ;}
16321640 break;
16331641
1634− case 11:
1642+ case 13:
16351643
16361644 { zconf_error("invalid statement"); ;}
16371645 break;
16381646
1639− case 25:
1647+ case 27:
16401648
16411649 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
16421650 break;
16431651
1644− case 26:
1652+ case 28:
16451653
16461654 { zconf_error("invalid option"); ;}
16471655 break;
16481656
1649− case 27:
1657+ case 29:
16501658
16511659 {
16521660 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
@@ -1656,7 +1664,7 @@ yyreduce: · 3 unmodified lines
16561664 ;}
16571665 break;
16581666
1659− case 28:
1667+ case 30:
16601668
16611669 {
16621670 menu_end_entry();
@@ -1664,7 +1672,7 @@ yyreduce: · 1 unmodified line
16641672 ;}
16651673 break;
16661674
1667− case 29:
1675+ case 31:
16681676
16691677 {
16701678 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
@@ -1674,7 +1682,7 @@ yyreduce: · 3 unmodified lines
16741682 ;}
16751683 break;
16761684
1677− case 30:
1685+ case 32:
16781686
16791687 {
16801688 if (current_entry->prompt)
@@ -1686,7 +1694,7 @@ yyreduce: · 5 unmodified lines
16861694 ;}
16871695 break;
16881696
1689− case 38:
1697+ case 40:
16901698
16911699 {
16921700 menu_set_type((yyvsp[(1) - (3)].id)->stype);
@@ -1696,7 +1704,7 @@ yyreduce: · 3 unmodified lines
16961704 ;}
16971705 break;
16981706
1699− case 39:
1707+ case 41:
17001708
17011709 {
17021710 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
@@ -1704,7 +1712,7 @@ yyreduce: · 1 unmodified line
17041712 ;}
17051713 break;
17061714
1707− case 40:
1715+ case 42:
17081716
17091717 {
17101718 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
@@ -1716,7 +1724,7 @@ yyreduce: · 5 unmodified lines
17161724 ;}
17171725 break;
17181726
1719− case 41:
1727+ case 43:
17201728
17211729 {
17221730 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
@@ -1724,7 +1732,7 @@ yyreduce: · 1 unmodified line
17241732 ;}
17251733 break;
17261734
1727− case 42:
1735+ case 44:
17281736
17291737 {
17301738 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
@@ -1732,7 +1740,7 @@ yyreduce: · 1 unmodified line
17321740 ;}
17331741 break;
17341742
1735− case 45:
1743+ case 47:
17361744
17371745 {
17381746 struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
@@ -1744,17 +1752,17 @@ yyreduce: · 5 unmodified lines
17441752 ;}
17451753 break;
17461754
1747− case 46:
1755+ case 48:
17481756
17491757 { (yyval.string) = NULL; ;}
17501758 break;
17511759
1752− case 47:
1760+ case 49:
17531761
17541762 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
17551763 break;
17561764
1757− case 48:
1765+ case 50:
17581766
17591767 {
17601768 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
@@ -1765,14 +1773,14 @@ yyreduce: · 4 unmodified lines
17651773 ;}
17661774 break;
17671775
1768− case 49:
1776+ case 51:
17691777
17701778 {
17711779 (yyval.menu) = menu_add_menu();
17721780 ;}
17731781 break;
17741782
1775− case 50:
1783+ case 52:
17761784
17771785 {
17781786 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
@@ -1782,7 +1790,7 @@ yyreduce: · 3 unmodified lines
17821790 ;}
17831791 break;
17841792
1785− case 58:
1793+ case 60:
17861794
17871795 {
17881796 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
@@ -1790,7 +1798,7 @@ yyreduce: · 1 unmodified line
17901798 ;}
17911799 break;
17921800
1793− case 59:
1801+ case 61:
17941802
17951803 {
17961804 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
@@ -1803,7 +1811,7 @@ yyreduce: · 6 unmodified lines
18031811 ;}
18041812 break;
18051813
1806− case 60:
1814+ case 62:
18071815
18081816 {
18091817 current_entry->sym->flags |= SYMBOL_OPTIONAL;
@@ -1811,7 +1819,7 @@ yyreduce: · 1 unmodified line
18111819 ;}
18121820 break;
18131821
1814− case 61:
1822+ case 63:
18151823
18161824 {
18171825 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
@@ -1823,7 +1831,7 @@ yyreduce: · 5 unmodified lines
18231831 ;}
18241832 break;
18251833
1826− case 64:
1834+ case 66:
18271835
18281836 {
18291837 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
@@ -1833,7 +1841,7 @@ yyreduce: · 3 unmodified lines
18331841 ;}
18341842 break;
18351843
1836− case 65:
1844+ case 67:
18371845
18381846 {
18391847 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
@@ -1843,7 +1851,14 @@ yyreduce: · 3 unmodified lines
18431851 ;}
18441852 break;
18451853
1846− case 71:
1854+ case 73:
1855+
1856+ {
1857+ menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1858+;}
1859+ break;
1860+
1861+ case 74:
18471862
18481863 {
18491864 menu_add_entry(NULL);
@@ -1852,14 +1867,14 @@ yyreduce: · 2 unmodified lines
18521867 ;}
18531868 break;
18541869
1855− case 72:
1870+ case 75:
18561871
18571872 {
18581873 (yyval.menu) = menu_add_menu();
18591874 ;}
18601875 break;
18611876
1862− case 73:
1877+ case 76:
18631878
18641879 {
18651880 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
@@ -1869,7 +1884,7 @@ yyreduce: · 3 unmodified lines
18691884 ;}
18701885 break;
18711886
1872− case 79:
1887+ case 82:
18731888
18741889 {
18751890 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
@@ -1877,7 +1892,7 @@ yyreduce: · 1 unmodified line
18771892 ;}
18781893 break;
18791894
1880− case 80:
1895+ case 83:
18811896
18821897 {
18831898 menu_add_entry(NULL);
@@ -1886,14 +1901,14 @@ yyreduce: · 2 unmodified lines
18861901 ;}
18871902 break;
18881903
1889− case 81:
1904+ case 84:
18901905
18911906 {
18921907 menu_end_entry();
18931908 ;}
18941909 break;
18951910
1896− case 82:
1911+ case 85:
18971912
18981913 {
18991914 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
@@ -1901,14 +1916,14 @@ yyreduce: · 1 unmodified line
19011916 ;}
19021917 break;
19031918
1904− case 83:
1919+ case 86:
19051920
19061921 {
19071922 current_entry->help = (yyvsp[(2) - (2)].string);
19081923 ;}
19091924 break;
19101925
1911− case 88:
1926+ case 91:
19121927
19131928 {
19141929 menu_add_dep((yyvsp[(3) - (4)].expr));
@@ -1916,84 +1931,84 @@ yyreduce: · 1 unmodified line
19161931 ;}
19171932 break;
19181933
1919− case 90:
1934+ case 93:
19201935
19211936 {
19221937 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
19231938 ;}
19241939 break;
19251940
1926− case 93:
1941+ case 96:
19271942
19281943 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
19291944 break;
19301945
1931− case 94:
1946+ case 97:
19321947
19331948 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
19341949 break;
19351950
1936− case 95:
1951+ case 98:
19371952
19381953 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
19391954 break;
19401955
1941− case 98:
1956+ case 101:
19421957
19431958 { (yyval.expr) = NULL; ;}
19441959 break;
19451960
1946− case 99:
1961+ case 102:
19471962
19481963 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
19491964 break;
19501965
1951− case 100:
1966+ case 103:
19521967
19531968 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
19541969 break;
19551970
1956− case 101:
1971+ case 104:
19571972
19581973 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
19591974 break;
19601975
1961− case 102:
1976+ case 105:
19621977
19631978 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
19641979 break;
19651980
1966− case 103:
1981+ case 106:
19671982
19681983 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
19691984 break;
19701985
1971− case 104:
1986+ case 107:
19721987
19731988 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
19741989 break;
19751990
1976− case 105:
1991+ case 108:
19771992
19781993 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
19791994 break;
19801995
1981− case 106:
1996+ case 109:
19821997
19831998 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
19841999 break;
19852000
1986− case 107:
2001+ case 110:
19872002
19882003 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
19892004 break;
19902005
1991− case 108:
2006+ case 111:
19922007
19932008 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
19942009 break;
19952010
1996− case 109:
2011+ case 112:
19972012
19982013 { (yyval.string) = NULL; ;}
19992014 break;
@@ -2239,6 +2254,10 @@ void conf_parse(const char *name) · 239 unmodified lines
22392254 prop = prop_alloc(P_DEFAULT, modules_sym);
22402255 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
22412256 }
2257+
2258+ rootmenu.prompt->text = _(rootmenu.prompt->text);
2259+ rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2260+
22422261 menu_finalize(&rootmenu);
22432262 for_all_symbols(i, sym) {
22442263 if (sym_check_deps(sym))
scripts/kconfig/zconf.y+15−3
@@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry; · 35 unmodified lines
3636 #define YYERROR_VERBOSE
3737 #endif
3838 %}
39−%expect 26
39+%expect 28
4040
4141 %union
4242 {
@@ -104,14 +104,15 @@ static struct menu *current_menu, *current_entry; · 61 unmodified lines
104104 %}
105105
106106 %%
107−input: stmt_list;
107+input: nl start | start;
108+
109+start: mainmenu_stmt stmt_list | stmt_list;
108110
109111 stmt_list:
110112 /* empty */
111113 | stmt_list common_stmt
112114 | stmt_list choice_stmt
113115 | stmt_list menu_stmt
114− | stmt_list T_MAINMENU prompt nl
115116 | stmt_list end { zconf_error("unexpected end statement"); }
116117 | stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); }
117118 | stmt_list option_name error T_EOL
@@ -342,6 +343,13 @@ if_block: · 224 unmodified lines
342343 | if_block choice_stmt
343344 ;
344345
346+/* mainmenu entry */
347+
348+mainmenu_stmt: T_MAINMENU prompt nl
349+{
350+ menu_add_prompt(P_MENU, $2, NULL);
351+};
352+
345353 /* menu entry */
346354
347355 menu: T_MENU prompt T_EOL
@@ -494,6 +502,10 @@ void conf_parse(const char *name) · 146 unmodified lines
494502 prop = prop_alloc(P_DEFAULT, modules_sym);
495503 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
496504 }
505+
506+ rootmenu.prompt->text = _(rootmenu.prompt->text);
507+ rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
508+
497509 menu_finalize(&rootmenu);
498510 for_all_symbols(i, sym) {
499511 if (sym_check_deps(sym))