Hi,

Through this commit to config.sub
  
https://git.savannah.gnu.org/gitweb/?p=config.git;a=commitdiff;h=91f6a7f616b161c25ba2001861a40e662e18c4ad
the host_os values windows* (and in particular windows*-gnu* and windows*-msvc*)
were introduced, to denote native Windows environments.

The commit message makes it sound like LLVM and Crablang communities will
use the windows* value, whereas GNU will continue to use mingw*. But I think
it's only a matter of time until people start to pass the option
  --host=x86_64-pc-windows
to configure scripts. We should be prepared for that.

This patch does the necessary things on the Autoconf side, by accepting a
host_os of the form windows* anywhere where mingw* is accepted.


>From 7f6fbae6de7b0dff850dbab99d290f54b4bcda06 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Thu, 17 Aug 2023 15:44:05 +0200
Subject: [PATCH] Recognize the *-*-windows* config triplets introduced on
 2023-06-26.

* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Treat windows* as
equivalent to mingw*.
* lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF):
Likewise.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_PROBE): Likewise.
---
 lib/autoconf/fortran.m4   | 2 +-
 lib/autoconf/functions.m4 | 4 ++--
 lib/autoconf/specific.m4  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index d672450d..cdc197bd 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -668,7 +668,7 @@ while test $[@%:@] != 1; do
 	-lkernel32 | -lmingw* | -lmoldname)
 	  # Ignore this library only on Windows-like systems.
 	  case $host_os in
-	  cygwin* | msys* | mingw*) ;;
+	  cygwin* | msys* | mingw* | windows*) ;;
 	  *)
 	  _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
 			     ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index 54d04cc3..4cfb5142 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -985,7 +985,7 @@ AC_CACHE_CHECK([for GNU libc compatible malloc], ac_cv_func_malloc_0_nonnull,
 	       [case "$host_os" in # ((
 		  # Guess yes on platforms where we know the result.
 		  *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
-		  | hpux* | solaris* | cygwin* | mingw* | msys* )
+		  | hpux* | solaris* | cygwin* | mingw* | windows* | msys* )
 		    ac_cv_func_malloc_0_nonnull=yes ;;
 		  # If we don't know, assume the worst.
 		  *) ac_cv_func_malloc_0_nonnull=no ;;
@@ -1490,7 +1490,7 @@ AC_CACHE_CHECK([for GNU libc compatible realloc], ac_cv_func_realloc_0_nonnull,
 	       [case "$host_os" in # ((
 		  # Guess yes on platforms where we know the result.
 		  *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
-		  | hpux* | solaris* | cygwin* | mingw* | msys* )
+		  | hpux* | solaris* | cygwin* | mingw* | windows* | msys* )
 		    ac_cv_func_realloc_0_nonnull=yes ;;
 		  # If we don't know, assume the worst.
 		  *) ac_cv_func_realloc_0_nonnull=no ;;
diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4
index 9d597454..97b6a5a3 100644
--- a/lib/autoconf/specific.m4
+++ b/lib/autoconf/specific.m4
@@ -304,7 +304,7 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
     AC_REQUIRE([AC_CANONICAL_HOST])
     if test $ac_opt_found != yes; then
       AS_CASE([$host_os],
-        [mingw*],
+        [mingw* | windows*],
           [ac_cv_sys_largefile_opts="supported through gnulib"
            ac_opt_found=yes]
       )
-- 
2.34.1

Reply via email to