| 1 |
## This file is part of GNU Dico |
| 2 |
## Copyright (C) 2014-2024 Sergey Poznyakoff |
| 3 |
## |
| 4 |
## GNU Dico is free software; you can redistribute it and/or modify |
| 5 |
## it under the terms of the GNU General Public License as published by |
| 6 |
## the Free Software Foundation; either version 3, or (at your option) |
| 7 |
## any later version. |
| 8 |
## |
| 9 |
## GNU Dico is distributed in the hope that it will be useful, |
| 10 |
## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
## GNU General Public License for more details. |
| 13 |
## |
| 14 |
## You should have received a copy of the GNU General Public License |
| 15 |
## along with GNU Dico. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
|
| 17 |
## module description: PAM |
| 18 |
|
| 19 |
status_pam=maybe |
| 20 |
AC_ARG_ENABLE([pam], |
| 21 |
AS_HELP_STRING([--enable-pam], |
| 22 |
[enable PAM]), |
| 23 |
[ |
| 24 |
case "${enableval}" in |
| 25 |
yes) status_pam=yes ;; |
| 26 |
no) status_pam=no ;; |
| 27 |
*) AC_MSG_ERROR([bad value ${enableval} for --enable-pam]) ;; |
| 28 |
esac],[status_pam=maybe]) |
| 29 |
|
| 30 |
AC_SUBST(PAM_LIBS) |
| 31 |
if test "$status_pam" != "no"; then |
| 32 |
pam=$status_pam |
| 33 |
AC_CHECK_HEADERS(security/pam_appl.h) |
| 34 |
if test "$ac_cv_header_security_pam_appl_h" = "yes"; then |
| 35 |
AC_CHECK_LIB(dl, dlopen, [PAM_LIBS=-ldl]) |
| 36 |
AC_CHECK_LIB(pam, pam_start, |
| 37 |
[status_pam=yes], |
| 38 |
[status_pam=no], $PAM_LIBS) |
| 39 |
else |
| 40 |
status_pam=no |
| 41 |
fi |
| 42 |
if test $pam = yes && test $pam != $status_pam; then |
| 43 |
AC_MSG_ERROR([required module PAM cannot be built because of missing prerequisites]) |
| 44 |
fi |
| 45 |
fi |
| 46 |
|
| 47 |
AM_CONDITIONAL([PAM_COND], [test $status_pam = yes]) |