diff options
Diffstat (limited to 'm4/want_pam.m4')
-rw-r--r-- | m4/want_pam.m4 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/m4/want_pam.m4 b/m4/want_pam.m4 new file mode 100644 index 0000000..7d4474e --- /dev/null +++ b/m4/want_pam.m4 @@ -0,0 +1,36 @@ +AC_DEFUN([DOVECOT_WANT_PAM], [ + if test $want_pam != no; then + AC_CHECK_LIB(pam, pam_start, [ + have_pam=no + AC_CHECK_HEADER(security/pam_appl.h, [ + AC_DEFINE(HAVE_SECURITY_PAM_APPL_H,, + [Define if you have security/pam_appl.h]) + have_pam=yes + ]) + + AC_CHECK_HEADER(pam/pam_appl.h, [ + AC_DEFINE(HAVE_PAM_PAM_APPL_H,, + [Define if you have pam/pam_appl.h]) + have_pam=yes + ]) + ], [ + if test $want_pam = yes; then + AC_ERROR([Can't build with PAM support: libpam not found]) + fi + ]) + fi + + if test "$have_pam" = "yes"; then + AUTH_LIBS="$AUTH_LIBS -lpam" + AC_DEFINE(PASSDB_PAM,, [Build with PAM support]) + passdb="$passdb pam" + + AC_CHECK_LIB(pam, pam_setcred, [ + AC_DEFINE(HAVE_PAM_SETCRED,, [Define if you have pam_setcred()]) + ]) + elif test $want_pam = yes; then + AC_ERROR([Can't build with PAM support: pam_appl.h not found]) + else + not_passdb="$not_passdb pam" + fi +]) |