AC_SUBST([GNUTLS_LIBS])
AM_CONDITIONAL([HAVE_GNUTLS], [ ! test "x$GNUTLS_LIBS" = x ])
-AC_CHECK_LIB([pam], [pam_start],
- [AC_CHECK_HEADER([security/pam_appl.h],
- [PAM_LIBS='-lpam'
- AC_DEFINE(HAVE_PAM, 1, [PAM available])],
- [], [#include <stdio.h>])])
+AC_ARG_ENABLE([pam],
+ AS_HELP_STRING([--enable-pam],
+ [build in support for authenticating users using PAM (default yes)]),
+ [enable_pam="$enableval"], [enable_pam=yes])
+
+PAM_LIBS=
+if test "x$enable_pam" = xyes; then
+ AC_CHECK_LIB([pam], [pam_start],
+ [AC_CHECK_HEADER([security/pam_appl.h],
+ [PAM_LIBS='-lpam'
+ AC_DEFINE(HAVE_PAM, 1, [PAM available])],
+ [], [#include <stdio.h>])])
+fi
AC_SUBST([PAM_LIBS])
AM_CONDITIONAL([HAVE_PAM], [ ! test "x$PAM_LIBS" = x ])