]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-pam.m4
Merge changes from CUPS 1.4svn-r8252.
[thirdparty/cups.git] / config-scripts / cups-pam.m4
CommitLineData
ef416fc2 1dnl
b19ccc9e 2dnl "$Id: cups-pam.m4 7960 2008-09-17 19:42:02Z mike $"
ef416fc2 3dnl
4dnl PAM stuff for the Common UNIX Printing System (CUPS).
5dnl
b19ccc9e 6dnl Copyright 2007-2008 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])
b19ccc9e 17AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use, default=auto])
ef416fc2 18
19dnl Don't use PAM with AIX...
20if test $uname = AIX; then
21 enable_pam=no
22fi
23
24PAMDIR=""
25PAMFILE=""
26PAMLIBS=""
27PAMMOD="pam_unknown.so"
28
29if test x$enable_pam != xno; then
30 SAVELIBS="$LIBS"
31
32 AC_CHECK_LIB(dl,dlopen)
33 AC_CHECK_LIB(pam,pam_start)
a4924f6c 34 AC_CHECK_LIB(pam,pam_set_item,AC_DEFINE(HAVE_PAM_SET_ITEM))
ee571f26 35 AC_CHECK_LIB(pam,pam_setcred,AC_DEFINE(HAVE_PAM_SETCRED))
ef416fc2 36 AC_CHECK_HEADER(security/pam_appl.h)
37 if test x$ac_cv_header_security_pam_appl_h != xyes; then
38 AC_CHECK_HEADER(pam/pam_appl.h,
39 AC_DEFINE(HAVE_PAM_PAM_APPL_H))
40 fi
41
42 if test x$ac_cv_lib_pam_pam_start != xno; then
43 # Set the necessary libraries for PAM...
44 if test x$ac_cv_lib_dl_dlopen != xno; then
45 PAMLIBS="-lpam -ldl"
46 else
47 PAMLIBS="-lpam"
48 fi
49
50 # Find the PAM configuration directory, if any...
51 for dir in /private/etc/pam.d /etc/pam.d; do
52 if test -d $dir; then
53 PAMDIR=$dir
54 break;
55 fi
56 done
57 fi
58
59 LIBS="$SAVELIBS"
60
61 case "$uname" in
62 Darwin*)
63 # Darwin, MacOS X
b19ccc9e
MS
64 if test "x$with_pam_module" != x; then
65 PAMFILE="pam.$with_pam_module"
66 elif test -f /usr/lib/pam/pam_opendirectory.so; then
67 PAMFILE="pam.opendirectory"
68 else
69 PAMFILE="pam.securityserver"
70 fi
ef416fc2 71 ;;
b19ccc9e 72
ef416fc2 73 IRIX)
74 # SGI IRIX
75 PAMFILE="pam.irix"
76 ;;
b19ccc9e 77
ef416fc2 78 *)
79 # All others; this test might need to be updated
80 # as Linux distributors move things around...
b19ccc9e
MS
81 if test "x$with_pam_module" != x; then
82 PAMMOD="pam_${with_pam_module}.so"
83 else
84 for mod in pam_unix2.so pam_unix.so pam_pwdb.so; do
85 if test -f /lib/security/$mod; then
86 PAMMOD="$mod"
87 break;
88 fi
89 done
90 fi
ef416fc2 91
92 PAMFILE="pam.std"
93 ;;
94 esac
95fi
96
97AC_SUBST(PAMDIR)
98AC_SUBST(PAMFILE)
99AC_SUBST(PAMLIBS)
100AC_SUBST(PAMMOD)
101
102dnl
b19ccc9e 103dnl End of "$Id: cups-pam.m4 7960 2008-09-17 19:42:02Z mike $".
ef416fc2 104dnl