+# PAM check
+pam_msg=no
+AH_TEMPLATE(HAVE_PAM, [define to compile support for PAM authentication])
+AC_ARG_WITH(pam, [ --with-pam Enable PAM support])
+DOLDA_PKG([HAS_PAM], [test "$with_pam" = no && HAS_PAM=no],
+ [AC_CHECK_LIB(pam, pam_start, [:], [HAS_PAM=no])],
+ [PAM_LIBS=-lpam])
+if test "$with_pam" = yes -a "$HAS_PAM" = no; then
+ AC_MSG_ERROR([*** cannot find PAM on this system])
+fi
+if test "$HAS_PAM" = yes; then
+ AC_DEFINE(HAVE_PAM)
+ pam_msg=yes
+fi
+AC_SUBST(PAM_LIBS)
+