SDL_image: autotools: Eliminate libgcc*.dll dependency in mingw builds. (3ae30)

https://github.com/libsdl-org/SDL_image/commit/3ae305b63db52b753333141d9536d23815a9f97f

From 3ae305b63db52b753333141d9536d23815a9f97f Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 3 Jan 2025 17:50:56 +0300
Subject: [PATCH] autotools: Eliminate libgcc*.dll dependency in mingw builds.

---
 configure    | 2 ++
 configure.ac | 2 ++
 ltmain.sh    | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 1a84eb79..23a81328 100755
--- a/configure
+++ b/configure
@@ -12267,6 +12267,8 @@ case "$host" in
         fi
         use_version_rc=true
         LT_EXTRA="-Wl,version.o"
+        # Eliminate libgcc*.dll dependency.
+        CFLAGS="$CFLAGS -static-libgcc"
         ;;
     *-*-darwin*)
         # Check whether --enable-imageio was given.
diff --git a/configure.ac b/configure.ac
index a2f46c97..4761938e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,8 @@ case "$host" in
         fi
         use_version_rc=true
         LT_EXTRA="-Wl,version.o"
+        # Eliminate libgcc*.dll dependency.
+        CFLAGS="$CFLAGS -static-libgcc"
         ;;
     *-*-darwin*)
         AC_ARG_ENABLE([imageio], [AS_HELP_STRING([--enable-imageio], [use native Mac OS X frameworks for loading images [default=yes]])],
diff --git a/ltmain.sh b/ltmain.sh
index 1e2f085c..7c967898 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -4766,7 +4766,7 @@ func_mode_link ()
       # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
       # @file GCC response files
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|-static-*|@*)
         func_quote_for_eval "$arg"
 	arg="$func_quote_for_eval_result"
         func_append compile_command " $arg"