1 ## Copyright (C) 1996-2014 The Squid Software Foundation and contributors
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.
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.
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)
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>
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 };
27 squid_cv_pam_conv_signature=linux
29 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
30 #include <security/pam_appl.h>
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 };
35 squid_cv_pam_conv_signature=solaris
37 squid_cv_pam_conv_signature=unknown
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],[]) ;;
46 ]) dnl CHECK_STRUCT_PAM_CONV