From 8ddd2bdd963fd3ace52e7bf24968238b6cddf80a Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Thu, 24 Mar 2022 11:59:44 +0100
Subject: [PATCH] configure: only use -static-libgcc if the C++ compiler
 accepts it

newer clang reports that it ignores the command on each C++ file compiled.
In the end the static C++ compiler is used on Windows anyway.
---
 configure.ac | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8f0b7895ff6d..728f19d9be65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,7 +254,9 @@ int foo() { return my_array[0]; }
   *mingw32* | *cygwin* | *wince* | *mingwce*)
     dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
     dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
-    CXXFLAGS="${CXXFLAGS} -static-libgcc"
+    AC_LANG_PUSH(C++)
+    AX_APPEND_COMPILE_FLAGS([-static-libgcc], [CXXFLAGS], [-Werror])
+    AC_LANG_POP(C++)
     AC_CHECK_TOOL(WINDRES, windres, :)
     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
-- 
GitLab