From 6b7c389a7925f52db1ffb1f6ecb83d37f44144bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Fri, 24 Feb 2012 17:35:54 +0100
Subject: [PATCH] Another hack to get static linking of libgfortran under MinGW
 (cherry picked from commit 3551512a6fecb27d1a55fc869ee8d289f231087f)

---
 configure.ac | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configure.ac b/configure.ac
index feed794ea..6be7670fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,15 @@ AC_CHECK_PROG([CWEAVE], [cweave], [cweave])
 AM_CONDITIONAL([HAVE_CWEAVE], [test "x$CWEAVE" != "x"])
 
 AC_PROG_F77
+AC_F77_LIBRARY_LDFLAGS
+# Hack to get static linking of libgfortran on MinGW
+# (-static-libgfortran doesn't act on gcc/g++)
+case ${host_os} in
+  *mingw32*)
+    FLIBS=`echo $FLIBS | sed 's/-lgfortran/-Wl,-Bstatic -lgfortran -Wl,-Bdynamic/'`
+    ;;
+esac
+
 if test "x$F77" != "x"; then
    AX_BLAS
    AX_LAPACK
-- 
GitLab