From 475c1112864bf299146fe8146e76c47dc64c3092 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 21 Feb 2021 09:27:36 +0000 Subject: 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. --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index a6609ca90..14c4c4440 100644 --- a/Makefile +++ b/Makefile @@ -306,6 +306,15 @@ KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse +# Handle MSYS2 weirdness +ifneq ($(CROSS_COMPILE),) +ifeq ($(shell command -v $(AR)),) +AR := $(CROSS_COMPILE)gcc-ar +STRIP := strip +WINDRES := windres +endif +endif + CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(CF) MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) -- cgit v1.2.3-55-g6feb