]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
75bd9771 | 2 | dnl "$Id: cups-pam.m4 7149 2007-12-19 19:38:37Z mike $" |
ef416fc2 | 3 | dnl |
4 | dnl PAM stuff for the Common UNIX Printing System (CUPS). | |
5 | dnl | |
bc44d920 | 6 | dnl Copyright 2007 by Apple Inc. |
ef416fc2 | 7 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. |
8 | dnl | |
9 | dnl These coded instructions, statements, and computer programs are the | |
bc44d920 | 10 | dnl property of Apple Inc. and are protected by Federal copyright |
11 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | dnl which should have been included with this file. If this file is | |
13 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | dnl |
15 | ||
16 | AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support, default=yes]) | |
17 | ||
18 | dnl Don't use PAM with AIX... | |
19 | if test $uname = AIX; then | |
20 | enable_pam=no | |
21 | fi | |
22 | ||
23 | PAMDIR="" | |
24 | PAMFILE="" | |
25 | PAMLIBS="" | |
26 | PAMMOD="pam_unknown.so" | |
27 | ||
28 | if test x$enable_pam != xno; then | |
29 | SAVELIBS="$LIBS" | |
30 | ||
31 | AC_CHECK_LIB(dl,dlopen) | |
32 | AC_CHECK_LIB(pam,pam_start) | |
a4924f6c | 33 | AC_CHECK_LIB(pam,pam_set_item,AC_DEFINE(HAVE_PAM_SET_ITEM)) |
ee571f26 | 34 | AC_CHECK_LIB(pam,pam_setcred,AC_DEFINE(HAVE_PAM_SETCRED)) |
ef416fc2 | 35 | AC_CHECK_HEADER(security/pam_appl.h) |
36 | if test x$ac_cv_header_security_pam_appl_h != xyes; then | |
37 | AC_CHECK_HEADER(pam/pam_appl.h, | |
38 | AC_DEFINE(HAVE_PAM_PAM_APPL_H)) | |
39 | fi | |
40 | ||
41 | if test x$ac_cv_lib_pam_pam_start != xno; then | |
42 | # Set the necessary libraries for PAM... | |
43 | if test x$ac_cv_lib_dl_dlopen != xno; then | |
44 | PAMLIBS="-lpam -ldl" | |
45 | else | |
46 | PAMLIBS="-lpam" | |
47 | fi | |
48 | ||
49 | # Find the PAM configuration directory, if any... | |
50 | for dir in /private/etc/pam.d /etc/pam.d; do | |
51 | if test -d $dir; then | |
52 | PAMDIR=$dir | |
53 | break; | |
54 | fi | |
55 | done | |
56 | fi | |
57 | ||
58 | LIBS="$SAVELIBS" | |
59 | ||
60 | case "$uname" in | |
61 | Darwin*) | |
62 | # Darwin, MacOS X | |
63 | PAMFILE="pam.darwin" | |
64 | ;; | |
65 | IRIX) | |
66 | # SGI IRIX | |
67 | PAMFILE="pam.irix" | |
68 | ;; | |
69 | *) | |
70 | # All others; this test might need to be updated | |
71 | # as Linux distributors move things around... | |
72 | for mod in pam_unix2.so pam_unix.so pam_pwdb.so; do | |
73 | if test -f /lib/security/$mod; then | |
74 | PAMMOD="$mod" | |
75 | break; | |
76 | fi | |
77 | done | |
78 | ||
79 | PAMFILE="pam.std" | |
80 | ;; | |
81 | esac | |
82 | fi | |
83 | ||
84 | AC_SUBST(PAMDIR) | |
85 | AC_SUBST(PAMFILE) | |
86 | AC_SUBST(PAMLIBS) | |
87 | AC_SUBST(PAMMOD) | |
88 | ||
89 | dnl | |
75bd9771 | 90 | dnl End of "$Id: cups-pam.m4 7149 2007-12-19 19:38:37Z mike $". |
ef416fc2 | 91 | dnl |