summaryrefslogtreecommitdiff
path: root/scripts/kconfig/conf.c
diff options
context:
space:
mode:
authorDenys Vlasenko2017-09-07 14:40:28 +0200
committerDenys Vlasenko2017-09-07 14:40:28 +0200
commit0b1c62934215a08351a80977c7cf8e9346683a1e (patch)
tree5cfe2efe65bf95134e2db1803ab528bfdbaa8632 /scripts/kconfig/conf.c
parent9d858f5717cfc261d2ee80efff954acd7b1e5c00 (diff)
downloadbusybox-0b1c62934215a08351a80977c7cf8e9346683a1e.zip
busybox-0b1c62934215a08351a80977c7cf8e9346683a1e.tar.gz
build system: fix "allnoconfig" to clear all options. Closes 10296
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r--scripts/kconfig/conf.c54
1 files changed, 52 insertions, 2 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index ea2446a..e89637e 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -76,14 +76,51 @@ static void conf_askvalue(struct symbol *sym, const char *def)
line[0] = '\n';
line[1] = 0;
+ line[2] = 0;
if (!sym_is_changable(sym)) {
printf("%s\n", def);
- line[0] = '\n';
- line[1] = 0;
return;
}
+ // If autoconf run (allnoconfig and such), reset bool and tristates:
+ // "select ITEM" sets ITEM=y and then parent item might have been
+ // reset to "n" later. Try to set ITEM to "n" on the second run.
+ if (type == S_BOOLEAN || type == S_TRISTATE) {
+ switch (input_mode) {
+ case set_yes:
+ if (sym_tristate_within_range(sym, yes)) {
+ line[0] = 'y';
+ line[1] = '\n';
+ printf("%s", line);
+ return;
+ }
+ case set_mod:
+ if (type == S_TRISTATE) {
+ if (sym_tristate_within_range(sym, mod)) {
+ line[0] = 'm';
+ line[1] = '\n';
+ printf("%s", line);
+ return;
+ }
+ } else {
+ if (sym_tristate_within_range(sym, yes)) {
+ line[0] = 'y';
+ line[1] = '\n';
+ printf("%s", line);
+ return;
+ }
+ }
+ case set_no:
+ if (sym_tristate_within_range(sym, no)) {
+ line[0] = 'n';
+ line[1] = '\n';
+ printf("%s", line);
+ return;
+ }
+ }
+ }
+
switch (input_mode) {
case set_no:
case set_mod:
@@ -590,6 +627,19 @@ int main(int ac, char **av)
if (input_mode != ask_silent) {
rootEntry = &rootmenu;
conf(&rootmenu);
+ // If autoconf run (allnoconfig and such), run it twice:
+ // "select ITEM" sets ITEM=y and then parent item
+ // is reset to "n" later. Second run sets ITEM to "n".
+ // Example: ADDUSER selects LONG_OPTS.
+ // allnoconfig must set _both_ to "n".
+ // Before, LONG_OPTS remained "y".
+ if (input_mode == set_no
+ || input_mode == set_mod
+ || input_mode == set_yes
+ ) {
+ rootEntry = &rootmenu;
+ conf(&rootmenu);
+ }
if (input_mode == ask_all) {
input_mode = ask_silent;
valid_stdin = 1;