summaryrefslogtreecommitdiffstats
path: root/build/linux/acinclude.m4
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-08-16 12:34:44 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-08-16 12:34:44 +0200
commit4a396a608aefc3282baea76bc4e1965faa99b4f8 (patch)
tree1d41969dd8c747f9150256ebffbddedb426e2238 /build/linux/acinclude.m4
parentd9261bdb05cd0863a2c3747c812871dbb851646e (diff)
downloadastra-4a396a608aefc3282baea76bc4e1965faa99b4f8.tar.gz
astra-4a396a608aefc3282baea76bc4e1965faa99b4f8.tar.bz2
astra-4a396a608aefc3282baea76bc4e1965faa99b4f8.tar.xz
astra-4a396a608aefc3282baea76bc4e1965faa99b4f8.zip
Check for the mex -R2017b option in configure
Since we use mex for linking, but CXX for compiling, we also need to set a preprocessor macro to emulate the -R2017b option. Currently we use -DMATLAB_MEXCMD_RELEASE=700, but it is unclear if this is the recommended way. This is required to build with Matlab R2018a and newer.
Diffstat (limited to 'build/linux/acinclude.m4')
-rw-r--r--build/linux/acinclude.m420
1 files changed, 18 insertions, 2 deletions
diff --git a/build/linux/acinclude.m4 b/build/linux/acinclude.m4
index d6866c3..135c1c6 100644
--- a/build/linux/acinclude.m4
+++ b/build/linux/acinclude.m4
@@ -38,8 +38,7 @@ extern "C" void mexFunction() {
}
_ACEOF
$CXX -fPIC -c -o conftest.o conftest.cc
-$MEX -cxx -output conftest conftest.o
-$2=""
+$MEX -cxx -output conftest conftest.o >/dev/null 2>&1
for suffix in $1; do
if test -f "conftest.$suffix"; then
$2="$suffix"
@@ -49,6 +48,23 @@ done
rm -f conftest.cc conftest.o
])
+dnl ASTRA_CHECK_MEX_OPTION(option, mex-suffix, action-if-supported, action-if-not-supported)
+dnl Check if an option is supported by mex.
+dnl We test if mex works by testing if it produces a mex file as output;
+dnl this is required since 'mex' is also a commonly installed LaTeX format
+AC_DEFUN([ASTRA_CHECK_MEX_OPTION],[
+cat >conftest.cc <<_ACEOF
+extern "C" void mexFunction() {
+}
+_ACEOF
+$CXX -fPIC -c -o conftest.o conftest.cc
+$MEX $1 -cxx -output conftest conftest.o >/dev/null 2>&1
+AS_IF([test -f "conftest.$2"],[
+ rm -f "conftest.$2"
+ $3],[$4])
+rm -f conftest.cc conftest.o
+])
+
dnl ASTRA_RUN_STOREOUTPUT(command, output)
AC_DEFUN([ASTRA_RUN_STOREOUTPUT],[{