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