]>
Commit | Line | Data |
---|---|---|
b8ae064d | 1 | ## Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
5d2e6f19 AJ |
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 | ## | |
3c586e38 FC |
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 | |
8b082ed9 | 24 | password_conversation(int, const struct pam_message **, struct pam_response **, void *) { return 0; } |
3c586e38 FC |
25 | static struct pam_conv conv = { &password_conversation, 0 }; |
26 | ]])], [ | |
27 | squid_cv_pam_conv_signature=linux | |
a1c22363 | 28 | ],[ |
3c586e38 FC |
29 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
30 | #include <security/pam_appl.h> | |
31 | static int | |
8b082ed9 | 32 | password_conversation(int, struct pam_message **, struct pam_response **, void *) { return 0; } |
3c586e38 | 33 | static struct pam_conv conv = { &password_conversation, 0 }; |
9603207d | 34 | ]])], [ |
3c586e38 | 35 | squid_cv_pam_conv_signature=solaris |
a1c22363 | 36 | ],[ |
3c586e38 FC |
37 | squid_cv_pam_conv_signature=unknown |
38 | ]) | |
39 | ]) | |
40 | ]) | |
a1c22363 AJ |
41 | AS_IF([test "$squid_cv_pam_conv_signature" = "linux"], |
42 | AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[const]), | |
43 | AC_DEFINE([PAM_CONV_FUNC_CONST_PARM],[]) | |
44 | ) | |
3c586e38 FC |
45 | ]) dnl CHECK_STRUCT_PAM_CONV |
46 | ||
47 |