diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-21 09:27:36 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-21 09:51:27 +0000 |
commit | 475c1112864bf299146fe8146e76c47dc64c3092 (patch) | |
tree | 8eb885d945ffb837abe7c0f724fbe1c0019c6a2c | |
parent | 174a145dcdf098d703ce31e0269fdc902b2a86f6 (diff) | |
download | busybox-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-- | Makefile | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -306,6 +306,15 @@ KALLSYMS = scripts/kallsyms | |||
306 | PERL = perl | 306 | PERL = perl |
307 | CHECK = sparse | 307 | CHECK = sparse |
308 | 308 | ||
309 | # Handle MSYS2 weirdness | ||
310 | ifneq ($(CROSS_COMPILE),) | ||
311 | ifeq ($(shell command -v $(AR)),) | ||
312 | AR := $(CROSS_COMPILE)gcc-ar | ||
313 | STRIP := strip | ||
314 | WINDRES := windres | ||
315 | endif | ||
316 | endif | ||
317 | |||
309 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) | 318 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) |
310 | MODFLAGS = -DMODULE | 319 | MODFLAGS = -DMODULE |
311 | CFLAGS_MODULE = $(MODFLAGS) | 320 | CFLAGS_MODULE = $(MODFLAGS) |