Commit 0455029b authored by Michal Marek's avatar Michal Marek

Merge branch 'kbuild/kconfig/kbuild-generic-v7' of...

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
parents 8c41e5e3 838a2e55
...@@ -322,7 +322,8 @@ mainmenu: ...@@ -322,7 +322,8 @@ mainmenu:
"mainmenu" <prompt> "mainmenu" <prompt>
This sets the config program's title bar if the config program chooses This sets the config program's title bar if the config program chooses
to use it. to use it. It should be placed at the top of the configuration, before any
other statement.
Kconfig hints Kconfig hints
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/$ARCH $KERNELVERSION Kernel Configuration"
config SRCARCH
string
option env="SRCARCH"
source "arch/$SRCARCH/Kconfig"
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
config ALPHA config ALPHA
bool bool
default y default y
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux Kernel Configuration"
config ARM config ARM
bool bool
default y default y
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux Kernel Configuration"
config AVR32 config AVR32
def_bool y def_bool y
# With EMBEDDED=n, we get lots of stuff automatically selected # With EMBEDDED=n, we get lots of stuff automatically selected
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Blackfin Kernel Configuration"
config SYMBOL_PREFIX config SYMBOL_PREFIX
string string
default "_" default "_"
......
#
# For a description of the syntax of this configuration file,
# see the Configure script.
#
mainmenu "Linux/CRIS Kernel Configuration"
config MMU config MMU
bool bool
default y default y
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
config FRV config FRV
bool bool
default y default y
...@@ -64,8 +60,6 @@ config HZ ...@@ -64,8 +60,6 @@ config HZ
int int
default 1000 default 1000
mainmenu "Fujitsu FR-V Kernel Configuration"
source "init/Kconfig" source "init/Kconfig"
source "kernel/Kconfig.freezer" source "kernel/Kconfig.freezer"
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration"
config H8300 config H8300
bool bool
default y default y
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "IA-64 Linux Kernel Configuration"
source "init/Kconfig" source "init/Kconfig"
source "kernel/Kconfig.freezer" source "kernel/Kconfig.freezer"
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/M32R Kernel Configuration"
config M32R config M32R
bool bool
default y default y
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
config M68K config M68K
bool bool
default y default y
...@@ -65,8 +61,6 @@ config GENERIC_TIME ...@@ -65,8 +61,6 @@ config GENERIC_TIME
config ARCH_USES_GETTIMEOFFSET config ARCH_USES_GETTIMEOFFSET
def_bool y def_bool y
mainmenu "Linux/68k Kernel Configuration"
source "init/Kconfig" source "init/Kconfig"
source "kernel/Kconfig.freezer" source "kernel/Kconfig.freezer"
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "uClinux/68k (w/o MMU) Kernel Configuration"
config M68K config M68K
bool bool
default y default y
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
mainmenu "Linux/Microblaze Kernel Configuration"
config MICROBLAZE config MICROBLAZE
def_bool y def_bool y
select HAVE_MEMBLOCK select HAVE_MEMBLOCK
......
...@@ -12,8 +12,6 @@ config MIPS ...@@ -12,8 +12,6 @@ config MIPS
select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_GRAPH_TRACER
select RTC_LIB if !MACH_LOONGSON select RTC_LIB if !MACH_LOONGSON
mainmenu "Linux/MIPS Kernel Configuration"
menu "Machine selection" menu "Machine selection"
config ZONE_DMA config ZONE_DMA
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux Kernel Configuration"
config MN10300 config MN10300
def_bool y def_bool y
select HAVE_OPROFILE select HAVE_OPROFILE
...@@ -69,8 +62,6 @@ config HZ ...@@ -69,8 +62,6 @@ config HZ
int int
default 1000 default 1000
mainmenu "Matsushita MN10300/AM33 Kernel Configuration"
source "init/Kconfig" source "init/Kconfig"
source "kernel/Kconfig.freezer" source "kernel/Kconfig.freezer"
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/PA-RISC Kernel Configuration"
config PARISC config PARISC
def_bool y def_bool y
select HAVE_IDE select HAVE_IDE
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/PowerPC Kernel Configuration"
source "arch/powerpc/platforms/Kconfig.cputype" source "arch/powerpc/platforms/Kconfig.cputype"
config PPC32 config PPC32
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
config SCHED_MC config SCHED_MC
def_bool y def_bool y
depends on SMP depends on SMP
...@@ -78,8 +73,6 @@ config VIRT_CPU_ACCOUNTING ...@@ -78,8 +73,6 @@ config VIRT_CPU_ACCOUNTING
config ARCH_SUPPORTS_DEBUG_PAGEALLOC config ARCH_SUPPORTS_DEBUG_PAGEALLOC
def_bool y def_bool y
mainmenu "Linux Kernel Configuration"
config S390 config S390
def_bool y def_bool y
select USE_GENERIC_SMP_HELPERS if SMP select USE_GENERIC_SMP_HELPERS if SMP
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
mainmenu "Linux/SCORE Kernel Configuration"
menu "Machine selection" menu "Machine selection"
choice choice
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/SuperH Kernel Configuration"
config SUPERH config SUPERH
def_bool y def_bool y
select EMBEDDED select EMBEDDED
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/SPARC Kernel Configuration"
config 64BIT config 64BIT
bool "64-bit kernel" if ARCH = "sparc" bool "64-bit kernel" if ARCH = "sparc"
default ARCH = "sparc64" default ARCH = "sparc64"
......
...@@ -19,8 +19,6 @@ config MMU ...@@ -19,8 +19,6 @@ config MMU
config NO_IOMEM config NO_IOMEM
def_bool y def_bool y
mainmenu "Linux/Usermode Kernel Configuration"
config ISA config ISA
bool bool
......
# x86 configuration
mainmenu "Linux Kernel Configuration for x86"
# Select 32 or 64 bit # Select 32 or 64 bit
config 64BIT config 64BIT
bool "64-bit kernel" if ARCH = "x86" bool "64-bit kernel" if ARCH = "x86"
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
mainmenu "Linux/Xtensa Kernel Configuration"
config FRAME_POINTER config FRAME_POINTER
def_bool n def_bool n
......
...@@ -8,7 +8,7 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-c ...@@ -8,7 +8,7 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-c
ifdef KBUILD_KCONFIG ifdef KBUILD_KCONFIG
Kconfig := $(KBUILD_KCONFIG) Kconfig := $(KBUILD_KCONFIG)
else else
Kconfig := arch/$(SRCARCH)/Kconfig Kconfig := Kconfig
endif endif
xconfig: $(obj)/qconf xconfig: $(obj)/qconf
......
...@@ -425,7 +425,7 @@ static void check_conf(struct menu *menu) ...@@ -425,7 +425,7 @@ static void check_conf(struct menu *menu)
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
if (input_mode == listnewconfig) { if (input_mode == listnewconfig) {
if (sym->name && !sym_is_choice_value(sym)) { if (sym->name && !sym_is_choice_value(sym)) {
printf("CONFIG_%s\n", sym->name); printf("%s%s\n", CONFIG_, sym->name);
} }
} else if (input_mode != oldnoconfig) { } else if (input_mode != oldnoconfig) {
if (!conf_cnt++) if (!conf_cnt++)
...@@ -508,8 +508,7 @@ int main(int ac, char **av) ...@@ -508,8 +508,7 @@ int main(int ac, char **av)
name = conf_get_configname(); name = conf_get_configname();
if (stat(name, &tmpstat)) { if (stat(name, &tmpstat)) {
fprintf(stderr, _("***\n" fprintf(stderr, _("***\n"
"*** You have not yet configured your kernel!\n" "*** Configuration file \"%s\" not found!\n"
"*** (missing kernel config file \"%s\")\n"
"***\n" "***\n"
"*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
"*** \"make menuconfig\" or \"make xconfig\").\n" "*** \"make menuconfig\" or \"make xconfig\").\n"
...@@ -571,7 +570,7 @@ int main(int ac, char **av) ...@@ -571,7 +570,7 @@ int main(int ac, char **av)
name = getenv("KCONFIG_NOSILENTUPDATE"); name = getenv("KCONFIG_NOSILENTUPDATE");
if (name && *name) { if (name && *name) {
fprintf(stderr, fprintf(stderr,
_("\n*** Kernel configuration requires explicit update.\n\n")); _("\n*** The configuration requires explicit update.\n\n"));
return 1; return 1;
} }
} }
...@@ -623,11 +622,11 @@ int main(int ac, char **av) ...@@ -623,11 +622,11 @@ int main(int ac, char **av)
* All other commands are only used to generate a config. * All other commands are only used to generate a config.
*/ */
if (conf_get_changed() && conf_write(NULL)) { if (conf_get_changed() && conf_write(NULL)) {
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
exit(1); exit(1);
} }
if (conf_write_autoconf()) { if (conf_write_autoconf()) {
fprintf(stderr, _("\n*** Error during update of the kernel configuration.\n\n")); fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
return 1; return 1;
} }
} else if (input_mode == savedefconfig) { } else if (input_mode == savedefconfig) {
...@@ -638,7 +637,7 @@ int main(int ac, char **av) ...@@ -638,7 +637,7 @@ int main(int ac, char **av)
} }
} else if (input_mode != listnewconfig) { } else if (input_mode != listnewconfig) {
if (conf_write(NULL)) { if (conf_write(NULL)) {
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
exit(1); exit(1);
} }
} }
......
...@@ -221,24 +221,23 @@ int conf_read_simple(const char *name, int def) ...@@ -221,24 +221,23 @@ int conf_read_simple(const char *name, int def)
while (fgets(line, sizeof(line), in)) { while (fgets(line, sizeof(line), in)) {
conf_lineno++; conf_lineno++;
sym = NULL; sym = NULL;
switch (line[0]) { if (line[0] == '#') {
case '#': if (memcmp(line + 2, CONFIG_, strlen(CONFIG_)))
if (memcmp(line + 2, "CONFIG_", 7))
continue; continue;
p = strchr(line + 9, ' '); p = strchr(line + 2 + strlen(CONFIG_), ' ');
if (!p) if (!p)
continue; continue;
*p++ = 0; *p++ = 0;
if (strncmp(p, "is not set", 10)) if (strncmp(p, "is not set", 10))
continue; continue;
if (def == S_DEF_USER) { if (def == S_DEF_USER) {
sym = sym_find(line + 9); sym = sym_find(line + 2 + strlen(CONFIG_));
if (!sym) { if (!sym) {
sym_add_change_count(1); sym_add_change_count(1);
break; break;
} }
} else { } else {
sym = sym_lookup(line + 9, 0); sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
if (sym->type == S_UNKNOWN) if (sym->type == S_UNKNOWN)
sym->type = S_BOOLEAN; sym->type = S_BOOLEAN;
} }
...@@ -254,13 +253,8 @@ int conf_read_simple(const char *name, int def) ...@@ -254,13 +253,8 @@ int conf_read_simple(const char *name, int def)
default: default:
; ;
} }
break; } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) {
case 'C': p = strchr(line + strlen(CONFIG_), '=');
if (memcmp(line, "CONFIG_", 7)) {
conf_warning("unexpected data");
continue;
}
p = strchr(line + 7, '=');
if (!p) if (!p)
continue; continue;
*p++ = 0; *p++ = 0;
...@@ -271,13 +265,13 @@ int conf_read_simple(const char *name, int def) ...@@ -271,13 +265,13 @@ int conf_read_simple(const char *name, int def)
*p2 = 0; *p2 = 0;
} }
if (def == S_DEF_USER) { if (def == S_DEF_USER) {
sym = sym_find(line + 7); sym = sym_find(line + strlen(CONFIG_));
if (!sym) { if (!sym) {
sym_add_change_count(1); sym_add_change_count(1);
break; break;
} }
} else { } else {
sym = sym_lookup(line + 7, 0); sym = sym_lookup(line + strlen(CONFIG_), 0);
if (sym->type == S_UNKNOWN) if (sym->type == S_UNKNOWN)
sym->type = S_OTHER; sym->type = S_OTHER;
} }
...@@ -286,11 +280,8 @@ int conf_read_simple(const char *name, int def) ...@@ -286,11 +280,8 @@ int conf_read_simple(const char *name, int def)
} }
if (conf_set_sym_val(sym, def, def_flags, p)) if (conf_set_sym_val(sym, def, def_flags, p))
continue; continue;
break; } else {
case '\r': if (line[0] != '\r' && line[0] != '\n')
case '\n':
break;
default:
conf_warning("unexpected data"); conf_warning("unexpected data");
continue; continue;
} }
...@@ -406,9 +397,9 @@ static void conf_write_string(bool headerfile, const char *name, ...@@ -406,9 +397,9 @@ static void conf_write_string(bool headerfile, const char *name,
{ {
int l; int l;
if (headerfile) if (headerfile)
fprintf(out, "#define CONFIG_%s \"", name); fprintf(out, "#define %s%s \"", CONFIG_, name);
else else
fprintf(out, "CONFIG_%s=\"", name); fprintf(out, "%s%s=\"", CONFIG_, name);
while (1) { while (1) {
l = strcspn(str, "\"\\"); l = strcspn(str, "\"\\");
...@@ -434,13 +425,14 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type, ...@@ -434,13 +425,14 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type,
switch (sym_get_tristate_value(sym)) { switch (sym_get_tristate_value(sym)) {
case no: case no:
if (write_no) if (write_no)
fprintf(out, "# CONFIG_%s is not set\n", sym->name); fprintf(out, "# %s%s is not set\n",
CONFIG_, sym->name);
break; break;
case mod: case mod:
fprintf(out, "CONFIG_%s=m\n", sym->name); fprintf(out, "%s%s=m\n", CONFIG_, sym->name);
break; break;
case yes: case yes:
fprintf(out, "CONFIG_%s=y\n", sym->name); fprintf(out, "%s%s=y\n", CONFIG_, sym->name);
break; break;
} }
break; break;
...@@ -450,7 +442,7 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type, ...@@ -450,7 +442,7 @@ static void conf_write_symbol(struct symbol *sym, enum symbol_type type,
case S_HEX: case S_HEX:
case S_INT: case S_INT:
str = sym_get_string_value(sym); str = sym_get_string_value(sym);
fprintf(out, "CONFIG_%s=%s\n", sym->name, str); fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str);
break; break;
case S_OTHER: case S_OTHER:
case S_UNKNOWN: case S_UNKNOWN:
...@@ -582,8 +574,6 @@ int conf_write(const char *name) ...@@ -582,8 +574,6 @@ int conf_write(const char *name)
if (!out) if (!out)
return 1; return 1;
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
time(&now); time(&now);
env = getenv("KCONFIG_NOTIMESTAMP"); env = getenv("KCONFIG_NOTIMESTAMP");
if (env && *env) if (env && *env)
...@@ -591,10 +581,10 @@ int conf_write(const char *name) ...@@ -591,10 +581,10 @@ int conf_write(const char *name)
fprintf(out, _("#\n" fprintf(out, _("#\n"
"# Automatically generated make config: don't edit\n" "# Automatically generated make config: don't edit\n"
"# Linux kernel version: %s\n" "# %s\n"
"%s%s" "%s%s"
"#\n"), "#\n"),
sym_get_string_value(sym), rootmenu.prompt->text,
use_timestamp ? "# " : "", use_timestamp ? "# " : "",
use_timestamp ? ctime(&now) : ""); use_timestamp ? ctime(&now) : "");
...@@ -805,25 +795,23 @@ int conf_write_autoconf(void) ...@@ -805,25 +795,23 @@ int conf_write_autoconf(void)
return 1; return 1;
} }
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
time(&now); time(&now);
fprintf(out, "#\n" fprintf(out, "#\n"
"# Automatically generated make config: don't edit\n" "# Automatically generated make config: don't edit\n"
"# Linux kernel version: %s\n" "# %s\n"
"# %s" "# %s"
"#\n", "#\n",
sym_get_string_value(sym), ctime(&now)); rootmenu.prompt->text, ctime(&now));
fprintf(tristate, "#\n" fprintf(tristate, "#\n"
"# Automatically generated - do not edit\n" "# Automatically generated - do not edit\n"
"\n"); "\n");
fprintf(out_h, "/*\n" fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n" " * Automatically generated C config: don't edit\n"
" * Linux kernel version: %s\n" " * %s\n"
" * %s" " * %s"
" */\n" " */\n"
"#define AUTOCONF_INCLUDED\n", "#define AUTOCONF_INCLUDED\n",
sym_get_string_value(sym), ctime(&now)); rootmenu.prompt->text, ctime(&now));
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
sym_calc_value(sym); sym_calc_value(sym);
...@@ -841,14 +829,17 @@ int conf_write_autoconf(void) ...@@ -841,14 +829,17 @@ int conf_write_autoconf(void)
case no: case no:
break; break;
case mod: case mod:
fprintf(tristate, "CONFIG_%s=M\n", sym->name); fprintf(tristate, "%s%s=M\n",
fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); CONFIG_, sym->name);
fprintf(out_h, "#define %s%s_MODULE 1\n",
CONFIG_, sym->name);
break; break;
case yes: case yes:
if (sym->type == S_TRISTATE) if (sym->type == S_TRISTATE)
fprintf(tristate, "CONFIG_%s=Y\n", fprintf(tristate,"%s%s=Y\n",
sym->name); CONFIG_, sym->name);
fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); fprintf(out_h, "#define %s%s 1\n",
CONFIG_, sym->name);
break; break;
} }
break; break;
...@@ -858,12 +849,14 @@ int conf_write_autoconf(void) ...@@ -858,12 +849,14 @@ int conf_write_autoconf(void)
case S_HEX: case S_HEX:
str = sym_get_string_value(sym); str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); fprintf(out_h, "#define %s%s 0x%s\n",
CONFIG_, sym->name, str);
break; break;
} }
case S_INT: case S_INT:
str = sym_get_string_value(sym); str = sym_get_string_value(sym);
fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); fprintf(out_h, "#define %s%s %s\n",
CONFIG_, sym->name, str);
break; break;
default: default:
break; break;
......
...@@ -18,7 +18,7 @@ extern "C" { ...@@ -18,7 +18,7 @@ extern "C" {
struct file { struct file {
struct file *next; struct file *next;
struct file *parent; struct file *parent;
char *name; const char *name;
int lineno; int lineno;
int flags; int flags;
}; };
......
...@@ -133,7 +133,6 @@ void init_main_window(const gchar * glade_file) ...@@ -133,7 +133,6 @@ void init_main_window(const gchar * glade_file)
GladeXML *xml; GladeXML *xml;
GtkWidget *widget; GtkWidget *widget;
GtkTextBuffer *txtbuf; GtkTextBuffer *txtbuf;
char title[256];
GtkStyle *style; GtkStyle *style;
xml = glade_xml_new(glade_file, "window1", NULL); xml = glade_xml_new(glade_file, "window1", NULL);
...@@ -210,9 +209,7 @@ void init_main_window(const gchar * glade_file) ...@@ -210,9 +209,7 @@ void init_main_window(const gchar * glade_file)
/*"style", PANGO_STYLE_OBLIQUE, */ /*"style", PANGO_STYLE_OBLIQUE, */
NULL); NULL);
sprintf(title, _("Linux Kernel v%s Configuration"), gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text);
getenv("KERNELVERSION"));
gtk_window_set_title(GTK_WINDOW(main_wnd), title);
gtk_widget_show(main_wnd); gtk_widget_show(main_wnd);
} }
...@@ -671,8 +668,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) ...@@ -671,8 +668,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
{ {
GtkWidget *dialog; GtkWidget *dialog;
const gchar *intro_text = _( const gchar *intro_text = _(
"Welcome to gkc, the GTK+ graphical kernel configuration tool\n" "Welcome to gkc, the GTK+ graphical configuration tool\n"
"for Linux.\n"
"For each option, a blank box indicates the feature is disabled, a\n" "For each option, a blank box indicates the feature is disabled, a\n"
"check indicates it is enabled, and a dot indicates that it is to\n" "check indicates it is enabled, and a dot indicates that it is to\n"
"be compiled as a module. Clicking on the box will cycle through the three states.\n" "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[]) ...@@ -1531,12 +1527,6 @@ int main(int ac, char *av[])
else else
glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL);
/* Load the interface and connect signals */
init_main_window(glade_file);
init_tree_model();
init_left_tree();
init_right_tree();
/* Conf stuffs */ /* Conf stuffs */
if (ac > 1 && av[1][0] == '-') { if (ac > 1 && av[1][0] == '-') {
switch (av[1][1]) { switch (av[1][1]) {
...@@ -1556,6 +1546,12 @@ int main(int ac, char *av[]) ...@@ -1556,6 +1546,12 @@ int main(int ac, char *av[])
fixup_rootmenu(&rootmenu); fixup_rootmenu(&rootmenu);
conf_read(NULL); conf_read(NULL);
/* Load the interface and connect signals */
init_main_window(glade_file);
init_tree_model();
init_left_tree();
init_right_tree();
switch (view_mode) { switch (view_mode) {
case SINGLE_VIEW: case SINGLE_VIEW:
display_tree_part(); display_tree_part();
......
...@@ -2373,9 +2373,10 @@ void zconf_nextfile(const char *name) ...@@ -2373,9 +2373,10 @@ void zconf_nextfile(const char *name)
memset(buf, 0, sizeof(*buf)); memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER; current_buf->state = YY_CURRENT_BUFFER;
zconfin = zconf_fopen(name); zconfin = zconf_fopen(file->name);
if (!zconfin) { if (!zconfin) {
printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name); printf("%s:%d: can't open file \"%s\"\n",
zconf_curname(), zconf_lineno(), file->name);
exit(1); exit(1);
} }
zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE)); zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
...@@ -2422,7 +2423,7 @@ int zconf_lineno(void) ...@@ -2422,7 +2423,7 @@ int zconf_lineno(void)
return current_pos.lineno; return current_pos.lineno;
} }
char *zconf_curname(void) const char *zconf_curname(void)
{ {
return current_pos.file ? current_pos.file->name : "<none>"; return current_pos.file ? current_pos.file->name : "<none>";
} }
......
...@@ -31,12 +31,18 @@ extern "C" { ...@@ -31,12 +31,18 @@ extern "C" {
#define SRCTREE "srctree" #define SRCTREE "srctree"
#ifndef PACKAGE
#define PACKAGE "linux" #define PACKAGE "linux"
#endif
#define LOCALEDIR "/usr/share/locale" #define LOCALEDIR "/usr/share/locale"
#define _(text) gettext(text) #define _(text) gettext(text)
#define N_(text) (text) #define N_(text) (text)
#ifndef CONFIG_
#define CONFIG_ "CONFIG_"
#endif
#define TF_COMMAND 0x0001 #define TF_COMMAND 0x0001
#define TF_PARAM 0x0002 #define TF_PARAM 0x0002
...@@ -70,7 +76,7 @@ FILE *zconf_fopen(const char *name); ...@@ -70,7 +76,7 @@ FILE *zconf_fopen(const char *name);
void zconf_initscan(const char *name); void zconf_initscan(const char *name);
void zconf_nextfile(const char *name); void zconf_nextfile(const char *name);
int zconf_lineno(void); int zconf_lineno(void);
char *zconf_curname(void); const char *zconf_curname(void);
/* conf.c */ /* conf.c */
void xfgets(char *str, int size, FILE *in); void xfgets(char *str, int size, FILE *in);
......
...@@ -28,6 +28,7 @@ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); ...@@ -28,6 +28,7 @@ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
P(sym_lookup,struct symbol *,(const char *name, int flags)); P(sym_lookup,struct symbol *,(const char *name, int flags));
P(sym_find,struct symbol *,(const char *name)); P(sym_find,struct symbol *,(const char *name));
P(sym_expand_string_value,const char *,(const char *in));
P(sym_re_search,struct symbol **,(const char *pattern)); P(sym_re_search,struct symbol **,(const char *pattern));
P(sym_type_name,const char *,(enum symbol_type type)); P(sym_type_name,const char *,(enum symbol_type type));
P(sym_calc_value,void,(struct symbol *sym)); P(sym_calc_value,void,(struct symbol *sym));
......
...@@ -25,11 +25,9 @@ ...@@ -25,11 +25,9 @@
static const char mconf_readme[] = N_( static const char mconf_readme[] = N_(
"Overview\n" "Overview\n"
"--------\n" "--------\n"
"Some kernel features may be built directly into the kernel.\n" "This interface let you select features and parameters for the build.\n"
"Some may be made into loadable runtime modules. Some features\n" "Features can either be built-in, modularized, or ignored. Parameters\n"
"may be completely removed altogether. There are also certain\n" "must be entered in as decimal or hexadecimal numbers or text.\n"
"kernel parameters which are not really features, but must be\n"
"entered in as decimal or hexadecimal numbers or possibly text.\n"
"\n" "\n"
"Menu items beginning with following braces represent features that\n" "Menu items beginning with following braces represent features that\n"
" [ ] can be built in or removed\n" " [ ] can be built in or removed\n"
...@@ -117,7 +115,7 @@ static const char mconf_readme[] = N_( ...@@ -117,7 +115,7 @@ static const char mconf_readme[] = N_(
"-----------------------------\n" "-----------------------------\n"
"Menuconfig supports the use of alternate configuration files for\n" "Menuconfig supports the use of alternate configuration files for\n"
"those who, for various reasons, find it necessary to switch\n" "those who, for various reasons, find it necessary to switch\n"
"between different kernel configurations.\n" "between different configurations.\n"
"\n" "\n"
"At the end of the main menu you will find two options. One is\n" "At the end of the main menu you will find two options. One is\n"
"for saving the current configuration to a file of your choosing.\n" "for saving the current configuration to a file of your choosing.\n"
...@@ -150,9 +148,9 @@ static const char mconf_readme[] = N_( ...@@ -150,9 +148,9 @@ static const char mconf_readme[] = N_(
"\n" "\n"
"Optional personality available\n" "Optional personality available\n"
"------------------------------\n" "------------------------------\n"
"If you prefer to have all of the kernel options listed in a single\n" "If you prefer to have all of the options listed in a single menu, rather\n"
"menu, rather than the default multimenu hierarchy, run the menuconfig\n" "than the default multimenu hierarchy, run the menuconfig with\n"
"with MENUCONFIG_MODE environment variable set to single_menu. Example:\n" "MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
"\n" "\n"
"make MENUCONFIG_MODE=single_menu menuconfig\n" "make MENUCONFIG_MODE=single_menu menuconfig\n"
"\n" "\n"
...@@ -207,12 +205,12 @@ load_config_text[] = N_( ...@@ -207,12 +205,12 @@ load_config_text[] = N_(
"last retrieved. Leave blank to abort."), "last retrieved. Leave blank to abort."),
load_config_help[] = N_( load_config_help[] = N_(
"\n" "\n"
"For various reasons, one may wish to keep several different kernel\n" "For various reasons, one may wish to keep several different\n"
"configurations available on a single machine.\n" "configurations available on a single machine.\n"
"\n" "\n"
"If you have saved a previous configuration in a file other than the\n" "If you have saved a previous configuration in a file other than the\n"
"kernel's default, entering the name of the file here will allow you\n" "default one, entering its name here will allow you to modify that\n"
"to modify that configuration.\n" "configuration.\n"
"\n" "\n"
"If you are uncertain, then you have probably never used alternate\n" "If you are uncertain, then you have probably never used alternate\n"
"configuration files. You should therefore leave this blank to abort.\n"), "configuration files. You should therefore leave this blank to abort.\n"),
...@@ -221,8 +219,8 @@ save_config_text[] = N_( ...@@ -221,8 +219,8 @@ save_config_text[] = N_(
"as an alternate. Leave blank to abort."), "as an alternate. Leave blank to abort."),
save_config_help[] = N_( save_config_help[] = N_(
"\n" "\n"
"For various reasons, one may wish to keep different kernel\n" "For various reasons, one may wish to keep different configurations\n"
"configurations available on a single machine.\n" "available on a single machine.\n"
"\n" "\n"
"Entering a file name here will allow you to later retrieve, modify\n" "Entering a file name here will allow you to later retrieve, modify\n"
"and use the current configuration as an alternate to whatever\n" "and use the current configuration as an alternate to whatever\n"
...@@ -232,7 +230,7 @@ save_config_help[] = N_( ...@@ -232,7 +230,7 @@ save_config_help[] = N_(
"leave this blank.\n"), "leave this blank.\n"),
search_help[] = N_( search_help[] = N_(
"\n" "\n"
"Search for CONFIG_ symbols and display their relations.\n" "Search for symbols and display their relations.\n"
"Regular expressions are allowed.\n" "Regular expressions are allowed.\n"
"Example: search for \"^FOO\"\n" "Example: search for \"^FOO\"\n"
"Result:\n" "Result:\n"
...@@ -249,7 +247,7 @@ search_help[] = N_( ...@@ -249,7 +247,7 @@ search_help[] = N_(
"Selected by: BAR\n" "Selected by: BAR\n"
"-----------------------------------------------------------------\n" "-----------------------------------------------------------------\n"
"o The line 'Prompt:' shows the text used in the menu structure for\n" "o The line 'Prompt:' shows the text used in the menu structure for\n"
" this CONFIG_ symbol\n" " this symbol\n"
"o The 'Defined at' line tell at what file / line number the symbol\n" "o The 'Defined at' line tell at what file / line number the symbol\n"
" is defined\n" " is defined\n"
"o The 'Depends on:' line tell what symbols needs to be defined for\n" "o The 'Depends on:' line tell what symbols needs to be defined for\n"
...@@ -265,9 +263,9 @@ search_help[] = N_( ...@@ -265,9 +263,9 @@ search_help[] = N_(
"Only relevant lines are shown.\n" "Only relevant lines are shown.\n"
"\n\n" "\n\n"
"Search examples:\n" "Search examples:\n"
"Examples: USB => find all CONFIG_ symbols containing USB\n" "Examples: USB => find all symbols containing USB\n"
" ^USB => find all CONFIG_ symbols starting with USB\n" " ^USB => find all symbols starting with USB\n"
" USB$ => find all CONFIG_ symbols ending with USB\n" " USB$ => find all symbols ending with USB\n"
"\n"); "\n");
static int indent; static int indent;
...@@ -290,13 +288,9 @@ static void set_config_filename(const char *config_filename) ...@@ -290,13 +288,9 @@ static void set_config_filename(const char *config_filename)
{ {
static char menu_backtitle[PATH_MAX+128]; static char menu_backtitle[PATH_MAX+128];
int size; int size;
struct symbol *sym;
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
size = snprintf(menu_backtitle, sizeof(menu_backtitle), size = snprintf(menu_backtitle, sizeof(menu_backtitle),
_("%s - Linux Kernel v%s Configuration"), "%s - %s", config_filename, rootmenu.prompt->text);
config_filename, sym_get_string_value(sym));
if (size >= sizeof(menu_backtitle)) if (size >= sizeof(menu_backtitle))
menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
set_dialog_backtitle(menu_backtitle); set_dialog_backtitle(menu_backtitle);
...@@ -316,8 +310,8 @@ static void search_conf(void) ...@@ -316,8 +310,8 @@ static void search_conf(void)
again: again:
dialog_clear(); dialog_clear();
dres = dialog_inputbox(_("Search Configuration Parameter"), dres = dialog_inputbox(_("Search Configuration Parameter"),
_("Enter CONFIG_ (sub)string to search for " _("Enter " CONFIG_ " (sub)string to search for "
"(with or without \"CONFIG\")"), "(with or without \"" CONFIG_ "\")"),
10, 75, ""); 10, 75, "");
switch (dres) { switch (dres) {
case 0: case 0:
...@@ -329,10 +323,10 @@ static void search_conf(void) ...@@ -329,10 +323,10 @@ static void search_conf(void)
return; return;
} }
/* strip CONFIG_ if necessary */ /* strip the prefix if necessary */
dialog_input = dialog_input_result; dialog_input = dialog_input_result;
if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
dialog_input += 7; dialog_input += strlen(CONFIG_);
sym_arr = sym_re_search(dialog_input); sym_arr = sym_re_search(dialog_input);
res = get_relations_str(sym_arr); res = get_relations_str(sym_arr);
...@@ -834,7 +828,7 @@ int main(int ac, char **av) ...@@ -834,7 +828,7 @@ int main(int ac, char **av)
if (conf_get_changed()) if (conf_get_changed())
res = dialog_yesno(NULL, res = dialog_yesno(NULL,
_("Do you wish to save your " _("Do you wish to save your "
"new kernel configuration?\n" "new configuration?\n"
"<ESC><ESC> to continue."), "<ESC><ESC> to continue."),
6, 60); 6, 60);
else else
...@@ -846,20 +840,20 @@ int main(int ac, char **av) ...@@ -846,20 +840,20 @@ int main(int ac, char **av)
case 0: case 0:
if (conf_write(filename)) { if (conf_write(filename)) {
fprintf(stderr, _("\n\n" fprintf(stderr, _("\n\n"
"Error during writing of the kernel configuration.\n" "Error while writing of the configuration.\n"
"Your kernel configuration changes were NOT saved." "Your configuration changes were NOT saved."
"\n\n")); "\n\n"));
return 1; return 1;
} }
case -1: case -1:
printf(_("\n\n" printf(_("\n\n"
"*** End of Linux kernel configuration.\n" "*** End of the configuration.\n"
"*** Execute 'make' to build the kernel or try 'make help'." "*** Execute 'make' to start the build or try 'make help'."
"\n\n")); "\n\n"));
break; break;
default: default:
fprintf(stderr, _("\n\n" fprintf(stderr, _("\n\n"
"Your kernel configuration changes were NOT saved." "Your configuration changes were NOT saved."
"\n\n")); "\n\n"));
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "lkc.h" #include "lkc.h"
static const char nohelp_text[] = N_( static const char nohelp_text[] = N_(
"There is no help available for this kernel option.\n"); "There is no help available for this option.\n");
struct menu rootmenu; struct menu rootmenu;
static struct menu **last_entry_ptr; static struct menu **last_entry_ptr;
...@@ -139,7 +139,7 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e ...@@ -139,7 +139,7 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
while (isspace(*prompt)) while (isspace(*prompt))
prompt++; prompt++;
} }
if (current_entry->prompt) if (current_entry->prompt && current_entry != &rootmenu)
prop_warn(prop, "prompt redefined"); prop_warn(prop, "prompt redefined");
current_entry->prompt = prop; current_entry->prompt = prop;
} }
...@@ -566,7 +566,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) ...@@ -566,7 +566,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help)
if (menu_has_help(menu)) { if (menu_has_help(menu)) {
if (sym->name) { if (sym->name) {
str_printf(help, "CONFIG_%s:\n\n", sym->name); str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
str_append(help, _(menu_get_help(menu))); str_append(help, _(menu_get_help(menu)));
str_append(help, "\n"); str_append(help, "\n");
} }
......
...@@ -15,11 +15,9 @@ ...@@ -15,11 +15,9 @@
static const char nconf_readme[] = N_( static const char nconf_readme[] = N_(
"Overview\n" "Overview\n"
"--------\n" "--------\n"
"Some kernel features may be built directly into the kernel.\n" "This interface let you select features and parameters for the build.\n"
"Some may be made into loadable runtime modules. Some features\n" "Features can either be built-in, modularized, or ignored. Parameters\n"
"may be completely removed altogether. There are also certain\n" "must be entered in as decimal or hexadecimal numbers or text.\n"
"kernel parameters which are not really features, but must be\n"
"entered in as decimal or hexadecimal numbers or possibly text.\n"
"\n" "\n"
"Menu items beginning with following braces represent features that\n" "Menu items beginning with following braces represent features that\n"
" [ ] can be built in or removed\n" " [ ] can be built in or removed\n"
...@@ -95,7 +93,7 @@ static const char nconf_readme[] = N_( ...@@ -95,7 +93,7 @@ static const char nconf_readme[] = N_(
"-----------------------------\n" "-----------------------------\n"
"nconfig supports the use of alternate configuration files for\n" "nconfig supports the use of alternate configuration files for\n"
"those who, for various reasons, find it necessary to switch\n" "those who, for various reasons, find it necessary to switch\n"
"between different kernel configurations.\n" "between different configurations.\n"
"\n" "\n"
"At the end of the main menu you will find two options. One is\n" "At the end of the main menu you will find two options. One is\n"
"for saving the current configuration to a file of your choosing.\n" "for saving the current configuration to a file of your choosing.\n"
...@@ -128,9 +126,9 @@ static const char nconf_readme[] = N_( ...@@ -128,9 +126,9 @@ static const char nconf_readme[] = N_(
"\n" "\n"
"Optional personality available\n" "Optional personality available\n"
"------------------------------\n" "------------------------------\n"
"If you prefer to have all of the kernel options listed in a single\n" "If you prefer to have all of the options listed in a single menu, rather\n"
"menu, rather than the default multimenu hierarchy, run the nconfig\n" "than the default multimenu hierarchy, run the nconfig with NCONFIG_MODE\n"
"with NCONFIG_MODE environment variable set to single_menu. Example:\n" "environment variable set to single_menu. Example:\n"
"\n" "\n"
"make NCONFIG_MODE=single_menu nconfig\n" "make NCONFIG_MODE=single_menu nconfig\n"
"\n" "\n"
...@@ -185,19 +183,19 @@ setmod_text[] = N_( ...@@ -185,19 +183,19 @@ setmod_text[] = N_(
"has been configured as a module.\n" "has been configured as a module.\n"
"As a result, this feature will be built as a module."), "As a result, this feature will be built as a module."),
nohelp_text[] = N_( nohelp_text[] = N_(
"There is no help available for this kernel option.\n"), "There is no help available for this option.\n"),
load_config_text[] = N_( load_config_text[] = N_(
"Enter the name of the configuration file you wish to load.\n" "Enter the name of the configuration file you wish to load.\n"
"Accept the name shown to restore the configuration you\n" "Accept the name shown to restore the configuration you\n"
"last retrieved. Leave blank to abort."), "last retrieved. Leave blank to abort."),
load_config_help[] = N_( load_config_help[] = N_(
"\n" "\n"
"For various reasons, one may wish to keep several different kernel\n" "For various reasons, one may wish to keep several different\n"
"configurations available on a single machine.\n" "configurations available on a single machine.\n"
"\n" "\n"
"If you have saved a previous configuration in a file other than the\n" "If you have saved a previous configuration in a file other than the\n"
"kernel's default, entering the name of the file here will allow you\n" "default one, entering its name here will allow you to modify that\n"
"to modify that configuration.\n" "configuration.\n"
"\n" "\n"
"If you are uncertain, then you have probably never used alternate\n" "If you are uncertain, then you have probably never used alternate\n"
"configuration files. You should therefor leave this blank to abort.\n"), "configuration files. You should therefor leave this blank to abort.\n"),
...@@ -206,8 +204,8 @@ save_config_text[] = N_( ...@@ -206,8 +204,8 @@ save_config_text[] = N_(
"as an alternate. Leave blank to abort."), "as an alternate. Leave blank to abort."),
save_config_help[] = N_( save_config_help[] = N_(
"\n" "\n"
"For various reasons, one may wish to keep different kernel\n" "For various reasons, one may wish to keep different configurations\n"
"configurations available on a single machine.\n" "available on a single machine.\n"
"\n" "\n"
"Entering a file name here will allow you to later retrieve, modify\n" "Entering a file name here will allow you to later retrieve, modify\n"
"and use the current configuration as an alternate to whatever\n" "and use the current configuration as an alternate to whatever\n"
...@@ -217,8 +215,8 @@ save_config_help[] = N_( ...@@ -217,8 +215,8 @@ save_config_help[] = N_(
"leave this blank.\n"), "leave this blank.\n"),
search_help[] = N_( search_help[] = N_(
"\n" "\n"
"Search for CONFIG_ symbols and display their relations.\n" "Search for symbols and display their relations. Regular expressions\n"
"Regular expressions are allowed.\n" "are allowed.\n"
"Example: search for \"^FOO\"\n" "Example: search for \"^FOO\"\n"
"Result:\n" "Result:\n"
"-----------------------------------------------------------------\n" "-----------------------------------------------------------------\n"
...@@ -234,7 +232,7 @@ search_help[] = N_( ...@@ -234,7 +232,7 @@ search_help[] = N_(
"Selected by: BAR\n" "Selected by: BAR\n"
"-----------------------------------------------------------------\n" "-----------------------------------------------------------------\n"
"o The line 'Prompt:' shows the text used in the menu structure for\n" "o The line 'Prompt:' shows the text used in the menu structure for\n"
" this CONFIG_ symbol\n" " this symbol\n"
"o The 'Defined at' line tell at what file / line number the symbol\n" "o The 'Defined at' line tell at what file / line number the symbol\n"
" is defined\n" " is defined\n"
"o The 'Depends on:' line tell what symbols needs to be defined for\n" "o The 'Depends on:' line tell what symbols needs to be defined for\n"
...@@ -250,9 +248,9 @@ search_help[] = N_( ...@@ -250,9 +248,9 @@ search_help[] = N_(
"Only relevant lines are shown.\n" "Only relevant lines are shown.\n"
"\n\n" "\n\n"
"Search examples:\n" "Search examples:\n"
"Examples: USB = > find all CONFIG_ symbols containing USB\n" "Examples: USB = > find all symbols containing USB\n"
" ^USB => find all CONFIG_ symbols starting with USB\n" " ^USB => find all symbols starting with USB\n"
" USB$ => find all CONFIG_ symbols ending with USB\n" " USB$ => find all symbols ending with USB\n"
"\n"); "\n");
struct mitem { struct mitem {
...@@ -635,13 +633,9 @@ static char menu_backtitle[PATH_MAX+128]; ...@@ -635,13 +633,9 @@ static char menu_backtitle[PATH_MAX+128];
static const char *set_config_filename(const char *config_filename) static const char *set_config_filename(const char *config_filename)
{ {
int size; int size;
struct symbol *sym;
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
size = snprintf(menu_backtitle, sizeof(menu_backtitle), size = snprintf(menu_backtitle, sizeof(menu_backtitle),
_("%s - Linux Kernel v%s Configuration"), "%s - %s", config_filename, rootmenu.prompt->text);
config_filename, sym_get_string_value(sym));
if (size >= sizeof(menu_backtitle)) if (size >= sizeof(menu_backtitle))
menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
...@@ -681,8 +675,7 @@ static int do_exit(void) ...@@ -681,8 +675,7 @@ static int do_exit(void)
return 0; return 0;
} }
res = btn_dialog(main_window, res = btn_dialog(main_window,
_("Do you wish to save your " _("Do you wish to save your new configuration?\n"
"new kernel configuration?\n"
"<ESC> to cancel and resume nconfig."), "<ESC> to cancel and resume nconfig."),
2, 2,
" <save> ", " <save> ",
...@@ -701,18 +694,16 @@ static int do_exit(void) ...@@ -701,18 +694,16 @@ static int do_exit(void)
if (res) if (res)
btn_dialog( btn_dialog(
main_window, main_window,
_("Error during writing of the kernel " _("Error during writing of configuration.\n"
"configuration.\n" "Your configuration changes were NOT saved."),
"Your kernel configuration "
"changes were NOT saved."),
1, 1,
"<OK>"); "<OK>");
else { else {
char buf[1024]; char buf[1024];
snprintf(buf, 1024, snprintf(buf, 1024,
_("Configuration written to %s\n" _("Configuration written to %s\n"
"End of Linux kernel configuration.\n" "End of the configuration.\n"
"Execute 'make' to build the kernel or try" "Execute 'make' to start the build or try"
" 'make help'."), filename); " 'make help'."), filename);
btn_dialog( btn_dialog(
main_window, main_window,
...@@ -724,7 +715,7 @@ static int do_exit(void) ...@@ -724,7 +715,7 @@ static int do_exit(void)
default: default:
btn_dialog( btn_dialog(
main_window, main_window,
_("Your kernel configuration changes were NOT saved."), _("Your configuration changes were NOT saved."),
1, 1,
"<OK>"); "<OK>");
break; break;
...@@ -744,8 +735,8 @@ static void search_conf(void) ...@@ -744,8 +735,8 @@ static void search_conf(void)
again: again:
dres = dialog_inputbox(main_window, dres = dialog_inputbox(main_window,
_("Search Configuration Parameter"), _("Search Configuration Parameter"),
_("Enter CONFIG_ (sub)string to search for " _("Enter " CONFIG_ " (sub)string to search for "
"(with or without \"CONFIG\")"), "(with or without \"" CONFIG_ "\")"),
"", dialog_input_result, 99); "", dialog_input_result, 99);
switch (dres) { switch (dres) {
case 0: case 0:
...@@ -758,10 +749,10 @@ static void search_conf(void) ...@@ -758,10 +749,10 @@ static void search_conf(void)
return; return;
} }
/* strip CONFIG_ if necessary */ /* strip the prefix if necessary */
dialog_input = dialog_input_result; dialog_input = dialog_input_result;
if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
dialog_input += 7; dialog_input += strlen(CONFIG_);
sym_arr = sym_re_search(dialog_input); sym_arr = sym_re_search(dialog_input);
res = get_relations_str(sym_arr); res = get_relations_str(sym_arr);
...@@ -1261,7 +1252,7 @@ static void show_help(struct menu *menu) ...@@ -1261,7 +1252,7 @@ static void show_help(struct menu *menu)
if (menu && menu->sym && menu_has_help(menu)) { if (menu && menu->sym && menu_has_help(menu)) {
if (menu->sym->name) { if (menu->sym->name) {
str_printf(&help, "CONFIG_%s:\n\n", menu->sym->name); str_printf(&help, "%s%s:\n\n", CONFIG_, menu->sym->name);
str_append(&help, _(menu_get_help(menu))); str_append(&help, _(menu_get_help(menu)));
str_append(&help, "\n"); str_append(&help, "\n");
get_symbol_str(&help, menu->sym); get_symbol_str(&help, menu->sym);
......
...@@ -1274,8 +1274,8 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1274,8 +1274,8 @@ ConfigMainWindow::ConfigMainWindow(void)
char title[256]; char title[256];
QDesktopWidget *d = configApp->desktop(); QDesktopWidget *d = configApp->desktop();
snprintf(title, sizeof(title), _("Linux Kernel v%s Configuration%s"), snprintf(title, sizeof(title), "%s%s",
getenv("KERNELVERSION"), rootmenu.prompt->text,
#if QT_VERSION < 0x040000 #if QT_VERSION < 0x040000
" (Qt3)" " (Qt3)"
#else #else
...@@ -1655,7 +1655,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) ...@@ -1655,7 +1655,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
void ConfigMainWindow::showIntro(void) void ConfigMainWindow::showIntro(void)
{ {
static const QString str = _("Welcome to the qconf graphical kernel configuration tool for Linux.\n\n" static const QString str = _("Welcome to the qconf graphical configuration tool.\n\n"
"For each option, a blank box indicates the feature is disabled, a check\n" "For each option, a blank box indicates the feature is disabled, a check\n"
"indicates it is enabled, and a dot indicates that it is to be compiled\n" "indicates it is enabled, and a dot indicates that it is to be compiled\n"
"as a module. Clicking on the box will cycle through the three states.\n\n" "as a module. Clicking on the box will cycle through the three states.\n\n"
......
...@@ -840,6 +840,55 @@ struct symbol *sym_find(const char *name) ...@@ -840,6 +840,55 @@ struct symbol *sym_find(const char *name)
return symbol; return symbol;
} }
/*
* Expand symbol's names embedded in the string given in argument. Symbols'
* name to be expanded shall be prefixed by a '$'. Unknown symbol expands to
* the empty string.
*/
const char *sym_expand_string_value(const char *in)
{
const char *src;
char *res;
size_t reslen;
reslen = strlen(in) + 1;
res = malloc(reslen);
res[0] = '\0';
while ((src = strchr(in, '$'))) {
char *p, name[SYMBOL_MAXLENGTH];
const char *symval = "";
struct symbol *sym;
size_t newlen;
strncat(res, in, src - in);
src++;
p = name;
while (isalnum(*src) || *src == '_')
*p++ = *src++;
*p = '\0';
sym = sym_find(name);
if (sym != NULL) {
sym_calc_value(sym);
symval = sym_get_string_value(sym);
}
newlen = strlen(res) + strlen(symval) + strlen(src);
if (newlen > reslen) {
reslen = newlen;
realloc(res, reslen);
}
strcat(res, symval);
in = src;
}
strcat(res, in);
return res;
}
struct symbol **sym_re_search(const char *pattern) struct symbol **sym_re_search(const char *pattern)
{ {
struct symbol *sym, **sym_arr = NULL; struct symbol *sym, **sym_arr = NULL;
......
...@@ -12,15 +12,18 @@ ...@@ -12,15 +12,18 @@
struct file *file_lookup(const char *name) struct file *file_lookup(const char *name)
{ {
struct file *file; struct file *file;
const char *file_name = sym_expand_string_value(name);
for (file = file_list; file; file = file->next) { for (file = file_list; file; file = file->next) {
if (!strcmp(name, file->name)) if (!strcmp(name, file->name)) {
free((void *)file_name);
return file; return file;
} }
}
file = malloc(sizeof(*file)); file = malloc(sizeof(*file));
memset(file, 0, sizeof(*file)); memset(file, 0, sizeof(*file));
file->name = strdup(name); file->name = file_name;
file->next = file_list; file->next = file_list;
file_list = file; file_list = file;
return file; return file;
......
...@@ -304,9 +304,10 @@ void zconf_nextfile(const char *name) ...@@ -304,9 +304,10 @@ void zconf_nextfile(const char *name)
memset(buf, 0, sizeof(*buf)); memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER; current_buf->state = YY_CURRENT_BUFFER;
yyin = zconf_fopen(name); yyin = zconf_fopen(file->name);
if (!yyin) { if (!yyin) {
printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name); printf("%s:%d: can't open file \"%s\"\n",
zconf_curname(), zconf_lineno(), file->name);
exit(1); exit(1);
} }
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
...@@ -353,7 +354,7 @@ int zconf_lineno(void) ...@@ -353,7 +354,7 @@ int zconf_lineno(void)
return current_pos.lineno; return current_pos.lineno;
} }
char *zconf_curname(void) const char *zconf_curname(void)
{ {
return current_pos.file ? current_pos.file->name : "<none>"; return current_pos.file ? current_pos.file->name : "<none>";
} }
...@@ -417,18 +417,18 @@ union yyalloc ...@@ -417,18 +417,18 @@ union yyalloc
#endif #endif
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 3 #define YYFINAL 11
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
#define YYLAST 259 #define YYLAST 277
/* YYNTOKENS -- Number of terminals. */ /* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 35 #define YYNTOKENS 35
/* YYNNTS -- Number of nonterminals. */ /* YYNNTS -- Number of nonterminals. */
#define YYNNTS 46 #define YYNNTS 48
/* YYNRULES -- Number of rules. */ /* YYNRULES -- Number of rules. */
#define YYNRULES 110 #define YYNRULES 113
/* YYNRULES -- Number of states. */ /* YYNRULES -- Number of states. */
#define YYNSTATES 180 #define YYNSTATES 185
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2 #define YYUNDEFTOK 2
...@@ -476,73 +476,74 @@ static const yytype_uint8 yytranslate[] = ...@@ -476,73 +476,74 @@ static const yytype_uint8 yytranslate[] =
YYRHS. */ YYRHS. */
static const yytype_uint16 yyprhs[] = static const yytype_uint16 yyprhs[] =
{ {
0, 0, 3, 5, 6, 9, 12, 15, 20, 23, 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
28, 33, 37, 39, 41, 43, 45, 47, 49, 51, 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
53, 55, 57, 59, 61, 63, 67, 70, 74, 77, 52, 54, 56, 58, 60, 62, 64, 66, 70, 73,
81, 84, 85, 88, 91, 94, 97, 100, 103, 107, 77, 80, 84, 87, 88, 91, 94, 97, 100, 103,
112, 117, 122, 128, 132, 133, 137, 138, 141, 145, 106, 110, 115, 120, 125, 131, 135, 136, 140, 141,
148, 150, 154, 155, 158, 161, 164, 167, 170, 175, 144, 148, 151, 153, 157, 158, 161, 164, 167, 170,
179, 182, 187, 188, 191, 195, 197, 201, 202, 205, 173, 178, 182, 185, 190, 191, 194, 198, 200, 204,
208, 211, 215, 218, 220, 224, 225, 228, 231, 234, 205, 208, 211, 214, 218, 222, 225, 227, 231, 232,
238, 242, 245, 248, 251, 252, 255, 258, 261, 266, 235, 238, 241, 245, 249, 252, 255, 258, 259, 262,
267, 270, 272, 274, 277, 280, 283, 285, 288, 289, 265, 268, 273, 274, 277, 279, 281, 284, 287, 290,
292, 294, 298, 302, 306, 309, 313, 317, 319, 321, 292, 295, 296, 299, 301, 305, 309, 313, 316, 320,
322 324, 326, 328, 329
}; };
/* YYRHS -- A `-1'-separated list of the rules' RHS. */ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] = static const yytype_int8 yyrhs[] =
{ {
36, 0, -1, 37, -1, -1, 37, 39, -1, 37, 36, 0, -1, 78, 37, -1, 37, -1, 62, 38,
53, -1, 37, 64, -1, 37, 3, 74, 76, -1, -1, 38, -1, -1, 38, 40, -1, 38, 54, -1,
37, 75, -1, 37, 25, 1, 30, -1, 37, 38, 38, 66, -1, 38, 77, -1, 38, 25, 1, 30,
1, 30, -1, 37, 1, 30, -1, 16, -1, 18, -1, 38, 39, 1, 30, -1, 38, 1, 30, -1,
-1, 19, -1, 21, -1, 17, -1, 22, -1, 20, 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
-1, 30, -1, 59, -1, 68, -1, 42, -1, 44, 22, -1, 20, -1, 30, -1, 60, -1, 70, -1,
-1, 66, -1, 25, 1, 30, -1, 1, 30, -1, 43, -1, 45, -1, 68, -1, 25, 1, 30, -1,
10, 25, 30, -1, 41, 45, -1, 11, 25, 30, 1, 30, -1, 10, 25, 30, -1, 42, 46, -1,
-1, 43, 45, -1, -1, 45, 46, -1, 45, 47, 11, 25, 30, -1, 44, 46, -1, -1, 46, 47,
-1, 45, 72, -1, 45, 70, -1, 45, 40, -1, -1, 46, 48, -1, 46, 74, -1, 46, 72, -1,
45, 30, -1, 19, 73, 30, -1, 18, 74, 77, 46, 41, -1, 46, 30, -1, 19, 75, 30, -1,
30, -1, 20, 78, 77, 30, -1, 21, 25, 77, 18, 76, 79, 30, -1, 20, 80, 79, 30, -1,
30, -1, 22, 79, 79, 77, 30, -1, 23, 48, 21, 25, 79, 30, -1, 22, 81, 81, 79, 30,
30, -1, -1, 48, 25, 49, -1, -1, 33, 74, -1, 23, 49, 30, -1, -1, 49, 25, 50, -1,
-1, 7, 80, 30, -1, 50, 54, -1, 75, -1, -1, 33, 76, -1, 7, 82, 30, -1, 51, 55,
51, 56, 52, -1, -1, 54, 55, -1, 54, 72, -1, 77, -1, 52, 57, 53, -1, -1, 55, 56,
-1, 54, 70, -1, 54, 30, -1, 54, 40, -1, -1, 55, 74, -1, 55, 72, -1, 55, 30, -1,
18, 74, 77, 30, -1, 19, 73, 30, -1, 17, 55, 41, -1, 18, 76, 79, 30, -1, 19, 75,
30, -1, 20, 25, 77, 30, -1, -1, 56, 39, 30, -1, 17, 30, -1, 20, 25, 79, 30, -1,
-1, 14, 78, 76, -1, 75, -1, 57, 60, 58, -1, 57, 40, -1, 14, 80, 78, -1, 77, -1,
-1, -1, 60, 39, -1, 60, 64, -1, 60, 53, 58, 61, 59, -1, -1, 61, 40, -1, 61, 66,
-1, 4, 74, 30, -1, 61, 71, -1, 75, -1, -1, 61, 54, -1, 3, 76, 78, -1, 4, 76,
62, 65, 63, -1, -1, 65, 39, -1, 65, 64, 30, -1, 63, 73, -1, 77, -1, 64, 67, 65,
-1, 65, 53, -1, 6, 74, 30, -1, 9, 74, -1, -1, 67, 40, -1, 67, 66, -1, 67, 54,
30, -1, 67, 71, -1, 12, 30, -1, 69, 13, -1, 6, 76, 30, -1, 9, 76, 30, -1, 69,
-1, -1, 71, 72, -1, 71, 30, -1, 71, 40, 73, -1, 12, 30, -1, 71, 13, -1, -1, 73,
-1, 16, 24, 78, 30, -1, -1, 74, 77, -1, 74, -1, 73, 30, -1, 73, 41, -1, 16, 24,
25, -1, 26, -1, 5, 30, -1, 8, 30, -1, 80, 30, -1, -1, 76, 79, -1, 25, -1, 26,
15, 30, -1, 30, -1, 76, 30, -1, -1, 14, -1, 5, 30, -1, 8, 30, -1, 15, 30, -1,
78, -1, 79, -1, 79, 33, 79, -1, 79, 27, 30, -1, 78, 30, -1, -1, 14, 80, -1, 81,
79, -1, 29, 78, 28, -1, 34, 78, -1, 78, -1, 81, 33, 81, -1, 81, 27, 81, -1, 29,
31, 78, -1, 78, 32, 78, -1, 25, -1, 26, 80, 28, -1, 34, 80, -1, 80, 31, 80, -1,
-1, -1, 25, -1 80, 32, 80, -1, 25, -1, 26, -1, -1, 25,
-1
}; };
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 107, 107, 109, 111, 112, 113, 114, 115, 116, 0, 107, 107, 107, 109, 109, 111, 113, 114, 115,
117, 121, 125, 125, 125, 125, 125, 125, 125, 129, 116, 117, 118, 122, 126, 126, 126, 126, 126, 126,
130, 131, 132, 133, 134, 138, 139, 145, 153, 159, 126, 130, 131, 132, 133, 134, 135, 139, 140, 146,
167, 177, 179, 180, 181, 182, 183, 184, 187, 195, 154, 160, 168, 178, 180, 181, 182, 183, 184, 185,
201, 211, 217, 223, 226, 228, 239, 240, 245, 254, 188, 196, 202, 212, 218, 224, 227, 229, 240, 241,
259, 267, 270, 272, 273, 274, 275, 276, 279, 285, 246, 255, 260, 268, 271, 273, 274, 275, 276, 277,
296, 302, 312, 314, 319, 327, 335, 338, 340, 341, 280, 286, 297, 303, 313, 315, 320, 328, 336, 339,
342, 347, 354, 359, 367, 370, 372, 373, 374, 377, 341, 342, 343, 348, 355, 362, 367, 375, 378, 380,
385, 392, 399, 405, 412, 414, 415, 416, 419, 427, 381, 382, 385, 393, 400, 407, 413, 420, 422, 423,
429, 434, 435, 438, 439, 440, 444, 445, 448, 449, 424, 427, 435, 437, 442, 443, 446, 447, 448, 452,
452, 453, 454, 455, 456, 457, 458, 461, 462, 465, 453, 456, 457, 460, 461, 462, 463, 464, 465, 466,
466 469, 470, 473, 474
}; };
#endif #endif
...@@ -557,17 +558,17 @@ static const char *const yytname[] = ...@@ -557,17 +558,17 @@ static const char *const yytname[] =
"T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
"T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
"T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
"T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt", "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
"option_error", "config_entry_start", "config_stmt", "common_stmt", "option_error", "config_entry_start", "config_stmt",
"menuconfig_entry_start", "menuconfig_stmt", "config_option_list", "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
"config_option", "symbol_option", "symbol_option_list", "config_option", "symbol_option", "symbol_option_list",
"symbol_option_arg", "choice", "choice_entry", "choice_end", "symbol_option_arg", "choice", "choice_entry", "choice_end",
"choice_stmt", "choice_option_list", "choice_option", "choice_block", "choice_stmt", "choice_option_list", "choice_option", "choice_block",
"if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry", "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
"menu_end", "menu_stmt", "menu_block", "source_stmt", "comment", "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
"comment_stmt", "help_start", "help", "depends_list", "depends", "comment", "comment_stmt", "help_start", "help", "depends_list",
"prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol", "depends", "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr",
"word_opt", 0 "symbol", "word_opt", 0
}; };
#endif #endif
...@@ -586,35 +587,35 @@ static const yytype_uint16 yytoknum[] = ...@@ -586,35 +587,35 @@ static const yytype_uint16 yytoknum[] =
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] = static const yytype_uint8 yyr1[] =
{ {
0, 35, 36, 37, 37, 37, 37, 37, 37, 37, 0, 35, 36, 36, 37, 37, 38, 38, 38, 38,
37, 37, 38, 38, 38, 38, 38, 38, 38, 39, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39,
39, 39, 39, 39, 39, 40, 40, 41, 42, 43, 39, 40, 40, 40, 40, 40, 40, 41, 41, 42,
44, 45, 45, 45, 45, 45, 45, 45, 46, 46, 43, 44, 45, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 47, 48, 48, 49, 49, 50, 51, 47, 47, 47, 47, 47, 48, 49, 49, 50, 50,
52, 53, 54, 54, 54, 54, 54, 54, 55, 55, 51, 52, 53, 54, 55, 55, 55, 55, 55, 55,
55, 55, 56, 56, 57, 58, 59, 60, 60, 60, 56, 56, 56, 56, 57, 57, 58, 59, 60, 61,
60, 61, 62, 63, 64, 65, 65, 65, 65, 66, 61, 61, 61, 62, 63, 64, 65, 66, 67, 67,
67, 68, 69, 70, 71, 71, 71, 71, 72, 73, 67, 67, 68, 69, 70, 71, 72, 73, 73, 73,
73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 73, 74, 75, 75, 76, 76, 77, 77, 77, 78,
78, 78, 78, 78, 78, 78, 78, 79, 79, 80, 78, 79, 79, 80, 80, 80, 80, 80, 80, 80,
80 81, 81, 82, 82
}; };
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] = static const yytype_uint8 yyr2[] =
{ {
0, 2, 1, 0, 2, 2, 2, 4, 2, 4, 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3,
2, 0, 2, 2, 2, 2, 2, 2, 3, 4, 2, 3, 2, 0, 2, 2, 2, 2, 2, 2,
4, 4, 5, 3, 0, 3, 0, 2, 3, 2, 3, 4, 4, 4, 5, 3, 0, 3, 0, 2,
1, 3, 0, 2, 2, 2, 2, 2, 4, 3, 3, 2, 1, 3, 0, 2, 2, 2, 2, 2,
2, 4, 0, 2, 3, 1, 3, 0, 2, 2, 4, 3, 2, 4, 0, 2, 3, 1, 3, 0,
2, 3, 2, 1, 3, 0, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 1, 3, 0, 2,
3, 2, 2, 2, 0, 2, 2, 2, 4, 0, 2, 2, 3, 3, 2, 2, 2, 0, 2, 2,
2, 1, 1, 2, 2, 2, 1, 2, 0, 2, 2, 4, 0, 2, 1, 1, 2, 2, 2, 1,
1, 3, 3, 3, 2, 3, 3, 1, 1, 0, 2, 0, 2, 1, 3, 3, 3, 2, 3, 3,
1 1, 1, 0, 1
}; };
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
...@@ -622,158 +623,165 @@ static const yytype_uint8 yyr2[] = ...@@ -622,158 +623,165 @@ static const yytype_uint8 yyr2[] =
means the default is an error. */ means the default is an error. */
static const yytype_uint8 yydefact[] = static const yytype_uint8 yydefact[] =
{ {
3, 0, 0, 1, 0, 0, 0, 0, 0, 109, 6, 0, 99, 0, 3, 0, 6, 6, 94, 95,
0, 0, 0, 0, 0, 0, 12, 16, 13, 14, 0, 1, 0, 0, 0, 0, 112, 0, 0, 0,
18, 15, 17, 0, 19, 0, 4, 31, 22, 31, 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
23, 52, 62, 5, 67, 20, 84, 75, 6, 24, 0, 21, 0, 7, 33, 24, 33, 25, 54, 64,
84, 21, 8, 11, 91, 92, 0, 0, 93, 0, 8, 69, 22, 87, 78, 9, 26, 87, 23, 10,
110, 0, 94, 0, 0, 0, 107, 108, 0, 0, 0, 100, 2, 73, 13, 0, 96, 0, 113, 0,
0, 100, 95, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 110, 111, 0, 0, 0, 103,
0, 0, 0, 96, 7, 71, 79, 48, 80, 27, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29, 0, 104, 0, 0, 64, 0, 0, 9, 10, 0, 74, 82, 50, 83, 29, 31, 0, 107, 0,
0, 0, 0, 0, 89, 0, 0, 0, 44, 0, 0, 66, 0, 0, 11, 12, 0, 0, 0, 0,
37, 36, 32, 33, 0, 35, 34, 0, 0, 89, 92, 0, 0, 0, 46, 0, 39, 38, 34, 35,
0, 56, 57, 53, 55, 54, 63, 51, 50, 68, 0, 37, 36, 0, 0, 92, 0, 58, 59, 55,
70, 66, 69, 65, 86, 87, 85, 76, 78, 74, 57, 56, 65, 53, 52, 70, 72, 68, 71, 67,
77, 73, 97, 103, 105, 106, 102, 101, 26, 82, 89, 90, 88, 79, 81, 77, 80, 76, 106, 108,
0, 98, 0, 98, 98, 98, 0, 0, 0, 83, 109, 105, 104, 28, 85, 0, 101, 0, 101, 101,
60, 98, 0, 98, 0, 0, 0, 38, 90, 0, 101, 0, 0, 0, 86, 62, 101, 0, 101, 0,
0, 98, 46, 43, 25, 0, 59, 0, 88, 99, 0, 0, 40, 93, 0, 0, 101, 48, 45, 27,
39, 40, 41, 0, 0, 45, 58, 61, 42, 47 0, 61, 0, 91, 102, 41, 42, 43, 0, 0,
47, 60, 63, 44, 49
}; };
/* YYDEFGOTO[NTERM-NUM]. */ /* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] = static const yytype_int16 yydefgoto[] =
{ {
-1, 1, 2, 25, 26, 101, 27, 28, 29, 30, -1, 3, 4, 5, 32, 33, 107, 34, 35, 36,
65, 102, 103, 147, 175, 31, 32, 117, 33, 67, 37, 73, 108, 109, 152, 180, 38, 39, 123, 40,
113, 68, 34, 121, 35, 69, 36, 37, 129, 38, 75, 119, 76, 41, 127, 42, 77, 6, 43, 44,
71, 39, 40, 41, 104, 105, 70, 106, 142, 143, 135, 45, 79, 46, 47, 48, 110, 111, 78, 112,
42, 74, 156, 60, 61, 51 147, 148, 49, 7, 161, 68, 69, 59
}; };
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */ STATE-NUM. */
#define YYPACT_NINF -80 #define YYPACT_NINF -89
static const yytype_int16 yypact[] = static const yytype_int16 yypact[] =
{ {
-80, 2, 132, -80, -13, -1, -1, -2, -1, 9, 3, 4, -89, 20, -89, 100, -89, 7, -89, -89,
33, -1, 27, 40, -3, 38, -80, -80, -80, -80, -8, -89, 17, 4, 28, 4, 37, 36, 4, 68,
-80, -80, -80, 71, -80, 77, -80, -80, -80, -80, 87, -18, 69, -89, -89, -89, -89, -89, -89, -89,
-80, -80, -80, -80, -80, -80, -80, -80, -80, -80, 128, -89, 138, -89, -89, -89, -89, -89, -89, -89,
-80, -80, -80, -80, -80, -80, 57, 61, -80, 63, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-80, 76, -80, 87, 101, 133, -80, -80, -3, -3, 127, -89, -89, 110, -89, 126, -89, 136, -89, 137,
195, -6, -80, 136, 149, 39, 104, 65, 150, 5, -89, 147, 150, 152, -89, -89, -18, -18, 171, -14,
194, 5, 167, -80, 176, -80, -80, -80, -80, -80, -89, 153, 157, 34, 67, 180, 233, 220, 207, 220,
-80, 68, -80, -3, -3, 176, 72, 72, -80, -80, 154, -89, -89, -89, -89, -89, -89, 0, -89, -18,
177, 187, 78, -1, -1, -3, 196, 72, -80, 222, -18, 110, 44, 44, -89, -89, 163, 174, 182, 4,
-80, -80, -80, -80, 221, -80, -80, 205, -1, -1, 4, -18, 194, 44, -89, 219, -89, -89, -89, -89,
211, -80, -80, -80, -80, -80, -80, -80, -80, -80, 223, -89, -89, 203, 4, 4, 215, -89, -89, -89,
-80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-80, -80, -80, -80, 206, -80, -80, -80, -80, -80, -89, -89, -89, -89, -89, -89, -89, -89, -89, 213,
-3, 223, 209, 223, 197, 223, 72, 7, 210, -80, -89, -89, -89, -89, -89, -18, 232, 227, 232, -5,
-80, 223, 212, 223, 201, -3, 213, -80, -80, 214, 232, 44, 35, 234, -89, -89, 232, 235, 232, 224,
215, 223, 208, -80, -80, 216, -80, 217, -80, 113, -18, 236, -89, -89, 237, 238, 232, 216, -89, -89,
-80, -80, -80, 218, -1, -80, -80, -80, -80, -80 240, -89, 241, -89, 71, -89, -89, -89, 242, 4,
-89, -89, -89, -89, -89
}; };
/* YYPGOTO[NTERM-NUM]. */ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] = static const yytype_int16 yypgoto[] =
{ {
-80, -80, -80, -80, 122, -34, -80, -80, -80, -80, -89, -89, 255, 267, -89, 47, -57, -89, -89, -89,
220, -80, -80, -80, -80, -80, -80, -80, 59, -80, -89, 239, -89, -89, -89, -89, -89, -89, -89, 130,
-80, -80, -80, -80, -80, -80, -80, -80, -80, 125, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
-80, -80, -80, -80, -80, 183, 219, 22, 142, -5, -89, 181, -89, -89, -89, -89, -89, 199, 229, 16,
147, 192, 69, -54, -79, -80 162, -1, 74, -7, 103, -65, -88, -89
}; };
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says. number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */ If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -82 #define YYTABLE_NINF -85
static const yytype_int16 yytable[] = static const yytype_int16 yytable[] =
{ {
46, 47, 3, 49, 81, 82, 53, 136, 137, 6, 10, 87, 88, 53, 141, 142, 1, 64, 65, 160,
7, 8, 9, 10, 11, 12, 13, 43, 146, 14, 1, 66, 55, 92, 57, 151, 67, 61, 118, 93,
15, 86, 56, 57, 44, 45, 58, 87, 48, 134, 11, 131, 2, 131, 139, 140, 89, 90, 138, 8,
135, 59, 162, 112, 50, 24, 125, 163, 125, -28, 9, 89, 90, 2, -30, 96, 149, 51, -30, -30,
90, 144, -28, -28, -28, -28, -28, -28, -28, -28, -30, -30, -30, -30, -30, -30, 97, 54, -30, -30,
-28, 91, 54, -28, -28, 92, -28, 93, 94, 95, 98, -30, 99, 100, 101, 102, 103, 104, 56, 105,
96, 97, 98, 52, 99, 55, 90, 161, 62, 100, 167, 91, 58, 166, 106, 168, 60, -32, 96, 64,
-49, -49, 63, -49, -49, -49, -49, 91, 64, -49, 65, -32, -32, -32, -32, -32, -32, -32, -32, 97,
-49, 92, 107, 108, 109, 110, 154, 73, 141, 115, 159, -32, -32, 98, -32, 99, 100, 101, 102, 103,
99, 75, 126, 76, 126, 111, 133, 56, 57, 83, 104, 121, 105, 62, 132, 174, 132, 106, 146, 70,
84, 169, 140, 151, -30, 90, 77, -30, -30, -30, -5, 12, 89, 90, 13, 14, 15, 16, 17, 18,
-30, -30, -30, -30, -30, -30, 91, 78, -30, -30, 19, 20, 63, 156, 21, 22, 23, 24, 25, 26,
92, -30, 93, 94, 95, 96, 97, 98, 120, 99, 27, 28, 29, 122, 125, 30, 133, -4, 12, 71,
128, 79, -2, 4, 100, 5, 6, 7, 8, 9, 31, 13, 14, 15, 16, 17, 18, 19, 20, 72,
10, 11, 12, 13, 83, 84, 14, 15, 16, 17, 51, 21, 22, 23, 24, 25, 26, 27, 28, 29,
18, 19, 20, 21, 22, 7, 8, 23, 10, 11, 124, 129, 30, 137, -84, 96, 81, 31, -84, -84,
12, 13, 24, 80, 14, 15, 88, -81, 90, 179, -84, -84, -84, -84, -84, -84, 82, 83, -84, -84,
-81, -81, -81, -81, -81, -81, -81, -81, -81, 89, 98, -84, -84, -84, -84, -84, -84, 84, 184, 105,
24, -81, -81, 92, -81, -81, -81, -81, -81, -81, 85, 96, 86, 94, 130, -51, -51, 95, -51, -51,
116, 119, 99, 127, 122, 90, 130, 124, -72, -72, -51, -51, 97, 143, -51, -51, 98, 113, 114, 115,
-72, -72, -72, -72, -72, -72, 132, 138, -72, -72, 116, 2, 89, 90, 144, 105, 145, 126, 96, 134,
92, 155, 158, 159, 160, 118, 123, 139, 131, 99, 117, -75, -75, -75, -75, -75, -75, -75, -75, 150,
165, 145, 167, 148, 124, 73, 83, 84, 83, 84, 153, -75, -75, 98, 13, 14, 15, 16, 17, 18,
173, 168, 83, 84, 149, 150, 153, 155, 84, 157, 19, 20, 105, 155, 21, 22, 154, 130, 14, 15,
164, 174, 166, 170, 171, 172, 176, 177, 178, 66, 158, 17, 18, 19, 20, 90, 160, 21, 22, 179,
114, 152, 85, 0, 0, 0, 0, 0, 0, 72 31, 163, 164, 165, 173, 89, 90, 162, 128, 170,
136, 172, 52, 31, 169, 171, 175, 176, 177, 178,
181, 182, 183, 50, 120, 74, 80, 157
}; };
static const yytype_int16 yycheck[] = static const yytype_uint8 yycheck[] =
{ {
5, 6, 0, 8, 58, 59, 11, 86, 87, 4, 1, 66, 67, 10, 92, 93, 3, 25, 26, 14,
5, 6, 7, 8, 9, 10, 11, 30, 97, 14, 3, 29, 13, 27, 15, 103, 34, 18, 75, 33,
15, 27, 25, 26, 25, 26, 29, 33, 30, 83, 0, 78, 30, 80, 89, 90, 31, 32, 28, 25,
84, 34, 25, 67, 25, 30, 70, 30, 72, 0, 26, 31, 32, 30, 0, 1, 101, 30, 4, 5,
1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 25, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 30, 25, 25, 1, 146, 30, 30,
5, 6, 1, 8, 9, 10, 11, 12, 1, 14,
15, 16, 17, 18, 19, 20, 140, 30, 93, 67,
25, 30, 70, 30, 72, 30, 28, 25, 26, 31,
32, 155, 24, 108, 0, 1, 30, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 30, 14, 15, 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 69, 25, 16, 17, 18, 19, 20, 21, 22, 23, 30, 25,
71, 30, 0, 1, 30, 3, 4, 5, 6, 7, 25, 68, 25, 151, 30, 30, 30, 0, 1, 25,
8, 9, 10, 11, 31, 32, 14, 15, 16, 17, 26, 4, 5, 6, 7, 8, 9, 10, 11, 12,
18, 19, 20, 21, 22, 5, 6, 25, 8, 9, 145, 14, 15, 16, 17, 18, 19, 20, 21, 22,
10, 11, 30, 30, 14, 15, 30, 0, 1, 174, 23, 75, 25, 25, 78, 160, 80, 30, 99, 30,
3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 0, 1, 31, 32, 4, 5, 6, 7, 8, 9,
10, 11, 25, 114, 14, 15, 16, 17, 18, 19,
20, 21, 22, 76, 77, 25, 79, 0, 1, 1,
30, 4, 5, 6, 7, 8, 9, 10, 11, 1,
30, 14, 15, 16, 17, 18, 19, 20, 21, 22, 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
68, 69, 25, 71, 69, 1, 71, 30, 4, 5, 76, 77, 25, 79, 0, 1, 30, 30, 4, 5,
6, 7, 8, 9, 10, 11, 30, 30, 14, 15, 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
16, 14, 143, 144, 145, 68, 69, 30, 71, 25, 16, 17, 18, 19, 20, 21, 22, 30, 179, 25,
151, 25, 153, 1, 30, 30, 31, 32, 31, 32, 30, 1, 30, 30, 30, 5, 6, 30, 8, 9,
161, 30, 31, 32, 13, 30, 25, 14, 32, 30, 10, 11, 12, 30, 14, 15, 16, 17, 18, 19,
30, 33, 30, 30, 30, 30, 30, 30, 30, 29, 20, 30, 31, 32, 30, 25, 24, 77, 1, 79,
67, 109, 60, -1, -1, -1, -1, -1, -1, 40 30, 4, 5, 6, 7, 8, 9, 10, 11, 25,
1, 14, 15, 16, 4, 5, 6, 7, 8, 9,
10, 11, 25, 30, 14, 15, 13, 30, 5, 6,
25, 8, 9, 10, 11, 32, 14, 14, 15, 33,
30, 148, 149, 150, 30, 31, 32, 30, 77, 156,
79, 158, 7, 30, 30, 30, 30, 30, 30, 166,
30, 30, 30, 6, 75, 36, 47, 115
}; };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] = static const yytype_uint8 yystos[] =
{ {
0, 36, 37, 0, 1, 3, 4, 5, 6, 7, 0, 3, 30, 36, 37, 38, 62, 78, 25, 26,
8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 76, 0, 1, 4, 5, 6, 7, 8, 9, 10,
20, 21, 22, 25, 30, 38, 39, 41, 42, 43, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
44, 50, 51, 53, 57, 59, 61, 62, 64, 66, 25, 30, 39, 40, 42, 43, 44, 45, 51, 52,
67, 68, 75, 30, 25, 26, 74, 74, 30, 74, 54, 58, 60, 63, 64, 66, 68, 69, 70, 77,
25, 80, 30, 74, 25, 25, 25, 26, 29, 34, 38, 30, 37, 78, 30, 76, 30, 76, 25, 82,
78, 79, 30, 1, 1, 45, 45, 54, 56, 60, 30, 76, 25, 25, 25, 26, 29, 34, 80, 81,
71, 65, 71, 30, 76, 30, 30, 30, 30, 30, 30, 1, 1, 46, 46, 55, 57, 61, 73, 67,
30, 78, 78, 31, 32, 76, 27, 33, 30, 30, 73, 30, 30, 30, 30, 30, 30, 80, 80, 31,
1, 12, 16, 18, 19, 20, 21, 22, 23, 25, 32, 78, 27, 33, 30, 30, 1, 12, 16, 18,
30, 40, 46, 47, 69, 70, 72, 17, 18, 19, 19, 20, 21, 22, 23, 25, 30, 41, 47, 48,
20, 30, 40, 55, 70, 72, 39, 52, 75, 39, 71, 72, 74, 17, 18, 19, 20, 30, 41, 56,
53, 58, 64, 75, 30, 40, 72, 39, 53, 63, 72, 74, 40, 53, 77, 40, 54, 59, 66, 77,
64, 75, 30, 28, 78, 78, 79, 79, 30, 30, 30, 41, 74, 40, 54, 65, 66, 77, 28, 80,
24, 74, 73, 74, 78, 25, 79, 48, 1, 13, 80, 81, 81, 30, 30, 24, 76, 75, 76, 80,
30, 74, 73, 25, 78, 14, 77, 30, 77, 77, 25, 81, 49, 1, 13, 30, 76, 75, 25, 80,
77, 79, 25, 30, 30, 77, 30, 77, 30, 78, 14, 79, 30, 79, 79, 79, 81, 25, 30, 30,
30, 30, 30, 77, 33, 49, 30, 30, 30, 74 79, 30, 79, 30, 80, 30, 30, 30, 79, 33,
50, 30, 30, 30, 76
}; };
#define yyerrok (yyerrstatus = 0) #define yyerrok (yyerrstatus = 0)
...@@ -1284,7 +1292,7 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -1284,7 +1292,7 @@ yydestruct (yymsg, yytype, yyvaluep)
switch (yytype) switch (yytype)
{ {
case 51: /* "choice_entry" */ case 52: /* "choice_entry" */
{ {
fprintf(stderr, "%s:%d: missing end statement for this entry\n", fprintf(stderr, "%s:%d: missing end statement for this entry\n",
...@@ -1294,7 +1302,7 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -1294,7 +1302,7 @@ yydestruct (yymsg, yytype, yyvaluep)
}; };
break; break;
case 57: /* "if_entry" */ case 58: /* "if_entry" */
{ {
fprintf(stderr, "%s:%d: missing end statement for this entry\n", fprintf(stderr, "%s:%d: missing end statement for this entry\n",
...@@ -1304,7 +1312,7 @@ yydestruct (yymsg, yytype, yyvaluep) ...@@ -1304,7 +1312,7 @@ yydestruct (yymsg, yytype, yyvaluep)
}; };
break; break;
case 62: /* "menu_entry" */ case 64: /* "menu_entry" */
{ {
fprintf(stderr, "%s:%d: missing end statement for this entry\n", fprintf(stderr, "%s:%d: missing end statement for this entry\n",
...@@ -1614,39 +1622,39 @@ yyreduce: ...@@ -1614,39 +1622,39 @@ yyreduce:
YY_REDUCE_PRINT (yyn); YY_REDUCE_PRINT (yyn);
switch (yyn) switch (yyn)
{ {
case 8: case 10:
{ zconf_error("unexpected end statement"); ;} { zconf_error("unexpected end statement"); ;}
break; break;
case 9: case 11:
{ zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;} { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
break; break;
case 10: case 12:
{ {
zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
;} ;}
break; break;
case 11: case 13:
{ zconf_error("invalid statement"); ;} { zconf_error("invalid statement"); ;}
break; break;
case 25: case 27:
{ zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
break; break;
case 26: case 28:
{ zconf_error("invalid option"); ;} { zconf_error("invalid option"); ;}
break; break;
case 27: case 29:
{ {
struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
...@@ -1656,7 +1664,7 @@ yyreduce: ...@@ -1656,7 +1664,7 @@ yyreduce:
;} ;}
break; break;
case 28: case 30:
{ {
menu_end_entry(); menu_end_entry();
...@@ -1664,7 +1672,7 @@ yyreduce: ...@@ -1664,7 +1672,7 @@ yyreduce:
;} ;}
break; break;
case 29: case 31:
{ {
struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
...@@ -1674,7 +1682,7 @@ yyreduce: ...@@ -1674,7 +1682,7 @@ yyreduce:
;} ;}
break; break;
case 30: case 32:
{ {
if (current_entry->prompt) if (current_entry->prompt)
...@@ -1686,7 +1694,7 @@ yyreduce: ...@@ -1686,7 +1694,7 @@ yyreduce:
;} ;}
break; break;
case 38: case 40:
{ {
menu_set_type((yyvsp[(1) - (3)].id)->stype); menu_set_type((yyvsp[(1) - (3)].id)->stype);
...@@ -1696,7 +1704,7 @@ yyreduce: ...@@ -1696,7 +1704,7 @@ yyreduce:
;} ;}
break; break;
case 39: case 41:
{ {
menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
...@@ -1704,7 +1712,7 @@ yyreduce: ...@@ -1704,7 +1712,7 @@ yyreduce:
;} ;}
break; break;
case 40: case 42:
{ {
menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
...@@ -1716,7 +1724,7 @@ yyreduce: ...@@ -1716,7 +1724,7 @@ yyreduce:
;} ;}
break; break;
case 41: case 43:
{ {
menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
...@@ -1724,7 +1732,7 @@ yyreduce: ...@@ -1724,7 +1732,7 @@ yyreduce:
;} ;}
break; break;
case 42: case 44:
{ {
menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); 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: ...@@ -1732,7 +1740,7 @@ yyreduce:
;} ;}
break; break;
case 45: case 47:
{ {
struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
...@@ -1744,17 +1752,17 @@ yyreduce: ...@@ -1744,17 +1752,17 @@ yyreduce:
;} ;}
break; break;
case 46: case 48:
{ (yyval.string) = NULL; ;} { (yyval.string) = NULL; ;}
break; break;
case 47: case 49:
{ (yyval.string) = (yyvsp[(2) - (2)].string); ;} { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
break; break;
case 48: case 50:
{ {
struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
...@@ -1765,14 +1773,14 @@ yyreduce: ...@@ -1765,14 +1773,14 @@ yyreduce:
;} ;}
break; break;
case 49: case 51:
{ {
(yyval.menu) = menu_add_menu(); (yyval.menu) = menu_add_menu();
;} ;}
break; break;
case 50: case 52:
{ {
if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
...@@ -1782,7 +1790,7 @@ yyreduce: ...@@ -1782,7 +1790,7 @@ yyreduce:
;} ;}
break; break;
case 58: case 60:
{ {
menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
...@@ -1790,7 +1798,7 @@ yyreduce: ...@@ -1790,7 +1798,7 @@ yyreduce:
;} ;}
break; break;
case 59: case 61:
{ {
if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
...@@ -1803,7 +1811,7 @@ yyreduce: ...@@ -1803,7 +1811,7 @@ yyreduce:
;} ;}
break; break;
case 60: case 62:
{ {
current_entry->sym->flags |= SYMBOL_OPTIONAL; current_entry->sym->flags |= SYMBOL_OPTIONAL;
...@@ -1811,7 +1819,7 @@ yyreduce: ...@@ -1811,7 +1819,7 @@ yyreduce:
;} ;}
break; break;
case 61: case 63:
{ {
if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
...@@ -1823,7 +1831,7 @@ yyreduce: ...@@ -1823,7 +1831,7 @@ yyreduce:
;} ;}
break; break;
case 64: case 66:
{ {
printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
...@@ -1833,7 +1841,7 @@ yyreduce: ...@@ -1833,7 +1841,7 @@ yyreduce:
;} ;}
break; break;
case 65: case 67:
{ {
if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
...@@ -1843,7 +1851,14 @@ yyreduce: ...@@ -1843,7 +1851,14 @@ yyreduce:
;} ;}
break; break;
case 71: case 73:
{
menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
;}
break;
case 74:
{ {
menu_add_entry(NULL); menu_add_entry(NULL);
...@@ -1852,14 +1867,14 @@ yyreduce: ...@@ -1852,14 +1867,14 @@ yyreduce:
;} ;}
break; break;
case 72: case 75:
{ {
(yyval.menu) = menu_add_menu(); (yyval.menu) = menu_add_menu();
;} ;}
break; break;
case 73: case 76:
{ {
if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
...@@ -1869,7 +1884,7 @@ yyreduce: ...@@ -1869,7 +1884,7 @@ yyreduce:
;} ;}
break; break;
case 79: case 82:
{ {
printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
...@@ -1877,7 +1892,7 @@ yyreduce: ...@@ -1877,7 +1892,7 @@ yyreduce:
;} ;}
break; break;
case 80: case 83:
{ {
menu_add_entry(NULL); menu_add_entry(NULL);
...@@ -1886,14 +1901,14 @@ yyreduce: ...@@ -1886,14 +1901,14 @@ yyreduce:
;} ;}
break; break;
case 81: case 84:
{ {
menu_end_entry(); menu_end_entry();
;} ;}
break; break;
case 82: case 85:
{ {
printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
...@@ -1901,14 +1916,14 @@ yyreduce: ...@@ -1901,14 +1916,14 @@ yyreduce:
;} ;}
break; break;
case 83: case 86:
{ {
current_entry->help = (yyvsp[(2) - (2)].string); current_entry->help = (yyvsp[(2) - (2)].string);
;} ;}
break; break;
case 88: case 91:
{ {
menu_add_dep((yyvsp[(3) - (4)].expr)); menu_add_dep((yyvsp[(3) - (4)].expr));
...@@ -1916,84 +1931,84 @@ yyreduce: ...@@ -1916,84 +1931,84 @@ yyreduce:
;} ;}
break; break;
case 90: case 93:
{ {
menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
;} ;}
break; break;
case 93: case 96:
{ (yyval.id) = (yyvsp[(1) - (2)].id); ;} { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
break; break;
case 94: case 97:
{ (yyval.id) = (yyvsp[(1) - (2)].id); ;} { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
break; break;
case 95: case 98:
{ (yyval.id) = (yyvsp[(1) - (2)].id); ;} { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
break; break;
case 98: case 101:
{ (yyval.expr) = NULL; ;} { (yyval.expr) = NULL; ;}
break; break;
case 99: case 102:
{ (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
break; break;
case 100: case 103:
{ (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
break; break;
case 101: case 104:
{ (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
break; break;
case 102: case 105:
{ (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
break; break;
case 103: case 106:
{ (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
break; break;
case 104: case 107:
{ (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
break; break;
case 105: case 108:
{ (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
break; break;
case 106: case 109:
{ (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
break; break;
case 107: case 110:
{ (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
break; break;
case 108: case 111:
{ (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
break; break;
case 109: case 112:
{ (yyval.string) = NULL; ;} { (yyval.string) = NULL; ;}
break; break;
...@@ -2239,6 +2254,10 @@ void conf_parse(const char *name) ...@@ -2239,6 +2254,10 @@ void conf_parse(const char *name)
prop = prop_alloc(P_DEFAULT, modules_sym); prop = prop_alloc(P_DEFAULT, modules_sym);
prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
} }
rootmenu.prompt->text = _(rootmenu.prompt->text);
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
menu_finalize(&rootmenu); menu_finalize(&rootmenu);
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
if (sym_check_deps(sym)) if (sym_check_deps(sym))
......
...@@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry; ...@@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry;
#define YYERROR_VERBOSE #define YYERROR_VERBOSE
#endif #endif
%} %}
%expect 26 %expect 28
%union %union
{ {
...@@ -104,14 +104,15 @@ static struct menu *current_menu, *current_entry; ...@@ -104,14 +104,15 @@ static struct menu *current_menu, *current_entry;
%} %}
%% %%
input: stmt_list; input: nl start | start;
start: mainmenu_stmt stmt_list | stmt_list;
stmt_list: stmt_list:
/* empty */ /* empty */
| stmt_list common_stmt | stmt_list common_stmt
| stmt_list choice_stmt | stmt_list choice_stmt
| stmt_list menu_stmt | stmt_list menu_stmt
| stmt_list T_MAINMENU prompt nl
| stmt_list end { zconf_error("unexpected end statement"); } | stmt_list end { zconf_error("unexpected end statement"); }
| stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); } | stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); }
| stmt_list option_name error T_EOL | stmt_list option_name error T_EOL
...@@ -342,6 +343,13 @@ if_block: ...@@ -342,6 +343,13 @@ if_block:
| if_block choice_stmt | if_block choice_stmt
; ;
/* mainmenu entry */
mainmenu_stmt: T_MAINMENU prompt nl
{
menu_add_prompt(P_MENU, $2, NULL);
};
/* menu entry */ /* menu entry */
menu: T_MENU prompt T_EOL menu: T_MENU prompt T_EOL
...@@ -494,6 +502,10 @@ void conf_parse(const char *name) ...@@ -494,6 +502,10 @@ void conf_parse(const char *name)
prop = prop_alloc(P_DEFAULT, modules_sym); prop = prop_alloc(P_DEFAULT, modules_sym);
prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
} }
rootmenu.prompt->text = _(rootmenu.prompt->text);
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
menu_finalize(&rootmenu); menu_finalize(&rootmenu);
for_all_symbols(i, sym) { for_all_symbols(i, sym) {
if (sym_check_deps(sym)) if (sym_check_deps(sym))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment