From 5c472fc895c32a189d574b338057164e95430825 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 20 Apr 2006 20:17:34 +0000 Subject: add kconfig from linux 2.6 to scripts/config git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3682 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/zconf.y | 681 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 681 insertions(+) create mode 100644 scripts/config/zconf.y (limited to 'scripts/config/zconf.y') diff --git a/scripts/config/zconf.y b/scripts/config/zconf.y new file mode 100644 index 0000000000..1f61fba6aa --- /dev/null +++ b/scripts/config/zconf.y @@ -0,0 +1,681 @@ +%{ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#include "zconf.hash.c" + +#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) + +#define PRINTD 0x0001 +#define DEBUG_PARSE 0x0002 + +int cdebug = PRINTD; + +extern int zconflex(void); +static void zconfprint(const char *err, ...); +static void zconf_error(const char *err, ...); +static void zconferror(const char *err); +static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); + +struct symbol *symbol_hash[257]; + +static struct menu *current_menu, *current_entry; + +#define YYDEBUG 0 +#if YYDEBUG +#define YYERROR_VERBOSE +#endif +%} +%expect 26 + +%union +{ + char *string; + struct file *file; + struct symbol *symbol; + struct expr *expr; + struct menu *menu; + struct kconf_id *id; +} + +%token T_MAINMENU +%token T_MENU +%token T_ENDMENU +%token T_SOURCE +%token T_CHOICE +%token T_ENDCHOICE +%token T_COMMENT +%token T_CONFIG +%token T_MENUCONFIG +%token T_HELP +%token T_HELPTEXT +%token T_IF +%token T_ENDIF +%token T_DEPENDS +%token T_REQUIRES +%token T_OPTIONAL +%token T_PROMPT +%token T_TYPE +%token T_DEFAULT +%token T_SELECT +%token T_RANGE +%token T_ON +%token T_WORD +%token T_WORD_QUOTE +%token T_UNEQUAL +%token T_CLOSE_PAREN +%token T_OPEN_PAREN +%token T_EOL + +%left T_OR +%left T_AND +%left T_EQUAL T_UNEQUAL +%nonassoc T_NOT + +%type prompt +%type symbol +%type expr +%type if_expr +%type end +%type option_name +%type if_entry menu_entry choice_entry + +%destructor { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + $$->file->name, $$->lineno); + if (current_menu == $$) + menu_end_menu(); +} if_entry menu_entry choice_entry + +%% +input: stmt_list; + +stmt_list: + /* empty */ + | stmt_list common_stmt + | stmt_list choice_stmt + | stmt_list menu_stmt + | stmt_list T_MAINMENU prompt nl + | stmt_list end { zconf_error("unexpected end statement"); } + | stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); } + | stmt_list option_name error T_EOL +{ + zconf_error("unexpected option \"%s\"", kconf_id_strings + $2->name); +} + | stmt_list error T_EOL { zconf_error("invalid statement"); } +; + +option_name: + T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT +; + +common_stmt: + T_EOL + | if_stmt + | comment_stmt + | config_stmt + | menuconfig_stmt + | source_stmt +; + +option_error: + T_WORD error T_EOL { zconf_error("unknown option \"%s\"", $1); } + | error T_EOL { zconf_error("invalid option"); } +; + + +/* config/menuconfig entry */ + +config_entry_start: T_CONFIG T_WORD T_EOL +{ + struct symbol *sym = sym_lookup($2, 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), $2); +}; + +config_stmt: config_entry_start config_option_list +{ + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +}; + +menuconfig_entry_start: T_MENUCONFIG T_WORD T_EOL +{ + struct symbol *sym = sym_lookup($2, 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2); +}; + +menuconfig_stmt: menuconfig_entry_start config_option_list +{ + if (current_entry->prompt) + current_entry->prompt->type = P_MENU; + else + zconfprint("warning: menuconfig statement without prompt"); + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +}; + +config_option_list: + /* empty */ + | config_option_list config_option + | config_option_list depends + | config_option_list help + | config_option_list option_error + | config_option_list T_EOL +; + +config_option: T_TYPE prompt_stmt_opt T_EOL +{ + menu_set_type($1->stype); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), + $1->stype); +}; + +config_option: T_PROMPT prompt if_expr T_EOL +{ + menu_add_prompt(P_PROMPT, $2, $3); + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); +}; + +config_option: T_DEFAULT expr if_expr T_EOL +{ + menu_add_expr(P_DEFAULT, $2, $3); + if ($1->stype != S_UNKNOWN) + menu_set_type($1->stype); + printd(DEBUG_PARSE, "%s:%d:default(%u)\n", + zconf_curname(), zconf_lineno(), + $1->stype); +}; + +config_option: T_SELECT T_WORD if_expr T_EOL +{ + menu_add_symbol(P_SELECT, sym_lookup($2, 0), $3); + printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); +}; + +config_option: T_RANGE symbol symbol if_expr T_EOL +{ + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4); + printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); +}; + +/* choice entry */ + +choice: T_CHOICE T_EOL +{ + struct symbol *sym = sym_lookup(NULL, 0); + sym->flags |= SYMBOL_CHOICE; + menu_add_entry(sym); + menu_add_expr(P_CHOICE, NULL, NULL); + printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); +}; + +choice_entry: choice choice_option_list +{ + $$ = menu_add_menu(); +}; + +choice_end: end +{ + if (zconf_endtoken($1, T_CHOICE, T_ENDCHOICE)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); + } +}; + +choice_stmt: choice_entry choice_block choice_end +; + +choice_option_list: + /* empty */ + | choice_option_list choice_option + | choice_option_list depends + | choice_option_list help + | choice_option_list T_EOL + | choice_option_list option_error +; + +choice_option: T_PROMPT prompt if_expr T_EOL +{ + menu_add_prompt(P_PROMPT, $2, $3); + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); +}; + +choice_option: T_TYPE prompt_stmt_opt T_EOL +{ + if ($1->stype == S_BOOLEAN || $1->stype == S_TRISTATE) { + menu_set_type($1->stype); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), + $1->stype); + } else + YYERROR; +}; + +choice_option: T_OPTIONAL T_EOL +{ + current_entry->sym->flags |= SYMBOL_OPTIONAL; + printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); +}; + +choice_option: T_DEFAULT T_WORD if_expr T_EOL +{ + if ($1->stype == S_UNKNOWN) { + menu_add_symbol(P_DEFAULT, sym_lookup($2, 0), $3); + printd(DEBUG_PARSE, "%s:%d:default\n", + zconf_curname(), zconf_lineno()); + } else + YYERROR; +}; + +choice_block: + /* empty */ + | choice_block common_stmt +; + +/* if entry */ + +if_entry: T_IF expr nl +{ + printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); + menu_add_entry(NULL); + menu_add_dep($2); + $$ = menu_add_menu(); +}; + +if_end: end +{ + if (zconf_endtoken($1, T_IF, T_ENDIF)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); + } +}; + +if_stmt: if_entry if_block if_end +; + +if_block: + /* empty */ + | if_block common_stmt + | if_block menu_stmt + | if_block choice_stmt +; + +/* menu entry */ + +menu: T_MENU prompt T_EOL +{ + menu_add_entry(NULL); + menu_add_prompt(P_MENU, $2, NULL); + printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); +}; + +menu_entry: menu depends_list +{ + $$ = menu_add_menu(); +}; + +menu_end: end +{ + if (zconf_endtoken($1, T_MENU, T_ENDMENU)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); + } +}; + +menu_stmt: menu_entry menu_block menu_end +; + +menu_block: + /* empty */ + | menu_block common_stmt + | menu_block menu_stmt + | menu_block choice_stmt +; + +source_stmt: T_SOURCE prompt T_EOL +{ + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), $2); + zconf_nextfile($2); +}; + +/* comment entry */ + +comment: T_COMMENT prompt T_EOL +{ + menu_add_entry(NULL); + menu_add_prompt(P_COMMENT, $2, NULL); + printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); +}; + +comment_stmt: comment depends_list +{ + menu_end_entry(); +}; + +/* help option */ + +help_start: T_HELP T_EOL +{ + printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); + zconf_starthelp(); +}; + +help: help_start T_HELPTEXT +{ + current_entry->sym->help = $2; +}; + +/* depends option */ + +depends_list: + /* empty */ + | depends_list depends + | depends_list T_EOL + | depends_list option_error +; + +depends: T_DEPENDS T_ON expr T_EOL +{ + menu_add_dep($3); + printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); +} + | T_DEPENDS expr T_EOL +{ + menu_add_dep($2); + printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); +} + | T_REQUIRES expr T_EOL +{ + menu_add_dep($2); + printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); +}; + +/* prompt statement */ + +prompt_stmt_opt: + /* empty */ + | prompt if_expr +{ + menu_add_prompt(P_PROMPT, $1, $2); +}; + +prompt: T_WORD + | T_WORD_QUOTE +; + +end: T_ENDMENU T_EOL { $$ = $1; } + | T_ENDCHOICE T_EOL { $$ = $1; } + | T_ENDIF T_EOL { $$ = $1; } +; + +nl: + T_EOL + | nl T_EOL +; + +if_expr: /* empty */ { $$ = NULL; } + | T_IF expr { $$ = $2; } +; + +expr: symbol { $$ = expr_alloc_symbol($1); } + | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, $1, $3); } + | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, $1, $3); } + | T_OPEN_PAREN expr T_CLOSE_PAREN { $$ = $2; } + | T_NOT expr { $$ = expr_alloc_one(E_NOT, $2); } + | expr T_OR expr { $$ = expr_alloc_two(E_OR, $1, $3); } + | expr T_AND expr { $$ = expr_alloc_two(E_AND, $1, $3); } +; + +symbol: T_WORD { $$ = sym_lookup($1, 0); free($1); } + | T_WORD_QUOTE { $$ = sym_lookup($1, 1); free($1); } +; + +%% + +void conf_parse(const char *name) +{ + struct symbol *sym; + int i; + + zconf_initscan(name); + + sym_init(); + menu_init(); + modules_sym = sym_lookup("MODULES", 0); + rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + +#if YYDEBUG + if (getenv("ZCONF_DEBUG")) + zconfdebug = 1; +#endif + zconfparse(); + if (zconfnerrs) + exit(1); + menu_finalize(&rootmenu); + for_all_symbols(i, sym) { + sym_check_deps(sym); + } + + sym_change_count = 1; +} + +const char *zconf_tokenname(int token) +{ + switch (token) { + case T_MENU: return "menu"; + case T_ENDMENU: return "endmenu"; + case T_CHOICE: return "choice"; + case T_ENDCHOICE: return "endchoice"; + case T_IF: return "if"; + case T_ENDIF: return "endif"; + case T_DEPENDS: return "depends"; + } + return ""; +} + +static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) +{ + if (id->token != endtoken) { + zconf_error("unexpected '%s' within %s block", + kconf_id_strings + id->name, zconf_tokenname(starttoken)); + zconfnerrs++; + return false; + } + if (current_menu->file != current_file) { + zconf_error("'%s' in different file than '%s'", + kconf_id_strings + id->name, zconf_tokenname(starttoken)); + fprintf(stderr, "%s:%d: location of the '%s'\n", + current_menu->file->name, current_menu->lineno, + zconf_tokenname(starttoken)); + zconfnerrs++; + return false; + } + return true; +} + +static void zconfprint(const char *err, ...) +{ + va_list ap; + + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + va_start(ap, err); + vfprintf(stderr, err, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void zconf_error(const char *err, ...) +{ + va_list ap; + + zconfnerrs++; + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + va_start(ap, err); + vfprintf(stderr, err, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void zconferror(const char *err) +{ +#if YYDEBUG + fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); +#endif +} + +void print_quoted_string(FILE *out, const char *str) +{ + const char *p; + int len; + + putc('"', out); + while ((p = strchr(str, '"'))) { + len = p - str; + if (len) + fprintf(out, "%.*s", len, str); + fputs("\\\"", out); + str = p + 1; + } + fputs(str, out); + putc('"', out); +} + +void print_symbol(FILE *out, struct menu *menu) +{ + struct symbol *sym = menu->sym; + struct property *prop; + + if (sym_is_choice(sym)) + fprintf(out, "choice\n"); + else + fprintf(out, "config %s\n", sym->name); + switch (sym->type) { + case S_BOOLEAN: + fputs(" boolean\n", out); + break; + case S_TRISTATE: + fputs(" tristate\n", out); + break; + case S_STRING: + fputs(" string\n", out); + break; + case S_INT: + fputs(" integer\n", out); + break; + case S_HEX: + fputs(" hex\n", out); + break; + default: + fputs(" ???\n", out); + break; + } + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + switch (prop->type) { + case P_PROMPT: + fputs(" prompt ", out); + print_quoted_string(out, prop->text); + if (!expr_is_yes(prop->visible.expr)) { + fputs(" if ", out); + expr_fprint(prop->visible.expr, out); + } + fputc('\n', out); + break; + case P_DEFAULT: + fputs( " default ", out); + expr_fprint(prop->expr, out); + if (!expr_is_yes(prop->visible.expr)) { + fputs(" if ", out); + expr_fprint(prop->visible.expr, out); + } + fputc('\n', out); + break; + case P_CHOICE: + fputs(" #choice value\n", out); + break; + default: + fprintf(out, " unknown prop %d!\n", prop->type); + break; + } + } + if (sym->help) { + int len = strlen(sym->help); + while (sym->help[--len] == '\n') + sym->help[len] = 0; + fprintf(out, " help\n%s\n", sym->help); + } + fputc('\n', out); +} + +void zconfdump(FILE *out) +{ + struct property *prop; + struct symbol *sym; + struct menu *menu; + + menu = rootmenu.list; + while (menu) { + if ((sym = menu->sym)) + print_symbol(out, menu); + else if ((prop = menu->prompt)) { + switch (prop->type) { + case P_COMMENT: + fputs("\ncomment ", out); + print_quoted_string(out, prop->text); + fputs("\n", out); + break; + case P_MENU: + fputs("\nmenu ", out); + print_quoted_string(out, prop->text); + fputs("\n", out); + break; + default: + ; + } + if (!expr_is_yes(prop->visible.expr)) { + fputs(" depends ", out); + expr_fprint(prop->visible.expr, out); + fputc('\n', out); + } + fputs("\n", out); + } + + if (menu->list) + menu = menu->list; + else if (menu->next) + menu = menu->next; + else while ((menu = menu->parent)) { + if (menu->prompt && menu->prompt->type == P_MENU) + fputs("\nendmenu\n", out); + if (menu->next) { + menu = menu->next; + break; + } + } + } +} + +#include "lex.zconf.c" +#include "util.c" +#include "confdata.c" +#include "expr.c" +#include "symbol.c" +#include "menu.c" -- cgit v1.2.3 From 451518eba5be299ae1ef004112a6ecdc3b2e26c0 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 20 Apr 2006 21:00:14 +0000 Subject: modify the kconfig system for openwrt git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3683 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/Makefile | 8 ++++---- scripts/config/README | 2 ++ scripts/config/conf.c | 4 ++-- scripts/config/confdata.c | 14 +++++++------- scripts/config/mconf.c | 38 ++++++++++++++++++-------------------- scripts/config/menu.c | 3 +++ scripts/config/symbol.c | 13 +++++++++++-- scripts/config/zconf.tab.c_shipped | 2 +- scripts/config/zconf.y | 2 +- 9 files changed, 49 insertions(+), 37 deletions(-) create mode 100644 scripts/config/README (limited to 'scripts/config/zconf.y') diff --git a/scripts/config/Makefile b/scripts/config/Makefile index 04e8330a01..a731a40e7c 100644 --- a/scripts/config/Makefile +++ b/scripts/config/Makefile @@ -1,5 +1,5 @@ # =========================================================================== -# Kernel configuration targets +# OpenWrt configuration targets # These targets are used from top-level makefile # =========================================================================== @@ -40,10 +40,10 @@ lex.zconf.c: zconf.l zconf.hash.c: zconf.gperf %.tab.c: %.y - bison -l -b $* -p $(notdir $*) $< && cp $@ $@_shipped || cp $@_shipped $@ + cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $< lex.%.c: %.l - flex -L -P$(notdir $*) -o$@ $< && cp $@ $@_shipped || cp $@_shipped $@ + cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $< %.hash.c: %.gperf - gperf < $< > $@ && cp $@ $@_shipped || cp $@_shipped $@ + cp $@_shipped $@ || gperf < $< > $@ diff --git a/scripts/config/README b/scripts/config/README new file mode 100644 index 0000000000..54aaefb598 --- /dev/null +++ b/scripts/config/README @@ -0,0 +1,2 @@ +These files were taken from the Linux 2.6.16.7 Kernel +Configuration System and modified for the OpenWrt Buildroot. diff --git a/scripts/config/conf.c b/scripts/config/conf.c index 10eeae53d8..cb2093691e 100644 --- a/scripts/config/conf.c +++ b/scripts/config/conf.c @@ -570,7 +570,7 @@ int main(int ac, char **av) case ask_silent: if (stat(".config", &tmpstat)) { printf(_("***\n" - "*** You have not yet configured your kernel!\n" + "*** You have not yet configured your build!\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** \"make menuconfig\" or \"make xconfig\").\n" @@ -619,7 +619,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 kernel configuration.\n\n")); + fprintf(stderr, _("\n*** Error during writing of the build configuration.\n\n")); return 1; } return 0; diff --git a/scripts/config/confdata.c b/scripts/config/confdata.c index b0cbbe2e41..a1abdeb087 100644 --- a/scripts/config/confdata.c +++ b/scripts/config/confdata.c @@ -22,13 +22,10 @@ static int conf_lineno, conf_warnings, conf_unsaved; const char conf_def_filename[] = ".config"; -const char conf_defname[] = "arch/$ARCH/defconfig"; +const char conf_defname[] = "scripts/config/defconfig"; const char *conf_confnames[] = { ".config", - "/lib/modules/$UNAME_RELEASE/.config", - "/etc/kernel-config", - "/boot/config-$UNAME_RELEASE", conf_defname, NULL, }; @@ -375,7 +372,7 @@ int conf_write(const char *name) if (!out_h) return 1; } - sym = sym_lookup("KERNELVERSION", 0); + sym = sym_lookup("OPENWRTVERSION", 0); sym_calc_value(sym); time(&now); env = getenv("KCONFIG_NOTIMESTAMP"); @@ -384,7 +381,7 @@ int conf_write(const char *name) fprintf(out, _("#\n" "# Automatically generated make config: don't edit\n" - "# Linux kernel version: %s\n" + "# OpenWrt version: %s\n" "%s%s" "#\n"), sym_get_string_value(sym), @@ -393,7 +390,7 @@ int conf_write(const char *name) if (out_h) fprintf(out_h, "/*\n" " * Automatically generated C config: don't edit\n" - " * Linux kernel version: %s\n" + " * OpenWrt version: %s\n" "%s%s" " */\n" "#define AUTOCONF_INCLUDED\n", @@ -428,8 +425,11 @@ int conf_write(const char *name) type = sym->type; if (type == S_TRISTATE) { sym_calc_value(modules_sym); +/* tristate always enabled */ +#if 0 if (modules_sym->curr.tri == no) type = S_BOOLEAN; +#endif } switch (type) { case S_BOOLEAN: diff --git a/scripts/config/mconf.c b/scripts/config/mconf.c index bb82bbe49f..69cd56f138 100644 --- a/scripts/config/mconf.c +++ b/scripts/config/mconf.c @@ -29,11 +29,9 @@ static char menu_backtitle[128]; static const char mconf_readme[] = N_( "Overview\n" "--------\n" -"Some kernel features may be built directly into the kernel.\n" -"Some may be made into loadable runtime modules. Some features\n" -"may be completely removed altogether. There are also certain\n" -"kernel parameters which are not really features, but must be\n" -"entered in as decimal or hexadecimal numbers or possibly text.\n" +"Some OpenWrt features may be built directly into the image.\n" +"Some may be made into installable ipkg packages. Some features\n" +"may be completely removed altogether.\n" "\n" "Menu items beginning with [*], or [ ] represent features\n" "configured to be built in, modularized or removed respectively.\n" @@ -115,7 +113,7 @@ static const char mconf_readme[] = N_( "-----------------------------\n" "Menuconfig supports the use of alternate configuration files for\n" "those who, for various reasons, find it necessary to switch\n" -"between different kernel configurations.\n" +"between different OpenWrt configurations.\n" "\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" @@ -148,7 +146,7 @@ static const char mconf_readme[] = N_( "\n" "Optional personality available\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 build options listed in a single\n" "menu, rather than the default multimenu hierarchy, run the menuconfig\n" "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n" "\n" @@ -186,18 +184,18 @@ 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[] = N_( - "There is no help available for this kernel option.\n"), + "There is no help available for this config 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[] = N_( "\n" - "For various reasons, one may wish to keep several different kernel\n" + "For various reasons, one may wish to keep several different OpenWrt\n" "configurations available on a single machine.\n" "\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" + "If you have saved a previous configuration in a file other than\n" + "OpenWrt's default, entering the name of the file here will allow you\n" "to modify that configuration.\n" "\n" "If you are uncertain, then you have probably never used alternate\n" @@ -207,7 +205,7 @@ save_config_text[] = N_( "as an alternate. Leave blank to abort."), save_config_help[] = N_( "\n" - "For various reasons, one may wish to keep different kernel\n" + "For various reasons, one may wish to keep different OpenWrt\n" "configurations available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" @@ -1051,9 +1049,9 @@ int main(int ac, char **av) conf_parse(av[1]); conf_read(NULL); - sym = sym_lookup("KERNELVERSION", 0); + sym = sym_lookup("OPENWRTVERSION", 0); sym_calc_value(sym); - sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), + sprintf(menu_backtitle, _("OpenWrt %s Configuration"), sym_get_string_value(sym)); mode = getenv("MENUCONFIG_MODE"); @@ -1070,7 +1068,7 @@ int main(int ac, char **av) do { cprint_init(); cprint("--yesno"); - cprint(_("Do you wish to save your new kernel configuration?")); + cprint(_("Do you wish to save your new OpenWrt configuration?")); cprint("5"); cprint("60"); stat = exec_conf(); @@ -1079,18 +1077,18 @@ int main(int ac, char **av) if (stat == 0) { if (conf_write(NULL)) { fprintf(stderr, _("\n\n" - "Error during writing of the kernel configuration.\n" - "Your kernel configuration changes were NOT saved." + "Error during writing of the OpenWrt configuration.\n" + "Your configuration changes were NOT saved." "\n\n")); return 1; } printf(_("\n\n" - "*** End of Linux kernel configuration.\n" - "*** Execute 'make' to build the kernel or try 'make help'." + "*** End of OpenWrt configuration.\n" + "*** Execute 'make' to build the OpenWrt or try 'make help'." "\n\n")); } else { fprintf(stderr, _("\n\n" - "Your kernel configuration changes were NOT saved." + "Your configuration changes were NOT saved." "\n\n")); } diff --git a/scripts/config/menu.c b/scripts/config/menu.c index 0fce20cb7f..20fda9b2fc 100644 --- a/scripts/config/menu.c +++ b/scripts/config/menu.c @@ -88,11 +88,14 @@ struct expr *menu_check_dep(struct expr *e) e->left.expr = menu_check_dep(e->left.expr); e->right.expr = menu_check_dep(e->right.expr); break; +/* tristate always enabled */ +#if 0 case E_SYMBOL: /* change 'm' into 'm' && MODULES */ if (e->left.sym == &symbol_mod) return expr_alloc_and(e, expr_alloc_symbol(modules_sym)); break; +#endif default: break; } diff --git a/scripts/config/symbol.c b/scripts/config/symbol.c index 3d7877afcc..b79d81ac13 100644 --- a/scripts/config/symbol.c +++ b/scripts/config/symbol.c @@ -61,10 +61,10 @@ void sym_init(void) if (p) sym_add_default(sym, p); - sym = sym_lookup("KERNELVERSION", 0); + sym = sym_lookup("OPENWRTVERSION", 0); sym->type = S_STRING; sym->flags |= SYMBOL_AUTO; - p = getenv("KERNELVERSION"); + p = getenv("OPENWRTVERSION"); if (p) sym_add_default(sym, p); @@ -81,8 +81,11 @@ enum symbol_type sym_get_type(struct symbol *sym) if (type == S_TRISTATE) { if (sym_is_choice_value(sym) && sym->visible == yes) type = S_BOOLEAN; +/* tristate always enabled */ +#if 0 else if (modules_val == no) type = S_BOOLEAN; +#endif } return type; } @@ -201,7 +204,12 @@ static void sym_calc_visibility(struct symbol *sym) prop->visible.tri = expr_calc_value(prop->visible.expr); tri = E_OR(tri, prop->visible.tri); } +/* tristate always enabled */ +#if 0 if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) +#else + if (tri == mod && (sym->type != S_TRISTATE)) +#endif tri = yes; if (sym->visible != tri) { sym->visible = tri; @@ -354,6 +362,7 @@ void sym_calc_value(struct symbol *sym) if (memcmp(&oldval, &sym->curr, sizeof(oldval))) sym_set_changed(sym); + if (modules_sym == sym) modules_val = modules_sym->curr.tri; diff --git a/scripts/config/zconf.tab.c_shipped b/scripts/config/zconf.tab.c_shipped index dbf1e039ed..8060dc6a06 100644 --- a/scripts/config/zconf.tab.c_shipped +++ b/scripts/config/zconf.tab.c_shipped @@ -1922,7 +1922,7 @@ void conf_parse(const char *name) sym_init(); menu_init(); modules_sym = sym_lookup("MODULES", 0); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "OpenWrt Configuration", NULL); #if YYDEBUG if (getenv("ZCONF_DEBUG")) diff --git a/scripts/config/zconf.y b/scripts/config/zconf.y index 1f61fba6aa..83243f5efe 100644 --- a/scripts/config/zconf.y +++ b/scripts/config/zconf.y @@ -459,7 +459,7 @@ void conf_parse(const char *name) sym_init(); menu_init(); modules_sym = sym_lookup("MODULES", 0); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "OpenWrt Configuration", NULL); #if YYDEBUG if (getenv("ZCONF_DEBUG")) -- cgit v1.2.3