]> git.ipfire.org Git - thirdparty/squid.git/blob - acinclude/pam.m4
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / acinclude / pam.m4
1 ## Copyright (C) 1996-2018 The Squid Software Foundation and contributors
2 ##
3 ## Squid software is distributed under GPLv2+ license and includes
4 ## contributions from numerous individuals and organizations.
5 ## Please see the COPYING and CONTRIBUTORS files for details.
6 ##
7
8 dnl check whether PAM's struct pam_conv takes a const (linux-style) or
9 dnl non-const (solaris-style) parametrs to the conv function.
10 dnl
11 dnl sets the shell variable squid_cv_pam_conv_signature to either
12 dnl "linux", "solaris" or "unknown".
13 dnl defines the C preprocessor macro PAM_CONV_FUNC_CONST_PARM to either
14 dnl "static" (linux-style) or the empty string (solaris-style or default)
15
16 AC_DEFUN([CHECK_STRUCT_PAM_CONV], [
17 AH_TEMPLATE([PAM_CONV_FUNC_CONST_PARM],
18 [Defined to const or empty depending on the style used by the OS to refer to the PAM message dialog func])
19 AC_CACHE_CHECK([for PAM conversation struct signature type],
20 squid_cv_pam_conv_signature, [
21 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
22 #include <security/pam_appl.h>
23 static int
24 password_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {}
25 static struct pam_conv conv = { &password_conversation, 0 };
26 ]])], [
27 squid_cv_pam_conv_signature=linux
28 ], [
29 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
30 #include <security/pam_appl.h>
31 static int
32 password_conversation(int num_msg, struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {}
33 static struct pam_conv conv = { &password_conversation, 0 };
34 ]])], [
35 squid_cv_pam_conv_signature=solaris
36 ], [
37 squid_cv_pam_conv_signature=unknown
38 ])
39 ])
40 ])
41 case $squid_cv_pam_conv_signature in
42 linux) AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[const]) ;;
43 solaris) AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[]) ;;
44 *) AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[]) ;;
45 esac
46 ]) dnl CHECK_STRUCT_PAM_CONV
47
48