From 7390f29cfc9a3cc0636e20f84f24fbd05f821720 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 30 Oct 2022 08:25:45 +0000 Subject: build system: allow building with w64devkit Make some adjustments to the build system to allow busybox-w32 to be built with w64devkit: - Strip drive prefix from CURDIR in Makefile to avoid confusing make with colons. - Limit file redirection to a subshell in the usage_compressed and embedded_scripts scripts. Otherwise it isn't possible to move the open generated file on Windows. - Change the option tests in Kbuild.include to allow for /dev/null not existing on Windows. - Create host binaries without a '.exe' extension. Otherwise they're rebuilt more often than necessary. - Modify split-include.c to allow for Windows' popen() not expanding wildcards. (GitHub issue #239) --- scripts/basic/split-include.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/basic') diff --git a/scripts/basic/split-include.c b/scripts/basic/split-include.c index 290bea2fb..a85ede8ef 100644 --- a/scripts/basic/split-include.c +++ b/scripts/basic/split-include.c @@ -197,13 +197,21 @@ int main(int argc, const char * argv []) * So by having an initial \n, strstr will find exact matches. */ +#ifdef __MINGW32__ + fp_find = popen("find . -type f -name \"*.h\" -print", "r"); +#else fp_find = popen("find * -type f -name \"*.h\" -print", "r"); +#endif if (fp_find == 0) ERROR_EXIT( "find" ); line[0] = '\n'; while (fgets(line+1, buffer_size, fp_find)) { +#ifdef __MINGW32__ + line[2] = '\n'; +# define line (line + 2) +#endif if (strstr(list_target, line) == NULL) { /* @@ -226,6 +234,9 @@ int main(int argc, const char * argv []) ERROR_EXIT(line); } } +#ifdef __MINGW32__ +# undef line +#endif } if (pclose(fp_find) != 0) -- cgit v1.2.3-55-g6feb