aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-21 09:27:36 +0000
committerRon Yorston <rmy@pobox.com>2021-02-21 09:51:27 +0000
commit475c1112864bf299146fe8146e76c47dc64c3092 (patch)
tree8eb885d945ffb837abe7c0f724fbe1c0019c6a2c
parent174a145dcdf098d703ce31e0269fdc902b2a86f6 (diff)
downloadbusybox-w32-475c1112864bf299146fe8146e76c47dc64c3092.tar.gz
busybox-w32-475c1112864bf299146fe8146e76c47dc64c3092.tar.bz2
busybox-w32-475c1112864bf299146fe8146e76c47dc64c3092.zip
win32: work around MSYS2 toolchain weirdness
The Windows/MSYS2/mingw-w64 toolchain has platform-specific prefixes on many of its binaries but not all. As a result the mingw cross-compilation configurations *nearly* work. If we're cross compiling and the generated name $AR doesn't exist as a binary assume were using MSYS2 and make the necessary tweaks.
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a6609ca90..14c4c4440 100644
--- a/Makefile
+++ b/Makefile
@@ -306,6 +306,15 @@ KALLSYMS = scripts/kallsyms
306PERL = perl 306PERL = perl
307CHECK = sparse 307CHECK = sparse
308 308
309# Handle MSYS2 weirdness
310ifneq ($(CROSS_COMPILE),)
311ifeq ($(shell command -v $(AR)),)
312AR := $(CROSS_COMPILE)gcc-ar
313STRIP := strip
314WINDRES := windres
315endif
316endif
317
309CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) 318CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF)
310MODFLAGS = -DMODULE 319MODFLAGS = -DMODULE
311CFLAGS_MODULE = $(MODFLAGS) 320CFLAGS_MODULE = $(MODFLAGS)