diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-02-01 22:07:58 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-07-14 15:14:30 +0100 |
commit | c56f1e06c4c470a023b02c7019112eb852f08d44 (patch) | |
tree | 96139e253d0ce2e2fb95bdd42af7b31f737fe393 /scripts/kconfig/symbol.c | |
parent | b41c851312876dbf146fb674265b86c72ed611ab (diff) | |
download | busybox-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/symbol.c')
-rw-r--r-- | scripts/kconfig/symbol.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 3d7877afc..63199cd93 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -6,8 +6,10 @@ | |||
6 | #include <ctype.h> | 6 | #include <ctype.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <string.h> | 8 | #include <string.h> |
9 | #ifndef __MINGW32__ | ||
9 | #include <regex.h> | 10 | #include <regex.h> |
10 | #include <sys/utsname.h> | 11 | #include <sys/utsname.h> |
12 | #endif | ||
11 | 13 | ||
12 | #define LKC_DIRECT_LINK | 14 | #define LKC_DIRECT_LINK |
13 | #include "lkc.h" | 15 | #include "lkc.h" |
@@ -44,7 +46,9 @@ void sym_add_default(struct symbol *sym, const char *def) | |||
44 | void sym_init(void) | 46 | void sym_init(void) |
45 | { | 47 | { |
46 | struct symbol *sym; | 48 | struct symbol *sym; |
49 | #ifndef __MINGW32__ | ||
47 | struct utsname uts; | 50 | struct utsname uts; |
51 | #endif | ||
48 | char *p; | 52 | char *p; |
49 | static bool inited = false; | 53 | static bool inited = false; |
50 | 54 | ||
@@ -52,7 +56,9 @@ void sym_init(void) | |||
52 | return; | 56 | return; |
53 | inited = true; | 57 | inited = true; |
54 | 58 | ||
59 | #ifndef __MINGW32__ | ||
55 | uname(&uts); | 60 | uname(&uts); |
61 | #endif | ||
56 | 62 | ||
57 | sym = sym_lookup("ARCH", 0); | 63 | sym = sym_lookup("ARCH", 0); |
58 | sym->type = S_STRING; | 64 | sym->type = S_STRING; |
@@ -71,7 +77,11 @@ void sym_init(void) | |||
71 | sym = sym_lookup("UNAME_RELEASE", 0); | 77 | sym = sym_lookup("UNAME_RELEASE", 0); |
72 | sym->type = S_STRING; | 78 | sym->type = S_STRING; |
73 | sym->flags |= SYMBOL_AUTO; | 79 | sym->flags |= SYMBOL_AUTO; |
80 | #ifdef __MINGW32__ | ||
81 | sym_add_default(sym, "UNKNOWN"); | ||
82 | #else | ||
74 | sym_add_default(sym, uts.release); | 83 | sym_add_default(sym, uts.release); |
84 | #endif | ||
75 | } | 85 | } |
76 | 86 | ||
77 | enum symbol_type sym_get_type(struct symbol *sym) | 87 | enum symbol_type sym_get_type(struct symbol *sym) |
@@ -720,6 +730,10 @@ struct symbol *sym_find(const char *name) | |||
720 | 730 | ||
721 | struct symbol **sym_re_search(const char *pattern) | 731 | struct symbol **sym_re_search(const char *pattern) |
722 | { | 732 | { |
733 | #ifdef __MINGW32__ | ||
734 | fprintf(stderr, "NOTIMPL: sym_re_search\n"); | ||
735 | exit(1); | ||
736 | #else | ||
723 | struct symbol *sym, **sym_arr = NULL; | 737 | struct symbol *sym, **sym_arr = NULL; |
724 | int i, cnt, size; | 738 | int i, cnt, size; |
725 | regex_t re; | 739 | regex_t re; |
@@ -752,6 +766,7 @@ struct symbol **sym_re_search(const char *pattern) | |||
752 | regfree(&re); | 766 | regfree(&re); |
753 | 767 | ||
754 | return sym_arr; | 768 | return sym_arr; |
769 | #endif | ||
755 | } | 770 | } |
756 | 771 | ||
757 | 772 | ||