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