summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-10 13:14:15 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-10 13:14:15 +0000
commit7738ddaa1197c6201886e1c8f6837af5c2c47611 (patch)
tree12e2672ee9e34031fce0c334913ab7a4cb3e2026
parent9c2d269cfa77cf10eeb9acb24f5eab084a66644a (diff)
- pull kconfig from linux-2.6.27
-rw-r--r--extra/config/Makefile6
-rw-r--r--extra/config/Makefile.kconfig4
-rw-r--r--extra/config/README.uClibc3
-rw-r--r--extra/config/conf.c178
-rw-r--r--extra/config/confdata.c101
-rw-r--r--extra/config/expr.h4
-rw-r--r--extra/config/kconfig-language.txt41
-rw-r--r--extra/config/kconfig-to-uclibc.patch.gzbin5989 -> 5699 bytes
-rw-r--r--extra/config/lex.zconf.c_shipped69
-rw-r--r--extra/config/lkc.h29
-rw-r--r--extra/config/lkc_proto.h2
-rw-r--r--extra/config/lxdialog/inputbox.c2
-rw-r--r--extra/config/mconf.c3
-rw-r--r--extra/config/menu.c64
-rw-r--r--extra/config/symbol.c118
-rw-r--r--extra/config/util.c2
-rw-r--r--extra/config/zconf.l1
-rw-r--r--extra/config/zconf.tab.c_shipped302
-rw-r--r--extra/config/zconf.y13
19 files changed, 538 insertions, 404 deletions
diff --git a/extra/config/Makefile b/extra/config/Makefile
index 45ec1f47e..836f1f9f1 100644
--- a/extra/config/Makefile
+++ b/extra/config/Makefile
@@ -13,7 +13,7 @@ endif
-include .depend
.depend: $(wildcard *.h *.c)
- $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) -MM *.c > .depend 2>/dev/null || :
+ $(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) -MM *.c > .depend 2>/dev/null || :
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
@@ -37,7 +37,9 @@ clean:
$(Q)rm -f $(clean-files) conf
distclean: clean
$(Q)rm -f $(lxdialog) $(conf-objs) $(mconf-objs) $(kxgettext-objs) \
- $(hostprogs-y) $(qconf-cxxobjs) $(qconf-objs) $(gconf-objs) .depend
+ $(hostprogs-y) $(qconf-cxxobjs) $(qconf-objs) $(gconf-objs) \
+ .depend
+ $(Q)rm -r -f $(top_builddir)include/config
FORCE:
.PHONY: FORCE clean distclean
diff --git a/extra/config/Makefile.kconfig b/extra/config/Makefile.kconfig
index 32e8c5a22..fa1a7d565 100644
--- a/extra/config/Makefile.kconfig
+++ b/extra/config/Makefile.kconfig
@@ -36,10 +36,10 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
--output $(obj)/config.pot
$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
$(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
- $(Q)(for i in `ls arch/`; \
+ $(Q)(for i in `ls arch/*/Kconfig`; \
do \
echo " GEN $$i"; \
- $(obj)/kxgettext arch/$$i/Kconfig \
+ $(obj)/kxgettext $$i \
>> $(obj)/config.pot; \
done )
$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
diff --git a/extra/config/README.uClibc b/extra/config/README.uClibc
index fa1a0018f..b05cabc2a 100644
--- a/extra/config/README.uClibc
+++ b/extra/config/README.uClibc
@@ -5,8 +5,9 @@ To update:
cd extra/config.new
cp /usr/src/linux/Documentation/kbuild/kconfig-language.txt .
mv Makefile Makefile.kconfig
- patch -p1 < ../config/kconfig-to-uclibc.patch
+ zcat ../config/kconfig-to-uclibc.patch.gz | patch -p1
cp ../config/README.uClibc .
+ cp ../config/Makefile .
cd ..
rm -rf config
mv config.new config
diff --git a/extra/config/conf.c b/extra/config/conf.c
index 6735bfe76..02b2600c2 100644
--- a/extra/config/conf.c
+++ b/extra/config/conf.c
@@ -32,6 +32,7 @@ char *defconfig_file;
static int indent = 1;
static int valid_stdin = 1;
+static int sync_kconfig;
static int conf_cnt;
static char line[128];
static struct menu *rootEntry;
@@ -65,7 +66,7 @@ static void strip(char *str)
static void check_stdin(void)
{
- if (!valid_stdin && input_mode == ask_silent) {
+ if (!valid_stdin) {
printf(_("aborted!\n\n"));
printf(_("Console input/output is redirected. "));
printf(_("Run 'make oldconfig' to update configuration.\n\n"));
@@ -76,7 +77,6 @@ static void check_stdin(void)
static int conf_askvalue(struct symbol *sym, const char *def)
{
enum symbol_type type = sym_get_type(sym);
- tristate val;
if (!sym_has_value(sym))
printf(_("(NEW) "));
@@ -92,15 +92,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
}
switch (input_mode) {
- case set_no:
- case set_mod:
- case set_yes:
- case set_random:
- if (sym_has_value(sym)) {
- printf("%s\n", def);
- return 0;
- }
- break;
case ask_new:
case ask_silent:
if (sym_has_value(sym)) {
@@ -112,9 +103,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
fflush(stdout);
fgets(line, 128, stdin);
return 1;
- case set_default:
- printf("%s\n", def);
- return 1;
default:
break;
}
@@ -128,52 +116,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
default:
;
}
- switch (input_mode) {
- case set_yes:
- if (sym_tristate_within_range(sym, yes)) {
- line[0] = 'y';
- line[1] = '\n';
- line[2] = 0;
- break;
- }
- case set_mod:
- if (type == S_TRISTATE) {
- if (sym_tristate_within_range(sym, mod)) {
- line[0] = 'm';
- line[1] = '\n';
- line[2] = 0;
- break;
- }
- } else {
- if (sym_tristate_within_range(sym, yes)) {
- line[0] = 'y';
- line[1] = '\n';
- line[2] = 0;
- break;
- }
- }
- case set_no:
- if (sym_tristate_within_range(sym, no)) {
- line[0] = 'n';
- line[1] = '\n';
- line[2] = 0;
- break;
- }
- case set_random:
- do {
- val = (tristate)(rand() % 3);
- } while (!sym_tristate_within_range(sym, val));
- switch (val) {
- case no: line[0] = 'n'; break;
- case mod: line[0] = 'm'; break;
- case yes: line[0] = 'y'; break;
- }
- line[1] = '\n';
- line[2] = 0;
- break;
- default:
- break;
- }
printf("%s", line);
return 1;
}
@@ -374,15 +316,7 @@ static int conf_choice(struct menu *menu)
else
continue;
break;
- case set_random:
- if (is_new)
- def = (rand() % cnt) + 1;
- case set_default:
- case set_yes:
- case set_mod:
- case set_no:
- cnt = def;
- printf("%d\n", cnt);
+ default:
break;
}
@@ -507,11 +441,11 @@ int main(int ac, char **av)
while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) {
switch (opt) {
case 'o':
- input_mode = ask_new;
+ input_mode = ask_silent;
break;
case 's':
input_mode = ask_silent;
- valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ sync_kconfig = 1;
break;
case 'd':
input_mode = set_default;
@@ -549,6 +483,19 @@ int main(int ac, char **av)
name = av[optind];
conf_parse(name);
//zconfdump(stdout);
+ if (sync_kconfig) {
+ if (stat(".config", &tmpstat)) {
+ fprintf(stderr, _("***\n"
+ "*** You have not yet configured!\n"
+ "*** (missing .config file)\n"
+ "***\n"
+ "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
+ "*** \"make menuconfig\" or \"make xconfig\").\n"
+ "***\n"));
+ exit(1);
+ }
+ }
+
switch (input_mode) {
case set_default:
if (!defconfig_file)
@@ -561,16 +508,6 @@ int main(int ac, char **av)
}
break;
case ask_silent:
- if (stat(".config", &tmpstat)) {
- printf(_("***\n"
- "*** You have not yet configured!\n"
- "*** (missing .config file)\n"
- "***\n"
- "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
- "*** \"make menuconfig\" or \"make xconfig\").\n"
- "***\n"));
- exit(1);
- }
case ask_all:
case ask_new:
conf_read(NULL);
@@ -600,35 +537,66 @@ int main(int ac, char **av)
break;
}
- if (input_mode != ask_silent) {
+ if (sync_kconfig) {
+ if (conf_get_changed()) {
+ name = getenv("KCONFIG_NOSILENTUPDATE");
+ if (name && *name) {
+ fprintf(stderr,
+ _("\n*** configuration requires explicit update.\n\n"));
+ return 1;
+ }
+ }
+ valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ }
+
+ switch (input_mode) {
+ case set_no:
+ conf_set_all_new_symbols(def_no);
+ break;
+ case set_yes:
+ conf_set_all_new_symbols(def_yes);
+ break;
+ case set_mod:
+ conf_set_all_new_symbols(def_mod);
+ break;
+ case set_random:
+ conf_set_all_new_symbols(def_random);
+ break;
+ case set_default:
+ conf_set_all_new_symbols(def_default);
+ break;
+ case ask_new:
+ case ask_all:
rootEntry = &rootmenu;
conf(&rootmenu);
- if (input_mode == ask_all) {
- input_mode = ask_silent;
- valid_stdin = 1;
+ input_mode = ask_silent;
+ /* fall through */
+ case ask_silent:
+ /* Update until a loop caused no more changes */
+ do {
+ conf_cnt = 0;
+ check_conf(&rootmenu);
+ } while (conf_cnt);
+ break;
+ }
+
+ if (sync_kconfig) {
+ /* silentoldconfig is used during the build so we shall update autoconf.
+ * All other commands are only used to generate a config.
+ */
+ if (conf_get_changed() && conf_write(NULL)) {
+ fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
+ exit(1);
}
- } else if (conf_get_changed()) {
- name = getenv("KCONFIG_NOSILENTUPDATE");
- if (name && *name) {
- fprintf(stderr, _("\n*** configuration requires explicit update.\n\n"));
+ if (conf_write_autoconf()) {
+ fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
return 1;
}
- } else
- goto skip_check;
-
- do {
- conf_cnt = 0;
- check_conf(&rootmenu);
- } while (conf_cnt);
- if (conf_write(NULL)) {
- fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
- return 1;
- }
-skip_check:
- if (/*input_mode == ask_silent &&*/ conf_write_autoconf()) {
- fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
- return 1;
+ } else {
+ if (conf_write(NULL)) {
+ fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
+ exit(1);
+ }
}
-
return 0;
}
diff --git a/extra/config/confdata.c b/extra/config/confdata.c
index 59a2fec78..9da48ebdc 100644
--- a/extra/config/confdata.c
+++ b/extra/config/confdata.c
@@ -212,7 +212,7 @@ load:
sym = NULL;
switch (line[0]) {
case '#':
- if (line[1]!=' ')
+ if (line[1] != ' ')
continue;
p = strchr(line + 2, ' ');
if (!p)
@@ -223,7 +223,7 @@ load:
if (def == S_DEF_USER) {
sym = sym_find(line + 2);
if (!sym) {
- conf_warning("trying to assign nonexistent symbol %s", line + 2);
+ sym_add_change_count(1);
break;
}
} else {
@@ -244,10 +244,12 @@ load:
;
}
break;
- case 'A' ... 'Z':
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
p = strchr(line, '=');
- if (!p)
+ if (!p) {
+ conf_warning("unexpected data '%s'", line);
continue;
+ }
*p++ = 0;
p2 = strchr(p, '\n');
if (p2) {
@@ -258,7 +260,7 @@ load:
if (def == S_DEF_USER) {
sym = sym_find(line);
if (!sym) {
- conf_warning("trying to assign nonexistent symbol %s", line);
+ sym_add_change_count(1);
break;
}
} else {
@@ -441,8 +443,10 @@ int conf_write(const char *name)
fprintf(out, _("#\n"
"# Automatically generated make config: don't edit\n"
+ "# Version: %s\n"
"%s%s"
"#\n"),
+ sym_get_string_value(sym),
use_timestamp ? "# " : "",
use_timestamp ? ctime(&now) : "");
@@ -669,8 +673,6 @@ int conf_write_autoconf(void)
time_t now;
int i, l;
- return 0;
-
sym_clear_all_valid();
file_write_dep("include/config/auto.conf.cmd");
@@ -693,14 +695,17 @@ int conf_write_autoconf(void)
time(&now);
fprintf(out, "#\n"
"# Automatically generated make config: don't edit\n"
+ "# Version: %s\n"
"# %s"
"#\n",
- ctime(&now));
+ sym_get_string_value(sym), ctime(&now));
fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n"
+ " * Version: %s\n"
" * %s"
- " */\n",
- ctime(&now));
+ " */\n"
+ "#define AUTOCONF_INCLUDED\n",
+ sym_get_string_value(sym), ctime(&now));
for_all_symbols(i, sym) {
sym_calc_value(sym);
@@ -713,8 +718,8 @@ int conf_write_autoconf(void)
case no:
break;
case mod:
- fprintf(out, "%s=m\n", sym->name);
- fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
+ fprintf(out, "CONFIG_%s=m\n", sym->name);
+ fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
break;
case yes:
fprintf(out, "%s=y\n", sym->name);
@@ -763,7 +768,7 @@ int conf_write_autoconf(void)
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
- name = "include/linux/autoconf.h";
+ name = "include/config/autoconf.h";
if (rename(".tmpconfig.h", name))
return 1;
name = getenv("KCONFIG_AUTOCONFIG");
@@ -805,3 +810,73 @@ void conf_set_changed_callback(void (*fn)(void))
{
conf_changed_callback = fn;
}
+
+
+void conf_set_all_new_symbols(enum conf_def_mode mode)
+{
+ struct symbol *sym, *csym;
+ struct property *prop;
+ struct expr *e;
+ int i, cnt, def;
+
+ for_all_symbols(i, sym) {
+ if (sym_has_value(sym))
+ continue;
+ switch (sym_get_type(sym)) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ switch (mode) {
+ case def_yes:
+ sym->def[S_DEF_USER].tri = yes;
+ break;
+ case def_mod:
+ sym->def[S_DEF_USER].tri = mod;
+ break;
+ case def_no:
+ sym->def[S_DEF_USER].tri = no;
+ break;
+ case def_random:
+ sym->def[S_DEF_USER].tri = (tristate)(rand() % 3);
+ break;
+ default:
+ continue;
+ }
+ if (!sym_is_choice(sym) || mode != def_random)
+ sym->flags |= SYMBOL_DEF_USER;
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ if (modules_sym)
+ sym_calc_value(modules_sym);
+
+ if (mode != def_random)
+ return;
+
+ for_all_symbols(i, csym) {
+ if (sym_has_value(csym) || !sym_is_choice(csym))
+ continue;
+
+ sym_calc_value(csym);
+ prop = sym_get_choice_prop(csym);
+ def = -1;
+ while (1) {
+ cnt = 0;
+ expr_list_for_each_sym(prop->expr, e, sym) {
+ if (sym->visible == no)
+ continue;
+ if (def == cnt++) {
+ csym->def[S_DEF_USER].val = sym;
+ break;
+ }
+ }
+ if (def >= 0 || cnt < 2)
+ break;
+ def = (rand() % cnt) + 1;
+ }
+ csym->flags |= SYMBOL_DEF_USER;
+ }
+}
diff --git a/extra/config/expr.h b/extra/config/expr.h
index 9d60dd330..9d4cba1c0 100644
--- a/extra/config/expr.h
+++ b/extra/config/expr.h
@@ -184,12 +184,12 @@ void expr_fprint(struct expr *e, FILE *out);
struct gstr; /* forward */
void expr_gstr_print(struct expr *e, struct gstr *gs);
-static __inline__ int expr_is_yes(struct expr *e)
+static inline int expr_is_yes(struct expr *e)
{
return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes);
}
-static __inline__ int expr_is_no(struct expr *e)
+static inline int expr_is_no(struct expr *e)
{
return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);
}
diff --git a/extra/config/kconfig-language.txt b/extra/config/kconfig-language.txt
index 649cb8799..c412c2458 100644
--- a/extra/config/kconfig-language.txt
+++ b/extra/config/kconfig-language.txt
@@ -104,14 +104,15 @@ applicable everywhere (see syntax).
Reverse dependencies can only be used with boolean or tristate
symbols.
Note:
- select is evil.... select will by brute force set a symbol
- equal to 'y' without visiting the dependencies. So abusing
- select you are able to select a symbol FOO even if FOO depends
- on BAR that is not set. In general use select only for
- non-visible symbols (no prompts anywhere) and for symbols with
- no dependencies. That will limit the usefulness but on the
- other hand avoid the illegal configurations all over. kconfig
- should one day warn about such things.
+ select should be used with care. select will force
+ a symbol to a value without visiting the dependencies.
+ By abusing select you are able to select a symbol FOO even
+ if FOO depends on BAR that is not set.
+ In general use select only for non-visible symbols
+ (no prompts anywhere) and for symbols with no dependencies.
+ That will limit the usefulness but on the other hand avoid
+ the illegal configurations all over.
+ kconfig should one day warn about such things.
- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
This allows to limit the range of possible input values for int
@@ -376,27 +377,3 @@ config FOO
limits FOO to module (=m) or disabled (=n).
-
-Build limited by a third config symbol which may be =y or =m
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-A common idiom that we see (and sometimes have problems with) is this:
-
-When option C in B (module or subsystem) uses interfaces from A (module
-or subsystem), and both A and B are tristate (could be =y or =m if they
-were independent of each other, but they aren't), then we need to limit
-C such that it cannot be built statically if A is built as a loadable
-module. (C already depends on B, so there is no dependency issue to
-take care of here.)
-
-If A is linked statically into the kernel image, C can be built
-statically or as loadable module(s). However, if A is built as loadable
-module(s), then C must be restricted to loadable module(s) also. This
-can be expressed in kconfig language as:
-
-config C
- depends on A = y || A = B
-
-or for real examples, use this command in a kernel tree:
-
-$ find . -name Kconfig\* | xargs grep -ns "depends on.*=.*||.*=" | grep -v orig
-
diff --git a/extra/config/kconfig-to-uclibc.patch.gz b/extra/config/kconfig-to-uclibc.patch.gz
index df28093ba..01c5d34f8 100644
--- a/extra/config/kconfig-to-uclibc.patch.gz
+++ b/extra/config/kconfig-to-uclibc.patch.gz
Binary files differ
diff --git a/extra/config/lex.zconf.c_shipped b/extra/config/lex.zconf.c_shipped
index 6a1ea6f9e..09a1ec8e3 100644
--- a/extra/config/lex.zconf.c_shipped
+++ b/extra/config/lex.zconf.c_shipped
@@ -27,7 +27,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 33
+#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -49,7 +49,7 @@
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
@@ -72,7 +72,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -103,6 +102,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -112,11 +113,12 @@ typedef unsigned int flex_uint32_t;
#else /* ! __cplusplus */
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
@@ -196,14 +198,9 @@ extern FILE *zconfin, *zconfout;
#define unput(c) yyunput( c, (yytext_ptr) )
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
-typedef unsigned int yy_size_t;
+typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -767,6 +764,7 @@ int zconf_flex_debug = 0;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *zconftext;
+#define YY_NO_INPUT 1
/*
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
@@ -853,6 +851,35 @@ void alloc_string(const char *str, int size)
static int yy_init_globals (void );
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int zconflex_destroy (void );
+
+int zconfget_debug (void );
+
+void zconfset_debug (int debug_flag );
+
+YY_EXTRA_TYPE zconfget_extra (void );
+
+void zconfset_extra (YY_EXTRA_TYPE user_defined );
+
+FILE *zconfget_in (void );
+
+void zconfset_in (FILE * in_str );
+
+FILE *zconfget_out (void );
+
+void zconfset_out (FILE * out_str );
+
+int zconfget_leng (void );
+
+char *zconfget_text (void );
+
+int zconfget_lineno (void );
+
+void zconfset_lineno (int line_number );
+
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -895,7 +922,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout )
+#define ECHO fwrite( zconftext, zconfleng, 1, zconfout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1535,7 +1562,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), num_to_read );
+ (yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -1559,6 +1586,14 @@ static int yy_get_next_buffer (void)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
@@ -1945,7 +1980,9 @@ static void zconfensure_buffer_stack (void)
(yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
-
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
@@ -1963,6 +2000,8 @@ static void zconfensure_buffer_stack (void)
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2007,7 +2046,7 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
- * @param str a NUL-terminated string to scan
+ * @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
diff --git a/extra/config/lkc.h b/extra/config/lkc.h
index c55c2fbd7..4a9af6f78 100644
--- a/extra/config/lkc.h
+++ b/extra/config/lkc.h
@@ -11,9 +11,9 @@
#ifndef KBUILD_NO_NLS
# include <libintl.h>
#else
-# define gettext(Msgid) ((const char *) (Msgid))
-# define textdomain(Domainname) ((const char *) (Domainname))
-# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
+static inline const char *gettext(const char *txt) { return txt; }
+static inline void textdomain(const char *domainname) {}
+static inline void bindtextdomain(const char *name, const char *dir) {}
#endif
#ifdef __cplusplus
@@ -42,6 +42,14 @@ extern "C" {
#define TF_PARAM 0x0002
#define TF_OPTION 0x0004
+enum conf_def_mode {
+ def_default,
+ def_yes,
+ def_mod,
+ def_no,
+ def_random
+};
+
#define T_OPT_MODULES 1
#define T_OPT_DEFCONFIG_LIST 2
#define T_OPT_ENV 3
@@ -69,6 +77,7 @@ const char *conf_get_configname(void);
char *conf_get_default_confname(void);
void sym_set_change_count(int count);
void sym_add_change_count(int count);
+void conf_set_all_new_symbols(enum conf_def_mode mode);
/* kconfig_load.c */
void kconfig_load(void);
@@ -116,38 +125,38 @@ struct property *prop_alloc(enum prop_type type, struct symbol *sym);
struct symbol *prop_get_symbol(struct property *prop);
struct property *sym_get_env_prop(struct symbol *sym);
-static __inline__ tristate sym_get_tristate_value(struct symbol *sym)
+static inline tristate sym_get_tristate_value(struct symbol *sym)
{
return sym->curr.tri;
}
-static __inline__ struct symbol *sym_get_choice_value(struct symbol *sym)
+static inline struct symbol *sym_get_choice_value(struct symbol *sym)
{
return (struct symbol *)sym->curr.val;
}
-static __inline__ bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
+static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
{
return sym_set_tristate_value(chval, yes);
}
-static __inline__ bool sym_is_choice(struct symbol *sym)
+static inline bool sym_is_choice(struct symbol *sym)
{
return sym->flags & SYMBOL_CHOICE ? true : false;
}
-static __inline__ bool sym_is_choice_value(struct symbol *sym)
+static inline bool sym_is_choice_value(struct symbol *sym)
{
return sym->flags & SYMBOL_CHOICEVAL ? true : false;
}
-static __inline__ bool sym_is_optional(struct symbol *sym)
+static inline bool sym_is_optional(struct symbol *sym)
{
return sym->flags & SYMBOL_OPTIONAL ? true : false;
}
-static __inline__ bool sym_has_value(struct symbol *sym)
+static inline bool sym_has_value(struct symbol *sym)
{
return sym->flags & SYMBOL_DEF_USER ? true : false;
}
diff --git a/extra/config/lkc_proto.h b/extra/config/lkc_proto.h
index 4d09f6dde..8e6946131 100644
--- a/extra/config/lkc_proto.h
+++ b/extra/config/lkc_proto.h
@@ -21,7 +21,7 @@ P(menu_get_help,const char *,(struct menu *menu));
/* symbol.c */
P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
-P(sym_lookup,struct symbol *,(const char *name, int isconst));
+P(sym_lookup,struct symbol *,(const char *name, int flags));
P(sym_find,struct symbol *,(const char *name));
P(sym_re_search,struct symbol **,(const char *pattern));
P(sym_type_name,const char *,(enum symbol_type type));
diff --git a/extra/config/lxdialog/inputbox.c b/extra/config/lxdialog/inputbox.c
index 4946bd02b..616c60138 100644
--- a/extra/config/lxdialog/inputbox.c
+++ b/extra/config/lxdialog/inputbox.c
@@ -89,7 +89,7 @@ do_resize:
box_y = y + 2;
box_x = (width - box_width) / 2;
draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
- dlg.border.atr, dlg.dialog.atr);
+ dlg.dialog.atr, dlg.border.atr);
print_buttons(dialog, height, width, 0);
diff --git a/extra/config/mconf.c b/extra/config/mconf.c
index 3effa5b5b..d7314f3a3 100644
--- a/extra/config/mconf.c
+++ b/extra/config/mconf.c
@@ -772,7 +772,7 @@ static void conf_string(struct menu *menu)
while (1) {
int res;
- char *heading;
+ const char *heading;
switch (sym_get_type(menu->sym)) {
case S_INT:
@@ -924,3 +924,4 @@ int main(int ac, char **av)
return conf_write_autoconf();
}
+
diff --git a/extra/config/menu.c b/extra/config/menu.c
index 606ceb9e7..07ff8d105 100644
--- a/extra/config/menu.c
+++ b/extra/config/menu.c
@@ -235,18 +235,22 @@ void menu_finalize(struct menu *parent)
sym = parent->sym;
if (parent->list) {
if (sym && sym_is_choice(sym)) {
- /* find the first choice value and find out choice type */
- for (menu = parent->list; menu; menu = menu->next) {
- if (menu->sym) {
- current_entry = parent;
- if (sym->type == S_UNKNOWN)
+ if (sym->type == S_UNKNOWN) {
+ /* find the first choice value to find out choice type */
+ current_entry = parent;
+ for (menu = parent->list; menu; menu = menu->next) {
+ if (menu->sym && menu->sym->type != S_UNKNOWN) {
menu_set_type(menu->sym->type);
- current_entry = menu;
- if (menu->sym->type == S_UNKNOWN)
- menu_set_type(sym->type);
- break;
+ break;
+ }
}
}
+ /* set the type of the remaining choice values */
+ for (menu = parent->list; menu; menu = menu->next) {
+ current_entry = menu;
+ if (menu->sym && menu->sym->type == S_UNKNOWN)
+ menu_set_type(sym->type);
+ }
parentdep = expr_alloc_symbol(sym);
} else if (parent->prompt)
parentdep = parent->prompt->visible.expr;
@@ -313,50 +317,36 @@ void menu_finalize(struct menu *parent)
}
}
for (menu = parent->list; menu; menu = menu->next) {
- if (sym && sym_is_choice(sym) && menu->sym) {
+ if (sym && sym_is_choice(sym) &&
+ menu->sym && !sym_is_choice_value(menu->sym)) {
+ current_entry = menu;
menu->sym->flags |= SYMBOL_CHOICEVAL;
if (!menu->prompt)
menu_warn(menu, "choice value must have a prompt");
for (prop = menu->sym->prop; prop; prop = prop->next) {
- if (prop->type == P_PROMPT && prop->menu != menu) {
- prop_warn(prop, "choice values "
- "currently only support a "
- "single prompt");
- }
if (prop->type == P_DEFAULT)
prop_warn(prop, "defaults for choice "
- "values not supported");
+ "values not supported");
+ if (prop->menu == menu)