summaryrefslogtreecommitdiffstats
path: root/m4/want_pam.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
commitf7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch)
treea3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /m4/want_pam.m4
parentInitial commit. (diff)
downloaddovecot-upstream.tar.xz
dovecot-upstream.zip
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--m4/want_pam.m436
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
+])