Build system: for Windows, add "-static-libstdc++" flag

time-shift
Sébastien Villemot 2010-08-18 18:55:45 +02:00
parent 5e9098edc5
commit 5ccd248622
2 changed files with 5 additions and 2 deletions

View File

@ -28,7 +28,9 @@ AC_PROG_CXX
AC_CANONICAL_HOST
case ${host_os} in
*mingw32*)
LDFLAGS="$LDFLAGS -static-libgcc" # On mingw32, we don't want dynamic libgcc
# On mingw32, we don't want dynamic libgcc
# Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions)
LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
;;
*cygwin*)
AC_MSG_WARN([You are compiling for the Cygwin target. This means that the preprocessor will])

View File

@ -62,7 +62,8 @@ case ${MATLAB_ARCH} in
;;
esac
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
MATLAB_LDFLAGS="-static-libgcc -shared \$(top_srcdir)/mex.def"
# Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions)
MATLAB_LDFLAGS="-static-libgcc -static-libstdc++ -shared \$(top_srcdir)/mex.def"
MATLAB_LIBS="$LIBLOC/libmex.lib $LIBLOC/libmx.lib $LIBLOC/libmwlapack.lib"
# 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"])