+
+ # Check for PAM.
+ AC_ARG_WITH(pam,
+[ --with-pam Include support for PAM (Pluggable Authentication
+ Modules) if possible (this is the default.)
+ --without-pam Do not compile in support for PAM.],
+ [with_pam="$withval"; with_pam_req="$withval"],[with_pam=no])
+#### Leave PAM off by default for now, since it's buggy on Solaris
+#### (and probably Linux, but it's so hard to tell...)
+
+ HANDLE_X_PATH_ARG(with_pam, --with-pam, PAM)
+
+ if test "$with_pam" = yes; then
+ AC_CACHE_CHECK([for PAM], ac_cv_pam,
+ [AC_TRY_X_COMPILE([#include <security/pam_appl.h>],,
+ [ac_cv_pam=yes],
+ [ac_cv_pam=no])])
+ if test "$ac_cv_pam" = yes ; then
+ have_pam=yes
+ AC_DEFINE(HAVE_PAM)
+ PASSWD_LIBS="${PASSWD_LIBS} -lpam -ldl"
+ fi
+ elif test "$with_pam" != no; then
+ echo "error: must be yes or no: --with-pam=$with_pam"
+ exit 1
+ fi