Skip to content
Snippets Groups Projects
Verified Commit 7e46d826 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

mac: make build system work with clang and gcc

parent a93c6681
Branches
Tags
No related merge requests found
dnl Copyright (C) 2009-2016 Dynare Team
dnl Copyright (C) 2009-2019 Dynare Team
dnl
dnl This file is part of Dynare.
dnl
......@@ -59,19 +59,14 @@ case ${MATLAB_ARCH} in
ax_mexopts_ok="yes"
;;
maci | maci64)
MACOSX_DEPLOYMENT_TARGET='10.7'
if test "${MATLAB_ARCH}" = "maci"; then
ARCHS='i386'
else
ARCHS='x86_64'
fi
MACOSX_DEPLOYMENT_TARGET='10.9'
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
MATLAB_CFLAGS="-fno-common -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -fexceptions"
MATLAB_CXXFLAGS="-fno-common -fexceptions -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
MATLAB_FFLAGS="-fexceptions -fbackslash -arch $ARCHS"
MATLAB_LDFLAGS_NOMAP="-L$MATLAB/bin/${MATLAB_ARCH} -Wl,-twolevel_namespace -undefined error -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle"
MATLAB_CFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -fexceptions"
MATLAB_CXXFLAGS="$MATLAB_CFLAGS"
MATLAB_FFLAGS="-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,$(pwd)/$srcdir/mexFunction-MacOSX.map"
MATLAB_LIBS="-lmx -lmex -lmat -lstdc++ -lmwlapack -lmwblas"
MATLAB_LIBS="-L$MATLAB/bin/maci64 -lmx -lmex -lmat -lmwlapack -lmwblas"
ax_mexopts_ok="yes"
;;
*)
......
......
dnl Process this file with autoconf to produce a configure script.
dnl Copyright (C) 2009-2017 Dynare Team
dnl Copyright (C) 2009-2019 Dynare Team
dnl
dnl This file is part of Dynare.
dnl
......@@ -66,7 +66,14 @@ AM_PROG_AR
case ${host_os} in
*darwin*)
string="`$CXX --version`"
if test x"${string#*clang}" != x"$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
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment