summaryrefslogtreecommitdiff
path: root/extra/config
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-18 03:12:04 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-18 03:12:04 +0000
commit85b6ebca5cef107dfafa9150605aaae1f8c51827 (patch)
tree707e493a5ee7b4ebcd18d142c88654f746e98d4b /extra/config
parentfec64b1a416cfeb0c9e57292924293d246251c8d (diff)
sync with kernel
Diffstat (limited to 'extra/config')
-rw-r--r--extra/config/conf.c26
-rw-r--r--extra/config/confdata.c59
-rw-r--r--extra/config/lkc.h18
-rw-r--r--extra/config/mconf.c87
-rw-r--r--extra/config/menu.c8
-rw-r--r--extra/config/symbol.c2
-rw-r--r--extra/config/zconf.tab.c_shipped8
-rw-r--r--extra/config/zconf.y8
8 files changed, 131 insertions, 85 deletions
diff --git a/extra/config/conf.c b/extra/config/conf.c
index 98b0015ae..0907369dd 100644
--- a/extra/config/conf.c
+++ b/extra/config/conf.c
@@ -31,14 +31,14 @@ char *defconfig_file;
static int indent = 1;
static int valid_stdin = 1;
static int conf_cnt;
-static signed char line[128];
+static char line[128];
static struct menu *rootEntry;
-static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
+static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
-static void strip(signed char *str)
+static void strip(char *str)
{
- signed char *p = str;
+ char *p = str;
int l;
while ((isspace(*p)))
@@ -56,9 +56,9 @@ static void strip(signed char *str)
static void check_stdin(void)
{
if (!valid_stdin && input_mode == ask_silent) {
- printf("aborted!\n\n");
- printf("Console input/output is redirected. ");
- printf("Run 'make oldconfig' to update configuration.\n\n");
+ printf(_("aborted!\n\n"));
+ printf(_("Console input/output is redirected. "));
+ printf(_("Run 'make oldconfig' to update configuration.\n\n"));
exit(1);
}
}
@@ -470,7 +470,7 @@ static void check_conf(struct menu *menu)
if (sym) {
if (sym_is_changable(sym) && !sym_has_value(sym)) {
if (!conf_cnt++)
- printf("*\n* Restart config...\n*\n");
+ printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu);
conf(rootEntry);
}
@@ -504,7 +504,7 @@ int main(int ac, char **av)
input_mode = set_default;
defconfig_file = av[i++];
if (!defconfig_file) {
- printf("%s: No default config file specified\n",
+ printf(_("%s: No default config file specified\n"),
av[0]);
exit(1);
}
@@ -530,7 +530,7 @@ int main(int ac, char **av)
}
name = av[i];
if (!name) {
- printf("%s: configuration file missing\n", av[0]);
+ printf(_("%s: Kconfig file missing\n"), av[0]);
}
conf_parse(name);
//zconfdump(stdout);
@@ -547,12 +547,12 @@ int main(int ac, char **av)
break;
case ask_silent:
if (stat(".config", &tmpstat)) {
- printf("***\n"
+ printf(_("***\n"
"*** You have not yet configured uClibc!\n"
"***\n"
"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
"*** \"make menuconfig\" or \"make config\").\n"
- "***\n");
+ "***\n"));
exit(1);
}
case ask_all:
@@ -576,7 +576,7 @@ int main(int ac, char **av)
check_conf(&rootmenu);
} while (conf_cnt);
if (conf_write(NULL)) {
- fprintf(stderr, "\n*** Error during writing of the uClibc configuration.\n\n");
+ fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
return 1;
}
return 0;
diff --git a/extra/config/confdata.c b/extra/config/confdata.c
index a3f19091e..60bfe77c4 100644
--- a/extra/config/confdata.c
+++ b/extra/config/confdata.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#define LKC_DIRECT_LINK
@@ -23,10 +24,10 @@ const char *conf_confnames[] = {
NULL,
};
-static char *conf_expand_value(const signed char *in)
+static char *conf_expand_value(const char *in)
{
struct symbol *sym;
- const signed char *src;
+ const char *src;
static char res_value[SYMBOL_MAXLENGTH];
char *dst, name[SYMBOL_MAXLENGTH];
@@ -84,9 +85,9 @@ int conf_read(const char *name)
name = conf_expand_value(name);
in = zconf_fopen(name);
if (in) {
- printf("#\n"
- "# using defaults found in %s\n"
- "#\n", name);
+ printf(_("#\n"
+ "# using defaults found in %s\n"
+ "#\n"), name);
break;
}
}
@@ -264,6 +265,9 @@ int conf_write(const char *name)
char dirname[128], tmpname[128], newname[128];
int type, l;
const char *str;
+ time_t now;
+ int use_timestamp = 1;
+ char *env;
dirname[0] = 0;
if (name && name[0]) {
@@ -297,25 +301,36 @@ int conf_write(const char *name)
if (!out_h)
return 1;
}
- fprintf(out, "#\n"
- "# Automatically generated make config: don't edit\n"
- "#\n");
+ time(&now);
+ env = getenv("KCONFIG_NOTIMESTAMP");
+ if (env && *env)
+ use_timestamp = 0;
+
+ fprintf(out, _("#\n"
+ "# Automatically generated make config: don't edit\n"
+ "%s%s"
+ "#\n"),
+ use_timestamp ? "# " : "",
+ use_timestamp ? ctime(&now) : "");
if (out_h)
fprintf(out_h, "/*\n"
- " * Automatically generated C config: don't edit\n"
- " */\n"
- "#if !defined __FEATURES_H && !defined __need_uClibc_config_h\n"
- "#error Never include <bits/uClibc_config.h> directly; use <features.h> instead\n"
- "#endif\n\n"
- "/*\n"
- " * Version Number\n"
- " */\n"
- "#define __UCLIBC_MAJOR__ %s\n"
- "#define __UCLIBC_MINOR__ %s\n"
- "#define __UCLIBC_SUBLEVEL__ %s\n",
- getenv("MAJOR_VERSION"),
- getenv("MINOR_VERSION"),
- getenv("SUBLEVEL"));
+ " * Automatically generated C config: don't edit\n"
+ "%s%s"
+ " */\n"
+ "#if !defined __FEATURES_H && !defined __need_uClibc_config_h\n"
+ "#error Never include <bits/uClibc_config.h> directly; use <features.h> instead\n"
+ "#endif\n\n"
+ "/*\n"
+ " * Version Number\n"
+ " */\n"
+ "#define __UCLIBC_MAJOR__ %s\n"
+ "#define __UCLIBC_MINOR__ %s\n"
+ "#define __UCLIBC_SUBLEVEL__ %s\n",
+ use_timestamp ? " * " : "",
+ use_timestamp ? ctime(&now) : "",
+ getenv("MAJOR_VERSION"),
+ getenv("MINOR_VERSION"),
+ getenv("SUBLEVEL"));
if (!sym_change_count)
sym_clear_all_valid();
diff --git a/extra/config/lkc.h b/extra/config/lkc.h
index b8a67fc9d..5e5073a3b 100644
--- a/extra/config/lkc.h
+++ b/extra/config/lkc.h
@@ -8,6 +8,8 @@
#include "expr.h"
+//#include <libintl.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -23,6 +25,20 @@ extern "C" {
#define SRCTREE "srctree"
+#define PACKAGE "linux"
+#define LOCALEDIR "/usr/share/locale"
+
+#if 0
+#define _(text) gettext(text)
+#define N_(text) (text)
+#else
+#define _(text) (text)
+#define N_(text) (text)
+#define setlocale(a,b)
+#define bindtextdomain(p,l)
+#define textdomain(p)
+#endif
+
int zconfparse(void);
void zconfdump(FILE *out);
@@ -51,7 +67,7 @@ void menu_add_entry(struct symbol *sym);
void menu_end_entry(void);
void menu_add_dep(struct expr *dep);
struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
-void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
+struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
void menu_finalize(struct menu *parent);
diff --git a/extra/config/mconf.c b/extra/config/mconf.c
index e60f01889..749d5760e 100644
--- a/extra/config/mconf.c
+++ b/extra/config/mconf.c
@@ -5,8 +5,7 @@
* Introduced single menu mode (show all sub-menus in one large tree).
* 2002-11-06 Petr Baudis <pasky@ucw.cz>
*
- * Directly use liblxdialog library routines.
- * 2002-11-14 Petr Baudis <pasky@ucw.cz>
+ * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*/
#include <sys/ioctl.h>
@@ -23,13 +22,15 @@
#include <termios.h>
#include <unistd.h>
+//#include <locale.h>
+
#include "lxdialog/dialog.h"
#define LKC_DIRECT_LINK
#include "lkc.h"
static char menu_backtitle[128];
-static const char mconf_readme[] =
+static const char mconf_readme[] = N_(
"Overview\n"
"--------\n"
"Some features may be built directly into uClibc. Some features\n"
@@ -160,39 +161,39 @@ static const char mconf_readme[] =
"\n"
"Note that this mode can eventually be a little more CPU expensive\n"
"(especially with a larger number of unrolled categories) than the\n"
-"default mode.\n",
-menu_instructions[] =
+"default mode.\n"),
+menu_instructions[] = N_(
"Arrow keys navigate the menu. "
"<Enter> selects submenus --->. "
"Highlighted letters are hotkeys. "
"Pressing <Y> selectes a feature, while <N> will exclude a feature. "
"Press <Esc><Esc> to exit, <?> for Help, </> for Search. "
- "Legend: [*] feature is selected [ ] feature is excluded",
-radiolist_instructions[] =
+ "Legend: [*] feature is selected [ ] feature is excluded"),
+radiolist_instructions[] = N_(
"Use the arrow keys to navigate this window or "
"press the hotkey of the item you wish to select "
"followed by the <SPACE BAR>. "
- "Press <?> for additional information about this option.",
-inputbox_instructions_int[] =
+ "Press <?> for additional information about this option."),
+inputbox_instructions_int[] = N_(
"Please enter a decimal value. "
"Fractions will not be accepted. "
- "Use the <TAB> key to move from the input field to the buttons below it.",
-inputbox_instructions_hex[] =
+ "Use the <TAB> key to move from the input field to the buttons below it."),
+inputbox_instructions_hex[] = N_(
"Please enter a hexadecimal value. "
- "Use the <TAB> key to move from the input field to the buttons below it.",
-inputbox_instructions_string[] =
+ "Use the <TAB> key to move from the input field to the buttons below it."),
+inputbox_instructions_string[] = N_(
"Please enter a string value. "
- "Use the <TAB> key to move from the input field to the buttons below it.",
-setmod_text[] =
+ "Use the <TAB> key to move from the input field to the buttons below it."),
+setmod_text[] = N_(
"This feature depends on another which has been configured as a module.\n"
- "As a result, this feature will be built as a module.",
-nohelp_text[] =
- "There is no help available for this option.\n",
-load_config_text[] =
+ "As a result, this feature will be built as a module."),
+nohelp_text[] = N_(
+ "There is no help available for this option.\n"),
+load_config_text[] = N_(
"Enter the name of the configuration file you wish to load. "
"Accept the name shown to restore the configuration you "
- "last retrieved. Leave blank to abort.",
-load_config_help[] =
+ "last retrieved. Leave blank to abort."),
+load_config_help[] = N_(
"\n"
"For various reasons, one may wish to keep several different uClibc\n"
"configurations available on a single machine.\n"
@@ -202,11 +203,11 @@ load_config_help[] =
"to modify that configuration.\n"
"\n"
"If you are uncertain, then you have probably never used alternate\n"
- "configuration files. You should therefor leave this blank to abort.\n",
-save_config_text[] =
+ "configuration files. You should therefor leave this blank to abort.\n"),
+save_config_text[] = N_(
"Enter a filename to which this configuration should be saved "
- "as an alternate. Leave blank to abort.",
-save_config_help[] =
+ "as an alternate. Leave blank to abort."),
+save_config_help[] = N_(
"\n"
"For various reasons, one may wish to keep different uClibc\n"
"configurations available on a single machine.\n"
@@ -216,8 +217,8 @@ save_config_help[] =
"configuration options you have selected at that time.\n"
"\n"
"If you are uncertain what all this means then you should probably\n"
- "leave this blank.\n",
-search_help[] =
+ "leave this blank.\n"),
+search_help[] = N_(
"\n"
"Search for CONFIG_ symbols and display their relations.\n"
"Example: search for \"^FOO\"\n"
@@ -254,7 +255,7 @@ search_help[] =
"Examples: USB => find all CONFIG_ symbols containing USB\n"
" ^USB => find all CONFIG_ symbols starting with USB\n"
" USB$ => find all CONFIG_ symbols ending with USB\n"
- "\n";
+ "\n");
static char filename[PATH_MAX+1] = ".config";
static int indent;
@@ -303,8 +304,8 @@ static void init_wsize(void)
}
if (rows < 19 || cols < 80) {
- fprintf(stderr, "Your display is too small to run Menuconfig!\n");
- fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
+ fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
+ fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
exit(1);
}
@@ -935,12 +936,16 @@ int main(int ac, char **av)
char *mode;
int stat;
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
conf_parse(av[1]);
conf_read(NULL);
sym = sym_lookup("VERSION", 0);
sym_calc_value(sym);
- snprintf(menu_backtitle, 128, "uClibc v%s Configuration",
+ snprintf(menu_backtitle, sizeof(menu_backtitle), _("uClibc v%s Configuration"),
sym_get_string_value(sym));
mode = getenv("MENUCONFIG_MODE");
@@ -966,12 +971,22 @@ int main(int ac, char **av)
end_dialog();
if (stat == 0) {
- conf_write(NULL);
- printf("\n\n"
+ if (conf_write(NULL)) {
+ fprintf(stderr, _("\n\n"
+ "Error during writing of the uClibc configuration.\n"
+ "Your uClibc configuration changes were NOT saved."
+ "\n\n"));
+ return 1;
+ }
+ printf(_("\n\n"
"*** End of uClibc configuration.\n"
- "*** Check the top-level Makefile for additional configuration options.\n\n");
- } else
- printf("\n\nYour uClibc configuration changes were NOT saved.\n\n");
+ "*** Execute 'make' to build uClibc."
+ "\n\n"));
+ } else {
+ fprintf(stderr, _("\n\n"
+ "Your uClibc configuration changes were NOT saved."
+ "\n\n"));
+ }
return 0;
}
diff --git a/extra/config/menu.c b/extra/config/menu.c
index 0c13156f3..5cfa6c405 100644
--- a/extra/config/menu.c
+++ b/extra/config/menu.c
@@ -136,9 +136,9 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
return prop;
}
-void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
+struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
{
- menu_add_prop(type, prompt, NULL, dep);
+ return menu_add_prop(type, prompt, NULL, dep);
}
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
@@ -365,9 +365,9 @@ bool menu_is_visible(struct menu *menu)
const char *menu_get_prompt(struct menu *menu)
{
if (menu->prompt)
- return menu->prompt->text;
+ return _(menu->prompt->text);
else if (menu->sym)
- return menu->sym->name;
+ return _(menu->sym->name);
return NULL;
}
diff --git a/extra/config/symbol.c b/extra/config/symbol.c
index ea629728a..e0286331e 100644
--- a/extra/config/symbol.c
+++ b/extra/config/symbol.c
@@ -727,7 +727,7 @@ struct symbol *sym_check_deps(struct symbol *sym)
if (sym->flags & SYMBOL_CHECK_DONE)
return NULL;
if (sym->flags & SYMBOL_CHECK) {
- printf("Warning! Found recursive dependency: %s", sym->name);
+ fprintf(stderr, "Warning! Found recursive dependency: %s\n", sym->name);
return sym;
}
diff --git a/extra/config/zconf.tab.c_shipped b/extra/config/zconf.tab.c_shipped
index 3f0f7bb6a..20a39c152 100644
--- a/extra/config/zconf.tab.c_shipped
+++ b/extra/config/zconf.tab.c_shipped
@@ -1531,7 +1531,7 @@ yyreduce:
{
menu_add_entry(NULL);
- menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
+ menu_add_prompt(P_MENU, yyvsp[-1].string, NULL);
printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
;}
break;
@@ -1586,7 +1586,7 @@ yyreduce:
{
menu_add_entry(NULL);
- menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
+ menu_add_prompt(P_COMMENT, yyvsp[-1].string, NULL);
printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
;}
break;
@@ -1640,7 +1640,7 @@ yyreduce:
case 86:
{
- menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
+ menu_add_prompt(P_PROMPT, yyvsp[-1].string, yyvsp[0].expr);
;}
break;
@@ -1925,7 +1925,7 @@ void conf_parse(const char *name)
sym_init();
menu_init();
modules_sym = sym_lookup("MODULES", 0);
- rootmenu.prompt = menu_add_prop(P_MENU, "uClibc Configuration", NULL, NULL);
+ rootmenu.prompt = menu_add_prompt(P_MENU, "uClibc Configuration", NULL);
//zconfdebug = 1;
zconfparse();
diff --git a/extra/config/zconf.y b/extra/config/zconf.y
index 41ca0cc67..e1a0f455d 100644
--- a/extra/config/zconf.y
+++ b/extra/config/zconf.y
@@ -342,7 +342,7 @@ if_block:
menu: T_MENU prompt T_EOL
{
menu_add_entry(NULL);
- menu_add_prop(P_MENU, $2, NULL, NULL);
+ menu_add_prompt(P_MENU, $2, NULL);
printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
};
@@ -392,7 +392,7 @@ source_stmt: source
comment: T_COMMENT prompt T_EOL
{
menu_add_entry(NULL);
- menu_add_prop(P_COMMENT, $2, NULL, NULL);
+ menu_add_prompt(P_COMMENT, $2, NULL);
printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
};
@@ -443,7 +443,7 @@ prompt_stmt_opt:
/* empty */
| prompt if_expr
{
- menu_add_prop(P_PROMPT, $1, NULL, $2);
+ menu_add_prompt(P_PROMPT, $1, $2);
};
prompt: T_WORD
@@ -487,7 +487,7 @@ void conf_parse(const char *name)
sym_init();
menu_init();
modules_sym = sym_lookup("MODULES", 0);
- rootmenu.prompt = menu_add_prop(P_MENU, "uClibc Configuration", NULL, NULL);
+ rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
//zconfdebug = 1;
zconfparse();