+# LB_CONFIG_PORTALS
+#
+# configure support for Cray Portals
+#
+AC_DEFUN([LB_CONFIG_PORTALS],
+[AC_MSG_CHECKING([for external Portals])
+AC_ARG_WITH([portals],
+ AC_HELP_STRING([--with-portals=path],
+ [set path to portals]),
+ [
+ case $with_portals in
+ no) PORTALS=""
+ enable_portals=no
+ ;;
+ *) if test x$with_portals != x ; then
+ PORTALS="$with_portals"
+ enable_portals=yes
+ else
+ AC_MSG_ERROR([Path to portals must be specified])
+ enable_portals=no
+ fi
+ ;;
+ esac
+
+ ], [enable_portals=no])
+AC_MSG_CHECKING([location of portals])
+case x$enable_portals in
+ xyes)
+ AC_MSG_RESULT([$PORTALS])
+ LB_CHECK_FILE([$PORTALS/include/portals/api.h],[],
+ AC_MSG_ERROR([Cannot find portals headers]))
+ ;;
+ *)
+ AC_MSG_RESULT([no external portals])
+ ;;
+esac
+
+AC_SUBST(PORTALS)
+])
+