+# LN_CONFIG_PORTALS
+#
+# configure support for Portals
+#
+AC_DEFUN([LN_CONFIG_PORTALS],
+[AC_MSG_CHECKING([for portals])
+AC_ARG_WITH([portals],
+ AC_HELP_STRING([--with-portals=path],
+ [set path to portals]),
+ [
+ case $with_portals in
+ no) ENABLEPORTALS=0
+ ;;
+ *) PORTALS="${with_portals}"
+ ENABLEPORTALS=1
+ ;;
+ esac
+ ], [
+ ENABLEPORTALS=0
+ ])
+PTLLNDCPPFLAGS=""
+if test $ENABLEPORTALS -eq 0; then
+ AC_MSG_RESULT([no])
+elif test ! \( -f ${PORTALS}/include/portals/p30.h \); then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([bad --with-portals path])
+else
+ AC_MSG_RESULT([$PORTALS])
+ PTLLNDCPPFLAGS="-I${PORTALS}/include"
+fi
+AC_SUBST(PTLLNDCPPFLAGS)
+])
+
+#
+# LN_CONFIG_BACKOFF
+#
+# check if tunable tcp backoff is available/wanted
+#
+AC_DEFUN([LN_CONFIG_BACKOFF],
+[AC_MSG_CHECKING([for tunable backoff TCP support])
+AC_ARG_ENABLE([backoff],
+ AC_HELP_STRING([--disable-backoff],
+ [disable socknal tunable backoff]),
+ [],[enable_backoff='yes'])
+if test x$enable_backoff = xno ; then
+ AC_MSG_RESULT([no (by request)])
+else
+ BOCD="`grep -c TCP_BACKOFF $LINUX/include/linux/tcp.h`"
+ if test "$BOCD" != 0 ; then
+ AC_DEFINE(SOCKNAL_BACKOFF, 1, [use tunable backoff TCP])
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT([no (no kernel support)])
+ fi
+fi
+])
+
+
+#
+# LN_CONFIG_PTLLND
+#
+# configure support for Portals LND
+#
+AC_DEFUN([LN_CONFIG_PTLLND],
+[
+if test -z "$ENABLEPORTALS"; then
+ LN_CONFIG_PORTALS
+fi
+
+AC_MSG_CHECKING([whether to build the kernel portals LND])
+
+PTLLND=""
+if test $ENABLEPORTALS -ne 0; then
+ AC_MSG_RESULT([yes])
+ PTLLND="ptllnd"
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(PTLLND)
+])
+
+#
+# LN_CONFIG_UPTLLND
+#
+# configure support for Portals LND
+#
+AC_DEFUN([LN_CONFIG_UPTLLND],
+[
+if test -z "$ENABLEPORTALS"; then
+ LN_CONFIG_PORTALS
+fi
+
+AC_MSG_CHECKING([whether to build the userspace portals LND])
+
+UPTLLND=""
+if test $ENABLEPORTALS -ne 0; then
+ AC_MSG_RESULT([yes])
+ UPTLLND="ptllnd"
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST(UPTLLND)
+])
+
+#
+# LN_CONFIG_USOCKLND
+#
+# configure support for userspace TCP/IP LND
+#
+AC_DEFUN([LN_CONFIG_USOCKLND],
+[AC_MSG_CHECKING([whether to build usocklnd])
+AC_ARG_ENABLE([usocklnd],
+ AC_HELP_STRING([--disable-usocklnd],
+ [disable usocklnd]),
+ [],[enable_usocklnd='yes'])
+
+if test x$enable_usocklnd = xyes ; then
+ if test "$ENABLE_LIBPTHREAD" = "yes" ; then
+ AC_MSG_RESULT([yes])
+ USOCKLND="usocklnd"
+ else
+ AC_MSG_RESULT([no (libpthread not present or disabled)])
+ USOCKLND=""
+ fi
+else
+ AC_MSG_RESULT([no (disabled explicitly)])
+ USOCKLND=""
+fi
+AC_SUBST(USOCKLND)
+])
+
+#
+# LN_CONFIG_QUADRICS