aboutsummaryrefslogtreecommitdiff
path: root/scripts/kconfig/conf.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-02-01 22:07:58 +0100
committerRon Yorston <rmy@pobox.com>2017-07-14 15:14:30 +0100
commitc56f1e06c4c470a023b02c7019112eb852f08d44 (patch)
tree96139e253d0ce2e2fb95bdd42af7b31f737fe393 /scripts/kconfig/conf.c
parentb41c851312876dbf146fb674265b86c72ed611ab (diff)
downloadbusybox-w32-c56f1e06c4c470a023b02c7019112eb852f08d44.tar.gz
busybox-w32-c56f1e06c4c470a023b02c7019112eb852f08d44.tar.bz2
busybox-w32-c56f1e06c4c470a023b02c7019112eb852f08d44.zip
kbuild: support at least non-interactive mode on Windows
without POSIX, kbuild has some trouble compiling its support executables. Luckily, the parts that really lean on POSIX functionality are pretty much all only needed when configuring the build interactively. When compiling BusyBox for Win32, we do not actually need interactive configuration at all: we simply choose the default. Therefore, a lot of the stuff that is typically built for the Kconfig system is totally unnecessary (such as: compiling documentation via fork()&exec(), changing the window size, etc). Liberally put all of the problematic code behind #ifndef __MINGW32__ guards, just to get `make mingw64_defconfig` going in Git for Windows' SDK (which is a special-purpose version of MSYS2). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r--scripts/kconfig/conf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index ea2446a89..41ac23936 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -153,9 +153,14 @@ static void conf_askvalue(struct symbol *sym, const char *def)
153 break; 153 break;
154 } 154 }
155 case set_random: 155 case set_random:
156#ifdef __MINGW32__
157 fprintf(stderr, "set_random not supported\n");
158 exit(1);
159#else
156 do { 160 do {
157 val = (tristate)(random() % 3); 161 val = (tristate)(random() % 3);
158 } while (!sym_tristate_within_range(sym, val)); 162 } while (!sym_tristate_within_range(sym, val));
163#endif
159 switch (val) { 164 switch (val) {
160 case no: line[0] = 'n'; break; 165 case no: line[0] = 'n'; break;
161 case mod: line[0] = 'm'; break; 166 case mod: line[0] = 'm'; break;
@@ -366,7 +371,12 @@ static int conf_choice(struct menu *menu)
366 continue; 371 continue;
367 break; 372 break;
368 case set_random: 373 case set_random:
374#ifdef __MINGW32__
375 fprintf(stderr, "set_random not supported\n");
376 exit(1);
377#else
369 def = (random() % cnt) + 1; 378 def = (random() % cnt) + 1;
379#endif
370 case set_default: 380 case set_default:
371 case set_yes: 381 case set_yes:
372 case set_mod: 382 case set_mod:
@@ -522,8 +532,13 @@ int main(int ac, char **av)
522 input_mode = set_yes; 532 input_mode = set_yes;
523 break; 533 break;
524 case 'r': 534 case 'r':
535#ifdef __MINGW32__
536 fprintf(stderr, "set_random not supported\n");
537 exit(1);
538#else
525 input_mode = set_random; 539 input_mode = set_random;
526 srandom(time(NULL)); 540 srandom(time(NULL));
541#endif
527 break; 542 break;
528 case 'h': 543 case 'h':
529 case '?': 544 case '?':