Build system: various macOS cleanups

– remove clang support
– we no longer support 32-bit
– simplify Darwin specific hacks for Octave MEX files
time-shift
Sébastien Villemot 2020-12-18 14:31:08 +01:00
parent f80c513025
commit 93a8e60265
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
3 changed files with 7 additions and 17 deletions

View File

@ -64,7 +64,7 @@ case ${MATLAB_ARCH} in
OPENMP_LDFLAGS="-Wl,-Bstatic,--whole-archive -lgomp -Wl,-Bdynamic,--no-whole-archive" OPENMP_LDFLAGS="-Wl,-Bstatic,--whole-archive -lgomp -Wl,-Bdynamic,--no-whole-archive"
ax_mexopts_ok="yes" ax_mexopts_ok="yes"
;; ;;
maci | maci64) maci64)
MACOSX_DEPLOYMENT_TARGET='10.9' MACOSX_DEPLOYMENT_TARGET='10.9'
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG" MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
MATLAB_CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -fexceptions" 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_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_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_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" ax_mexopts_ok="yes"
;; ;;
*) *)

View File

@ -59,19 +59,6 @@ AX_PROG_LN_S
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
AM_PROG_AR 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 AX_CXX11_THREAD
# Check for dlopen(), needed by k_order_perturbation DLL # Check for dlopen(), needed by k_order_perturbation DLL

View File

@ -39,8 +39,8 @@ LDFLAGS="$($MKOCTFILE -p LFLAGS) $($MKOCTFILE -p LDFLAGS)"
AC_CANONICAL_HOST AC_CANONICAL_HOST
case ${host_os} in case ${host_os} in
darwin*) darwin*)
CXXFLAGS="$($MKOCTFILE -p ALL_CXXFLAGS) -Wall -Wno-parentheses -Wold-style-cast -O2" dnl The mkoctfile from Octave.app 4.4.1 does not add optimization flags in CXXFLAGS
LDFLAGS+=" $($MKOCTFILE -p OCTAVE_LIBS)" CXXFLAGS+=" -O2"
;; ;;
esac esac