From c56f1e06c4c470a023b02c7019112eb852f08d44 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 1 Feb 2017 22:07:58 +0100 Subject: 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 --- scripts/basic/docproc.c | 15 +++++++++++++++ scripts/basic/split-include.c | 13 ++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'scripts/basic') diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 720098a23..bfc1a9844 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c @@ -38,7 +38,9 @@ #include #include #include +#ifndef __MINGW32__ #include +#endif //bbox disabled: #include /* exitstatus is used to keep track of any failing calls to kernel-doc, @@ -78,12 +80,24 @@ void usage (void) */ void exec_kernel_doc(char **svec) { +#ifndef __MINGW32__ pid_t pid; int ret; +#endif char *real_filename; int rflen; /* Make sure output generated so far are flushed */ +#ifdef __MINGW32__ + fflush(stdout); + rflen = strlen(getenv("SRCTREE")); + rflen += strlen(KERNELDOCPATH KERNELDOC); + real_filename = alloca(rflen + 1); + strcpy(real_filename, getenv("SRCTREE")); + strcat(real_filename, KERNELDOCPATH KERNELDOC); + fprintf(stderr, "NOTIMPL: exec %s\n", real_filename); + exit(1); +#else fflush(stdout); switch(pid=fork()) { case -1: @@ -106,6 +120,7 @@ void exec_kernel_doc(char **svec) exitstatus |= WEXITSTATUS(ret); else exitstatus = 0xff; +#endif } /* Types used to create list of all exported symbols in a number of files */ diff --git a/scripts/basic/split-include.c b/scripts/basic/split-include.c index e328788e2..8127fe261 100644 --- a/scripts/basic/split-include.c +++ b/scripts/basic/split-include.c @@ -39,8 +39,6 @@ exit(1); \ } - - int main(int argc, const char * argv []) { const char * str_my_name; @@ -89,7 +87,11 @@ int main(int argc, const char * argv []) /* Make output directory if needed. */ if (stat(str_dir_config, &stat_buf) != 0) { +#ifdef __MINGW32__ + if (mkdir(str_dir_config) != 0) +#else if (mkdir(str_dir_config, 0755) != 0) +#endif ERROR_EXIT(str_dir_config); } @@ -148,7 +150,12 @@ int main(int argc, const char * argv []) { ptarget[islash] = '\0'; if (stat(ptarget, &stat_buf) != 0 - && mkdir(ptarget, 0755) != 0) +#ifdef __MINGW32__ + && mkdir(ptarget) != 0 +#else + && mkdir(ptarget, 0755) != 0 +#endif + ) ERROR_EXIT( ptarget ); ptarget[islash] = '/'; } -- cgit v1.2.3-55-g6feb