xref: /freebsd/sys/contrib/openzfs/config/user-pam.m4 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1AC_DEFUN([ZFS_AC_CONFIG_USER_PAM], [
2	AC_ARG_ENABLE([pam],
3		AS_HELP_STRING([--enable-pam],
4		[install pam_zfs_key module [[default: check]]]),
5		[enable_pam=$enableval],
6		[enable_pam=check])
7
8	AC_ARG_WITH(pammoduledir,
9		AS_HELP_STRING([--with-pammoduledir=DIR],
10		[install pam module in dir [[$libdir/security]]]),
11		[pammoduledir="$withval"],[pammoduledir=$libdir/security])
12
13	AC_ARG_WITH(pamconfigsdir,
14		AS_HELP_STRING([--with-pamconfigsdir=DIR],
15		[install pam-config files in dir [DATADIR/pam-configs]]),
16		[pamconfigsdir="$withval"],
17		[pamconfigsdir='${datadir}/pam-configs'])
18
19	AS_IF([test "x$enable_pam" != "xno"], [
20		AC_CHECK_HEADERS([security/pam_modules.h], [
21			enable_pam=yes
22		], [
23			AS_IF([test "x$enable_pam" = "xyes"], [
24				AC_MSG_FAILURE([
25	*** security/pam_modules.h missing, libpam0g-dev package required
26				])
27			],[
28				enable_pam=no
29			])
30		])
31	])
32	AS_IF([test "x$enable_pam" = "xyes"], [
33		DEFINE_PAM='--with pam'
34	])
35	AC_SUBST(DEFINE_PAM)
36	AC_SUBST(pammoduledir)
37	AC_SUBST(pamconfigsdir)
38])
39