]> git.ipfire.org Git - thirdparty/squid.git/blob - acinclude/pam.m4
Merged from parent (trunk r10600).
[thirdparty/squid.git] / acinclude / pam.m4
1 dnl
2 dnl AUTHOR: Francesco Chemolli <kinkie@squid-cache.org>
3 dnl
4 dnl SQUID Web Proxy Cache http://www.squid-cache.org/
5 dnl ----------------------------------------------------------
6 dnl Squid is the result of efforts by numerous individuals from
7 dnl the Internet community; see the CONTRIBUTORS file for full
8 dnl details. Many organizations have provided support for Squid's
9 dnl development; see the SPONSORS file for full details. Squid is
10 dnl Copyrighted (C) 2001 by the Regents of the University of
11 dnl California; see the COPYRIGHT file for full details. Squid
12 dnl incorporates software developed and/or copyrighted by other
13 dnl sources; see the CREDITS file for full details.
14 dnl
15 dnl This program is free software; you can redistribute it and/or modify
16 dnl it under the terms of the GNU General Public License as published by
17 dnl the Free Software Foundation; either version 2 of the License, or
18 dnl (at your option) any later version.
19 dnl
20 dnl This program is distributed in the hope that it will be useful,
21 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
22 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 dnl GNU General Public License for more details.
24 dnl
25 dnl You should have received a copy of the GNU General Public License
26 dnl along with this program; if not, write to the Free Software
27 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
28
29
30
31
32 dnl check whether PAM's struct pam_conv takes a const (linux-style) or
33 dnl non-const (solaris-style) parametrs to the conv function.
34 dnl
35 dnl sets the shell variable squid_cv_pam_conv_signature to either
36 dnl "linux", "solaris" or "unknown".
37 dnl defines the C preprocessor macro PAM_CONV_FUNC_CONST_PARM to either
38 dnl "static" (linux-style) or the empty string (solaris-style or default)
39
40 AC_DEFUN([CHECK_STRUCT_PAM_CONV], [
41 AH_TEMPLATE([PAM_CONV_FUNC_CONST_PARM],
42 [Defined to const or empty depending on the style used by the OS to refer to the PAM message dialog func])
43 AC_CACHE_CHECK([for PAM conversation struct signature type],
44 squid_cv_pam_conv_signature, [
45 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
46 #include <security/pam_appl.h>
47 static int
48 password_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {}
49 static struct pam_conv conv = { &password_conversation, 0 };
50 ]])], [
51 squid_cv_pam_conv_signature=linux
52 ], [
53 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
54 #include <security/pam_appl.h>
55 static int
56 password_conversation(int num_msg, struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {}
57 static struct pam_conv conv = { &password_conversation, 0 };
58 ]])], [
59 squid_cv_pam_conv_signature=solaris
60 ], [
61 squid_cv_pam_conv_signature=unknown
62 ])
63 ])
64 ])
65 case $squid_cv_pam_conv_signature in
66 linux) AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[const]) ;;
67 solaris) AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[]) ;;
68 *) AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[]) ;;
69 esac
70 ]) dnl CHECK_STRUCT_PAM_CONV
71
72