+
+ # Check for PAM.
+ # Check whether --with-pam or --without-pam was given.
+if test "${with_pam+set}" = set; then
+ withval="$with_pam"
+ with_pam="$withval"; with_pam_req="$withval"
+else
+ with_pam=no
+fi
+
+#### Leave PAM off by default for now, since it's buggy on Solaris
+#### (and probably Linux, but it's so hard to tell...)
+
+
+ case "$with_pam" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
+echo "configure:6535: checking for PAM headers" >&5
+ d=$with_pam/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
+echo "configure:6545: checking for PAM libs" >&5
+ d=$with_pam/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_pam_req="yes"
+ with_pam=$with_pam_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-pam must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+ # why is this necessary?
+ # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
+ # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
+ withval=
+
+
+ if test "$with_pam" = yes; then
+ echo $ac_n "checking for PAM""... $ac_c" 1>&6
+echo "configure:6576: checking for PAM" >&5
+if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ cat > conftest.$ac_ext <<EOF
+#line 6587 "configure"
+#include "confdefs.h"
+#include <security/pam_appl.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_pam=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_pam=no
+fi
+rm -f conftest*
+ CPPFLAGS="$ac_save_CPPFLAGS"
+fi
+
+echo "$ac_t""$ac_cv_pam" 1>&6
+ if test "$ac_cv_pam" = yes ; then
+ have_pam=yes
+ cat >> confdefs.h <<\EOF
+#define HAVE_PAM 1
+EOF
+
+ 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