Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 15988)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 15989)
@@ -111,4 +111,7 @@
 		  AC_MSG_ERROR([matlab directory provided ($MATLAB_ROOT) does not exist]);
 		fi
+		if ! test -f "$MATLAB_ROOT/extern/include/mex.h"; then
+			AC_MSG_ERROR([Couldn't find mex.h... check your installation of matlab])
+	   fi
 	fi
 	AC_MSG_RESULT($HAVE_MATLAB)
@@ -120,5 +123,4 @@
 		AC_DEFINE([_HAVE_MATLAB_],[1],[with matlab in ISSM src])
   		MATLABINCL="-I$MATLAB_ROOT/extern/include/"
-		AC_CHECK_FILE($MATLAB_ROOT/extern/include/mex.h,[],[AC_MSG_ERROR([Couldn't find mex.h... check your installation of matlab])])
 		
 		dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental) except for windows
@@ -163,4 +165,7 @@
 			AC_MSG_ERROR([triangle directory provided ($TRIANGLE_ROOT) does not exist]);
 		fi
+		if ! test -f "$TRIANGLE_ROOT/triangle.h" ; then
+			AC_MSG_ERROR([Couldn't find triangle.h... check your installation of triangle])
+		fi
 	fi
 	AC_MSG_RESULT($HAVE_TRIANGLE)
@@ -170,6 +175,4 @@
 	if test "x$HAVE_TRIANGLE" = "xyes"; then
 		TRIANGLEINCL=-I$TRIANGLE_ROOT/
-		dnl AC_CHECK_FILE($TRIANGLE_ROOT/triangle.h,[],[AC_MSG_ERROR([Couldn't find triangle.h... check your installation of triangle])]) This check 
-		dnl blows up in cross-compile form.  Need to check for it in shell mode. 
 		case "${host_os}" in
 				*cygwin*)
