aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/nconf.c
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-09-27 17:24:53 -0400
committerMichal Marek <mmarek@suse.cz>2010-09-27 17:24:53 -0400
commit0455029bea7da2a2a92003238c9617a36d5d48fd (patch)
tree5dd4935db441dd443f38846236a8b353c9a92da1 /scripts/kconfig/nconf.c
parent8c41e5e363db55d91aa3b1cdce4ab02ad9821de7 (diff)
parent838a2e55e6a4e9e8a10451ed2ef0f7a08dabdb04 (diff)
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
Diffstat (limited to 'scripts/kconfig/nconf.c')
-rw-r--r--scripts/kconfig/nconf.c73
1 files changed, 32 insertions, 41 deletions
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index d4d1fa696c93..a2969fdc66b4 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -15,11 +15,9 @@
15static const char nconf_readme[] = N_( 15static const char nconf_readme[] = N_(
16"Overview\n" 16"Overview\n"
17"--------\n" 17"--------\n"
18"Some kernel features may be built directly into the kernel.\n" 18"This interface let you select features and parameters for the build.\n"
19"Some may be made into loadable runtime modules. Some features\n" 19"Features can either be built-in, modularized, or ignored. Parameters\n"
20"may be completely removed altogether. There are also certain\n" 20"must be entered in as decimal or hexadecimal numbers or text.\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"
23"\n" 21"\n"
24"Menu items beginning with following braces represent features that\n" 22"Menu items beginning with following braces represent features that\n"
25" [ ] can be built in or removed\n" 23" [ ] can be built in or removed\n"
@@ -95,7 +93,7 @@ static const char nconf_readme[] = N_(
95"-----------------------------\n" 93"-----------------------------\n"
96"nconfig supports the use of alternate configuration files for\n" 94"nconfig supports the use of alternate configuration files for\n"
97"those who, for various reasons, find it necessary to switch\n" 95"those who, for various reasons, find it necessary to switch\n"
98"between different kernel configurations.\n" 96"between different configurations.\n"
99"\n" 97"\n"
100"At the end of the main menu you will find two options. One is\n" 98"At the end of the main menu you will find two options. One is\n"
101"for saving the current configuration to a file of your choosing.\n" 99"for saving the current configuration to a file of your choosing.\n"
@@ -128,9 +126,9 @@ static const char nconf_readme[] = N_(
128"\n" 126"\n"
129"Optional personality available\n" 127"Optional personality available\n"
130"------------------------------\n" 128"------------------------------\n"
131"If you prefer to have all of the kernel options listed in a single\n" 129"If you prefer to have all of the options listed in a single menu, rather\n"
132"menu, rather than the default multimenu hierarchy, run the nconfig\n" 130"than the default multimenu hierarchy, run the nconfig with NCONFIG_MODE\n"
133"with NCONFIG_MODE environment variable set to single_menu. Example:\n" 131"environment variable set to single_menu. Example:\n"
134"\n" 132"\n"
135"make NCONFIG_MODE=single_menu nconfig\n" 133"make NCONFIG_MODE=single_menu nconfig\n"
136"\n" 134"\n"
@@ -185,19 +183,19 @@ setmod_text[] = N_(
185"has been configured as a module.\n" 183"has been configured as a module.\n"
186"As a result, this feature will be built as a module."), 184"As a result, this feature will be built as a module."),
187nohelp_text[] = N_( 185nohelp_text[] = N_(
188"There is no help available for this kernel option.\n"), 186"There is no help available for this option.\n"),
189load_config_text[] = N_( 187load_config_text[] = N_(
190"Enter the name of the configuration file you wish to load.\n" 188"Enter the name of the configuration file you wish to load.\n"
191"Accept the name shown to restore the configuration you\n" 189"Accept the name shown to restore the configuration you\n"
192"last retrieved. Leave blank to abort."), 190"last retrieved. Leave blank to abort."),
193load_config_help[] = N_( 191load_config_help[] = N_(
194"\n" 192"\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"
196"configurations available on a single machine.\n" 194"configurations available on a single machine.\n"
197"\n" 195"\n"
198"If you have saved a previous configuration in a file other than the\n" 196"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" 197"default one, entering its name here will allow you to modify that\n"
200"to modify that configuration.\n" 198"configuration.\n"
201"\n" 199"\n"
202"If you are uncertain, then you have probably never used alternate\n" 200"If you are uncertain, then you have probably never used alternate\n"
203"configuration files. You should therefor leave this blank to abort.\n"), 201"configuration files. You should therefor leave this blank to abort.\n"),
@@ -206,8 +204,8 @@ save_config_text[] = N_(
206"as an alternate. Leave blank to abort."), 204"as an alternate. Leave blank to abort."),
207save_config_help[] = N_( 205save_config_help[] = N_(
208"\n" 206"\n"
209"For various reasons, one may wish to keep different kernel\n" 207"For various reasons, one may wish to keep different configurations\n"
210"configurations available on a single machine.\n" 208"available on a single machine.\n"
211"\n" 209"\n"
212"Entering a file name here will allow you to later retrieve, modify\n" 210"Entering a file name here will allow you to later retrieve, modify\n"
213"and use the current configuration as an alternate to whatever\n" 211"and use the current configuration as an alternate to whatever\n"
@@ -217,8 +215,8 @@ save_config_help[] = N_(
217"leave this blank.\n"), 215"leave this blank.\n"),
218search_help[] = N_( 216search_help[] = N_(
219"\n" 217"\n"
220"Search for CONFIG_ symbols and display their relations.\n" 218"Search for symbols and display their relations. Regular expressions\n"
221"Regular expressions are allowed.\n" 219"are allowed.\n"
222"Example: search for \"^FOO\"\n" 220"Example: search for \"^FOO\"\n"
223"Result:\n" 221"Result:\n"
224"-----------------------------------------------------------------\n" 222"-----------------------------------------------------------------\n"
@@ -234,7 +232,7 @@ search_help[] = N_(
234"Selected by: BAR\n" 232"Selected by: BAR\n"
235"-----------------------------------------------------------------\n" 233"-----------------------------------------------------------------\n"
236"o The line 'Prompt:' shows the text used in the menu structure for\n" 234"o The line 'Prompt:' shows the text used in the menu structure for\n"
237" this CONFIG_ symbol\n" 235" this symbol\n"
238"o The 'Defined at' line tell at what file / line number the symbol\n" 236"o The 'Defined at' line tell at what file / line number the symbol\n"
239" is defined\n" 237" is defined\n"
240"o The 'Depends on:' line tell what symbols needs to be defined for\n" 238"o The 'Depends on:' line tell what symbols needs to be defined for\n"
@@ -250,9 +248,9 @@ search_help[] = N_(
250"Only relevant lines are shown.\n" 248"Only relevant lines are shown.\n"
251"\n\n" 249"\n\n"
252"Search examples:\n" 250"Search examples:\n"
253"Examples: USB = > find all CONFIG_ symbols containing USB\n" 251"Examples: USB = > find all symbols containing USB\n"
254" ^USB => find all CONFIG_ symbols starting with USB\n" 252" ^USB => find all symbols starting with USB\n"
255" USB$ => find all CONFIG_ symbols ending with USB\n" 253" USB$ => find all symbols ending with USB\n"
256"\n"); 254"\n");
257 255
258struct mitem { 256struct mitem {
@@ -635,13 +633,9 @@ static char menu_backtitle[PATH_MAX+128];
635static const char *set_config_filename(const char *config_filename) 633static const char *set_config_filename(const char *config_filename)
636{ 634{
637 int size; 635 int size;
638 struct symbol *sym;
639 636
640 sym = sym_lookup("KERNELVERSION", 0);
641 sym_calc_value(sym);
642 size = snprintf(menu_backtitle, sizeof(menu_backtitle), 637 size = snprintf(menu_backtitle, sizeof(menu_backtitle),
643 _("%s - Linux Kernel v%s Configuration"), 638 "%s - %s", config_filename, rootmenu.prompt->text);
644 config_filename, sym_get_string_value(sym));
645 if (size >= sizeof(menu_backtitle)) 639 if (size >= sizeof(menu_backtitle))
646 menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; 640 menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
647 641
@@ -681,8 +675,7 @@ static int do_exit(void)
681 return 0; 675 return 0;
682 } 676 }
683 res = btn_dialog(main_window, 677 res = btn_dialog(main_window,
684 _("Do you wish to save your " 678 _("Do you wish to save your new configuration?\n"
685 "new kernel configuration?\n"
686 "<ESC> to cancel and resume nconfig."), 679 "<ESC> to cancel and resume nconfig."),
687 2, 680 2,
688 " <save> ", 681 " <save> ",
@@ -701,18 +694,16 @@ static int do_exit(void)
701 if (res) 694 if (res)
702 btn_dialog( 695 btn_dialog(
703 main_window, 696 main_window,
704 _("Error during writing of the kernel " 697 _("Error during writing of configuration.\n"
705 "configuration.\n" 698 "Your configuration changes were NOT saved."),
706 "Your kernel configuration "
707 "changes were NOT saved."),
708 1, 699 1,
709 "<OK>"); 700 "<OK>");
710 else { 701 else {
711 char buf[1024]; 702 char buf[1024];
712 snprintf(buf, 1024, 703 snprintf(buf, 1024,
713 _("Configuration written to %s\n" 704 _("Configuration written to %s\n"
714 "End of Linux kernel configuration.\n" 705 "End of the configuration.\n"
715 "Execute 'make' to build the kernel or try" 706 "Execute 'make' to start the build or try"
716 " 'make help'."), filename); 707 " 'make help'."), filename);
717 btn_dialog( 708 btn_dialog(
718 main_window, 709 main_window,
@@ -724,7 +715,7 @@ static int do_exit(void)
724 default: 715 default:
725 btn_dialog( 716 btn_dialog(
726 main_window, 717 main_window,
727 _("Your kernel configuration changes were NOT saved."), 718 _("Your configuration changes were NOT saved."),
728 1, 719 1,
729 "<OK>"); 720 "<OK>");
730 break; 721 break;
@@ -744,8 +735,8 @@ static void search_conf(void)
744again: 735again:
745 dres = dialog_inputbox(main_window, 736 dres = dialog_inputbox(main_window,
746 _("Search Configuration Parameter"), 737 _("Search Configuration Parameter"),
747 _("Enter CONFIG_ (sub)string to search for " 738 _("Enter " CONFIG_ " (sub)string to search for "
748 "(with or without \"CONFIG\")"), 739 "(with or without \"" CONFIG_ "\")"),
749 "", dialog_input_result, 99); 740 "", dialog_input_result, 99);
750 switch (dres) { 741 switch (dres) {
751 case 0: 742 case 0:
@@ -758,10 +749,10 @@ again:
758 return; 749 return;
759 } 750 }
760 751
761 /* strip CONFIG_ if necessary */ 752 /* strip the prefix if necessary */
762 dialog_input = dialog_input_result; 753 dialog_input = dialog_input_result;
763 if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) 754 if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
764 dialog_input += 7; 755 dialog_input += strlen(CONFIG_);
765 756
766 sym_arr = sym_re_search(dialog_input); 757 sym_arr = sym_re_search(dialog_input);
767 res = get_relations_str(sym_arr); 758 res = get_relations_str(sym_arr);
@@ -1261,7 +1252,7 @@ static void show_help(struct menu *menu)
1261 1252
1262 if (menu && menu->sym && menu_has_help(menu)) { 1253 if (menu && menu->sym && menu_has_help(menu)) {
1263 if (menu->sym->name) { 1254 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);
1265 str_append(&help, _(menu_get_help(menu))); 1256 str_append(&help, _(menu_get_help(menu)));
1266 str_append(&help, "\n"); 1257 str_append(&help, "\n");
1267 get_symbol_str(&help, menu->sym); 1258 get_symbol_str(&help, menu->sym);