From effae02b57f09fe32bb042069595b6b63afafbe7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 26 Jul 2025 14:46:05 +0200 Subject: [PATCH] autotools: check mingw-w64 version --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 9b1096fcb9..d381cff302 100644 --- a/configure.ac +++ b/configure.ac @@ -530,6 +530,26 @@ if test "$curl_cv_native_windows" = "yes"; then case "$CPPFLAGS" in *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; esac + + case $host_os in + mingw*) + AC_MSG_CHECKING([if building with mingw-w64 3.0 or upper]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + #include <_mingw.h> + ]],[[ + #if !defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 6) + #error + #endif + ]]) + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Building with mingw-w64 3.0 or upper is required.]) + ]) + ;; + esac fi CURL_SET_COMPILER_BASIC_OPTS