Commit 849974af authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix detection of SLICOT under Windows

(cherry picked from commit 5b1ecaf6)
parent 7da0f2c9
......@@ -34,7 +34,8 @@ case ${MATLAB_ARCH} in
MATLAB_CFLAGS="-fexceptions -fPIC -pthread -g -O2"
MATLAB_CXXFLAGS="-fPIC -pthread -g -O2"
MATLAB_FFLAGS="-fPIC -g -O2 -fexceptions"
MATLAB_LDFLAGS="-shared -Wl,--version-script,$MATLAB/extern/lib/${MATLAB_ARCH}/mexFunction.map -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/${MATLAB_ARCH} -L$MATLAB/bin/${MATLAB_ARCH}"
MATLAB_LDFLAGS_NOMAP="-shared -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/${MATLAB_ARCH} -L$MATLAB/bin/${MATLAB_ARCH}"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,--version-script,$MATLAB/extern/lib/${MATLAB_ARCH}/mexFunction.map"
MATLAB_LIBS="-lmx -lmex -lmat -lm -lstdc++ -lmwlapack"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"])
......@@ -55,7 +56,8 @@ case ${MATLAB_ARCH} in
AX_COMPARE_VERSION([$MATLAB_VERSION], [eq], [7.0.1], [AC_MSG_ERROR([MATLAB version 7.0.1 (R14SP1) is buggy (LAPACK library missing for MSVC), and can't be used for compiling MEX files])])
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
# 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 -L$MATLAB/bin/${MATLAB_ARCH}"
MATLAB_LDFLAGS_NOMAP="-static-libgcc -static-libstdc++ -shared -L$MATLAB/bin/${MATLAB_ARCH}"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP $(pwd)/$srcdir/mex.def"
MATLAB_LIBS="-lmex -lmx -lmat -lmwlapack"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"])
......@@ -71,11 +73,8 @@ case ${MATLAB_ARCH} in
fi
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
MATLAB_CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -fexceptions -O2"
# Work around for slicot configuration: need to remove exported_symbols_list
# flag because there's no mexfunction in the configure script
MATLAB_LDFLAGS_NOMAP="-L$MATLAB/bin/${MATLAB_ARCH} -Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle"
MATLAB_MAPFLAG="-Wl,-exported_symbols_list,\$(top_srcdir)/mexFunction-MacOSX.map"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP $MATLAB_MAPFLAG"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,-exported_symbols_list,$(pwd)/$srcdir/mexFunction-MacOSX.map"
MATLAB_LIBS="-lmx -lmex -lmat -lstdc++ -lmwlapack"
MATLAB_CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -O2"
MATLAB_FFLAGS="-fexceptions -fbackslash -arch $ARCHS"
......
......@@ -43,15 +43,8 @@ AC_DEFUN([AX_SLICOT],
AC_F77_FUNC(sb02od)
if test "x$1" = "xmatlab"; then
case ${MATLAB_ARCH} in
maci | maci64)
# Work around for exported_symbols_list flag present in Mac MATLAB_LDFLAGS
LDFLAGS="$MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT"
;;
*)
LDFLAGS="$LDFLAGS $MATLAB_LDFLAGS $LDFLAGS_SLICOT"
;;
esac
LDFLAGS="$MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT"
case ${MATLAB_ARCH} in
glnxa64 | win64 | maci64)
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [use_64_bit_indexing=yes], [use_64_bit_indexing=no])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment