Index: /issm/trunk-jpl/m4/issm_options.m4
===================================================================
--- /issm/trunk-jpl/m4/issm_options.m4	(revision 22548)
+++ /issm/trunk-jpl/m4/issm_options.m4	(revision 22549)
@@ -1310,23 +1310,25 @@
 	AC_ARG_WITH([scalapack-lib],
 	  AS_HELP_STRING([--with-scalapack-lib=LIBS],[scalapack libraries to include]),
-	  [SCALAPACKLIB=$withval],[SCALAPACKLIB=""])
+	  [SCALAPACKLIB=$withval],[SCALAPACKLIB="no"])
 			  
 	dnl Check whether scalapack is enabled
 	AC_MSG_CHECKING([for scalapack])
-	if test "x$SCALAPACK_ROOT" = "xno" ; then
-		if test "x$SCALAPACKLIB" = "xno" ; then
+	if test "x$SCALAPACK_ROOT" = "xno" && test "x$SCALAPACKLIB" = "xno"; then
 			HAVE_SCALAPACK=no
-		fi
-	else
+	else if test "x$SCALAPACK_ROOT" != "xno"; then
+		if ! test -d "$SCALAPACK_ROOT"; then
+		 AC_MSG_ERROR([scalapack directory provided ($SCALAPACK_ROOT) does not exist]);
+		fi
 		HAVE_SCALAPACK=yes
-		if ! test -d "$SCALAPACK_ROOT"; then
-			AC_MSG_ERROR([scalapack directory provided ($SCALAPACK_ROOT) does not exist]);
-		fi
 		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+	else if test "x$SCALAPACKLIB" != "xno"; then
+		HAVE_SCALAPACK=yes
+	else
+	   AC_MSG_ERROR([cannot provide both scalapack dir and scalapack-lib])
 	fi
 	AC_MSG_RESULT($HAVE_SCALAPACK)
 	
 	dnl scalapack headers and libraries
-	if test "x$HAVE_SCALAPACK" == "xyes"; then
+	if test "x$HAVE_SCALAPACK" = "xyes"; then
 		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
 		AC_SUBST([SCALAPACKLIB])
