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"])