From 2c43941d04a67c9173fcee1c9989110a17654441 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 5 Nov 2009 12:12:55 +0000 Subject: [PATCH] Build system: fix for MinGW 4.4 git-svn-id: https://www.dynare.org/svn/dynare/trunk@3128 ac1d8469-bf42-47a9-8791-bf33cf982152 --- Makefile.am | 2 +- configure.ac | 7 +++++++ m4/ax_mexopts.m4 | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8bec9664e..d8ee03694 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,4 +32,4 @@ dist-hook: clean-local rm -rf `find $(distdir) -name .svn` rm -rf `find $(distdir)/mex/sources -name *.o` rm -f $(distdir)/matlab/dynare_m$(EXEEXT) - $(MKDIR_P) $(distdir)/mex/2007a $(distdir)/mex/2007b $(distdir)/mex/2009a-64bit $(distdir)/mex/octave + $(MKDIR_P) $(distdir)/mex/matlab $(distdir)/mex/octave diff --git a/configure.ac b/configure.ac index 127489b31..e856ec97a 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,13 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC AC_PROG_CXX +AC_CANONICAL_HOST +case ${host_os} in + *mingw32*) + LDFLAGS="$LDFLAGS -static-libgcc" # On mingw32, we don't want dynamic libgcc + ;; +esac + # Use C++ for testing headers AC_LANG([C++]) diff --git a/m4/ax_mexopts.m4 b/m4/ax_mexopts.m4 index eb31b0968..f8f043283 100644 --- a/m4/ax_mexopts.m4 +++ b/m4/ax_mexopts.m4 @@ -50,7 +50,7 @@ case ${MATLAB_ARCH} in MATLAB_CFLAGS="-fexceptions -g -O2" MATLAB_CXXFLAGS="-g -O2" LIBLOC="$MATLAB/extern/lib/${MATLAB_ARCH}/microsoft" - MATLAB_LDFLAGS="-shared \$(top_srcdir)/mex.def" + MATLAB_LDFLAGS="-static-libgcc -shared \$(top_srcdir)/mex.def" MATLAB_LIBS="$LIBLOC/libmex.lib $LIBLOC/libmx.lib $LIBLOC/libmwlapack.lib -lstdc++" # Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} $LIBLOC/libmwblas.lib"])