From 16efd550b954364e0339b369bbc6d58364b6abc5 Mon Sep 17 00:00:00 2001 From: stevenj Date: Sat, 22 Nov 2008 16:29:30 -0500 Subject: [PATCH] better checking for Matlab installation path darcs-hash:20081122212930-c8de0-ed002085375fe8493a94b3a880fd0f99da55c7a2.gz --- configure.ac | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 51e6364..d839226 100644 --- a/configure.ac +++ b/configure.ac @@ -147,16 +147,18 @@ EOF if test x"$MEX_INSTALL_DIR" = "x"; then # try to find installation directory - if test x"$MATLAB" = xecho; then - AC_MSG_WARN([can't fine Matlab; won't compile Matlab plugin]) - else + if test x"$MATLAB" != xecho; then AC_MSG_CHECKING(for MATLAB mex installation dir) - matlabpath_line=`matlab -n | grep -n MATLABPATH |head -1 |cut -d: -f1` - matlabpath_line=`expr $matlabpath_line + 1` - MEX_INSTALL_DIR=`matlab -n | tail -n +$matlabpath_line | head -1 | tr -d ' '` + MEX_INSTALL_DIR=`matlab -nodisplay -nodesktop -nojvm -r 'path;quit' | grep toolbox/local |sed 's,^[[^/]]*,,g' |sort |head -1` AC_MSG_RESULT($MEX_INSTALL_DIR) + if test x`basename "$MEX_INSTALL_DIR"` != xlocal; then + MEX_INSTALL_DIR="" + fi fi fi + if test x"$MEX_INSTALL_DIR" = "x"; then + AC_MSG_WARN([can't find reasonable Matlab installation directory; Matlab plugins will not be compiled unless you manually specify MEX_INSTALL_DIR]) + fi fi AM_CONDITIONAL(WITH_MATLAB, test x"$MEX_INSTALL_DIR" != "x") AC_SUBST(MEX_INSTALL_DIR) -- 2.30.2