diff options
author | Ron Yorston <rmy@pobox.com> | 2022-10-30 08:25:45 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-10-30 08:25:45 +0000 |
commit | 7390f29cfc9a3cc0636e20f84f24fbd05f821720 (patch) | |
tree | ee040facd1f276cb5daf733092f137527c75630f /scripts/basic/split-include.c | |
parent | d71cb67ff91762ae78e87440b87d7c9a160b2937 (diff) | |
download | busybox-w32-7390f29cfc9a3cc0636e20f84f24fbd05f821720.tar.gz busybox-w32-7390f29cfc9a3cc0636e20f84f24fbd05f821720.tar.bz2 busybox-w32-7390f29cfc9a3cc0636e20f84f24fbd05f821720.zip |
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)
Diffstat (limited to 'scripts/basic/split-include.c')
-rw-r--r-- | scripts/basic/split-include.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 []) | |||
197 | * So by having an initial \n, strstr will find exact matches. | 197 | * So by having an initial \n, strstr will find exact matches. |
198 | */ | 198 | */ |
199 | 199 | ||
200 | #ifdef __MINGW32__ | ||
201 | fp_find = popen("find . -type f -name \"*.h\" -print", "r"); | ||
202 | #else | ||
200 | fp_find = popen("find * -type f -name \"*.h\" -print", "r"); | 203 | fp_find = popen("find * -type f -name \"*.h\" -print", "r"); |
204 | #endif | ||
201 | if (fp_find == 0) | 205 | if (fp_find == 0) |
202 | ERROR_EXIT( "find" ); | 206 | ERROR_EXIT( "find" ); |
203 | 207 | ||
204 | line[0] = '\n'; | 208 | line[0] = '\n'; |
205 | while (fgets(line+1, buffer_size, fp_find)) | 209 | while (fgets(line+1, buffer_size, fp_find)) |
206 | { | 210 | { |
211 | #ifdef __MINGW32__ | ||
212 | line[2] = '\n'; | ||
213 | # define line (line + 2) | ||
214 | #endif | ||
207 | if (strstr(list_target, line) == NULL) | 215 | if (strstr(list_target, line) == NULL) |
208 | { | 216 | { |
209 | /* | 217 | /* |
@@ -226,6 +234,9 @@ int main(int argc, const char * argv []) | |||
226 | ERROR_EXIT(line); | 234 | ERROR_EXIT(line); |
227 | } | 235 | } |
228 | } | 236 | } |
237 | #ifdef __MINGW32__ | ||
238 | # undef line | ||
239 | #endif | ||
229 | } | 240 | } |
230 | 241 | ||
231 | if (pclose(fp_find) != 0) | 242 | if (pclose(fp_find) != 0) |