From cca8c8e806db11810e25c8fa9446e86431aa2a53 Mon Sep 17 00:00:00 2001
From: Ron Yorston <rmy@pobox.com>
Date: Tue, 2 Jan 2024 16:50:06 +0000
Subject: build system: try harder to detect Windows hosts

Commit 7390f29cf (build system: allow building with w64devkit)
checked the target of the host compiler to determine if it was
Windows.  This relied on the target being a triple of the form
*-*-mingw32.

Some compilers have a target of the form *-*-windows-gnu.  Allow
for this too.
---
 scripts/Makefile.host | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 0deec32e6..7b380460a 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -102,11 +102,13 @@ hostcxx_flags  = -Wp,-MD,$(depfile) $(__hostcxx_flags)
 # often than really needed.
 #
 host_target := $(shell $(HOSTCC) -v 2>&1 | grep ^Target:)
-host_platform := $(lastword $(subst -, ,$(host_target)))
+host_platform := $(word 4,$(subst -, ,$(host_target)))
+dot :=
 ifeq ($(host_platform),mingw32)
 dot := .
-else
-dot :=
+endif
+ifeq ($(host_platform),windows)
+dot := .
 endif
 
 #####
-- 
cgit v1.2.3-55-g6feb