Skip to content
Snippets Groups Projects
Commit 5ccd2486 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

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

parent 5e9098ed
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,9 @@ AC_PROG_CXX ...@@ -28,7 +28,9 @@ AC_PROG_CXX
AC_CANONICAL_HOST AC_CANONICAL_HOST
case ${host_os} in case ${host_os} in
*mingw32*) *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*) *cygwin*)
AC_MSG_WARN([You are compiling for the Cygwin target. This means that the preprocessor will]) AC_MSG_WARN([You are compiling for the Cygwin target. This means that the preprocessor will])
......
...@@ -62,7 +62,8 @@ case ${MATLAB_ARCH} in ...@@ -62,7 +62,8 @@ case ${MATLAB_ARCH} in
;; ;;
esac esac
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG" 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" MATLAB_LIBS="$LIBLOC/libmex.lib $LIBLOC/libmx.lib $LIBLOC/libmwlapack.lib"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries # 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"]) AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} $LIBLOC/libmwblas.lib"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment