diff --git a/m4/ax_mexopts.m4 b/m4/ax_mexopts.m4 index 60fda3441..6f46ced2f 100644 --- a/m4/ax_mexopts.m4 +++ b/m4/ax_mexopts.m4 @@ -64,7 +64,7 @@ case ${MATLAB_ARCH} in OPENMP_LDFLAGS="-Wl,-Bstatic,--whole-archive -lgomp -Wl,-Bdynamic,--no-whole-archive" ax_mexopts_ok="yes" ;; - maci | maci64) + maci64) MACOSX_DEPLOYMENT_TARGET='10.9' MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG" MATLAB_CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -fexceptions" @@ -72,7 +72,10 @@ case ${MATLAB_ARCH} in MATLAB_FCFLAGS="-g -O2 -fexceptions -fbackslash -arch x86_64" MATLAB_LDFLAGS_NOMAP="-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,-exported_symbols_list,\$(abs_top_srcdir)/mexFunction-MacOSX.map" - MATLAB_LIBS="-L$MATLAB/bin/maci64 -lmx -lmex -lmat -lmwlapack -lmwblas" + # This -L flag is put here, hence later on the linker command line, so as + # to avoid linking against the HDF5 shipped by MATLAB (which would + # otherwise override the HDF5 from Homebrew) + MATLAB_LIBS="-L$MATLAB/bin/maci64 -lmx -lmex -lmat -lmwlapack -lmwblas -lstdc++" ax_mexopts_ok="yes" ;; *) diff --git a/mex/build/matlab/configure.ac b/mex/build/matlab/configure.ac index 0eaedf7a4..69f3670a9 100644 --- a/mex/build/matlab/configure.ac +++ b/mex/build/matlab/configure.ac @@ -59,19 +59,6 @@ AX_PROG_LN_S AC_PROG_MKDIR_P AM_PROG_AR -case ${host_os} in - *darwin*) - string=$($CXX --version) - if test "${string#*clang}" != "$string"; then - CXXFLAGS="$CXXFLAGS -stdlib=libc++" - MATLAB_LIBS="$MATLAB_LIBS -lc++" - MATLAB_LDFLAGS="$MATLAB_LDFLAGS -Wl,-syslibroot,$(xcrun -sdk macosx --show-sdk-path)" - else - MATLAB_LIBS="$MATLAB_LIBS -lstdc++" - fi - ;; -esac - AX_CXX11_THREAD # Check for dlopen(), needed by k_order_perturbation DLL diff --git a/mex/build/octave/configure.ac b/mex/build/octave/configure.ac index c8b34d166..c793d4db3 100644 --- a/mex/build/octave/configure.ac +++ b/mex/build/octave/configure.ac @@ -39,8 +39,8 @@ LDFLAGS="$($MKOCTFILE -p LFLAGS) $($MKOCTFILE -p LDFLAGS)" AC_CANONICAL_HOST case ${host_os} in darwin*) - CXXFLAGS="$($MKOCTFILE -p ALL_CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast -O2" - LDFLAGS+=" $($MKOCTFILE -p OCTAVE_LIBS)" + dnl The mkoctfile from Octave.app 4.4.1 does not add optimization flags in CXXFLAGS + CXXFLAGS+=" -O2" ;; esac