aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-09-07 14:40:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-09-07 14:40:28 +0200
commit0b1c62934215a08351a80977c7cf8e9346683a1e (patch)
tree5cfe2efe65bf95134e2db1803ab528bfdbaa8632
parent9d858f5717cfc261d2ee80efff954acd7b1e5c00 (diff)
downloadbusybox-w32-0b1c62934215a08351a80977c7cf8e9346683a1e.tar.gz
busybox-w32-0b1c62934215a08351a80977c7cf8e9346683a1e.tar.bz2
busybox-w32-0b1c62934215a08351a80977c7cf8e9346683a1e.zip
build system: fix "allnoconfig" to clear all options. Closes 10296
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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 ea2446a89..e89637e7c 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)
76 76
77 line[0] = '\n'; 77 line[0] = '\n';
78 line[1] = 0; 78 line[1] = 0;
79 line[2] = 0;
79 80
80 if (!sym_is_changable(sym)) { 81 if (!sym_is_changable(sym)) {
81 printf("%s\n", def); 82 printf("%s\n", def);
82 line[0] = '\n';
83 line[1] = 0;
84 return; 83 return;
85 } 84 }
86 85
86 // If autoconf run (allnoconfig and such), reset bool and tristates:
87 // "select ITEM" sets ITEM=y and then parent item might have been
88 // reset to "n" later. Try to set ITEM to "n" on the second run.
89 if (type == S_BOOLEAN || type == S_TRISTATE) {
90 switch (input_mode) {
91 case set_yes:
92 if (sym_tristate_within_range(sym, yes)) {
93 line[0] = 'y';
94 line[1] = '\n';
95 printf("%s", line);
96 return;
97 }
98 case set_mod:
99 if (type == S_TRISTATE) {
100 if (sym_tristate_within_range(sym, mod)) {
101 line[0] = 'm';
102 line[1] = '\n';
103 printf("%s", line);
104 return;
105 }
106 } else {
107 if (sym_tristate_within_range(sym, yes)) {
108 line[0] = 'y';
109 line[1] = '\n';
110 printf("%s", line);
111 return;
112 }
113 }
114 case set_no:
115 if (sym_tristate_within_range(sym, no)) {
116 line[0] = 'n';
117 line[1] = '\n';
118 printf("%s", line);
119 return;
120 }
121 }
122 }
123
87 switch (input_mode) { 124 switch (input_mode) {
88 case set_no: 125 case set_no:
89 case set_mod: 126 case set_mod:
@@ -590,6 +627,19 @@ int main(int ac, char **av)
590 if (input_mode != ask_silent) { 627 if (input_mode != ask_silent) {
591 rootEntry = &rootmenu; 628 rootEntry = &rootmenu;
592 conf(&rootmenu); 629 conf(&rootmenu);
630 // If autoconf run (allnoconfig and such), run it twice:
631 // "select ITEM" sets ITEM=y and then parent item
632 // is reset to "n" later. Second run sets ITEM to "n".
633 // Example: ADDUSER selects LONG_OPTS.
634 // allnoconfig must set _both_ to "n".
635 // Before, LONG_OPTS remained "y".
636 if (input_mode == set_no
637 || input_mode == set_mod
638 || input_mode == set_yes
639 ) {
640 rootEntry = &rootmenu;
641 conf(&rootmenu);
642 }
593 if (input_mode == ask_all) { 643 if (input_mode == ask_all) {
594 input_mode = ask_silent; 644 input_mode = ask_silent;
595 valid_stdin = 1; 645 valid_stdin = 1;