]> git.ipfire.org Git - thirdparty/squid.git/blame - acinclude/pam.m4
Bug 5428: Warn if pkg-config is not found (#1902)
[thirdparty/squid.git] / acinclude / pam.m4
CommitLineData
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
8dnl check whether PAM's struct pam_conv takes a const (linux-style) or
9dnl non-const (solaris-style) parametrs to the conv function.
10dnl
11dnl sets the shell variable squid_cv_pam_conv_signature to either
12dnl "linux", "solaris" or "unknown".
13dnl defines the C preprocessor macro PAM_CONV_FUNC_CONST_PARM to either
14dnl "static" (linux-style) or the empty string (solaris-style or default)
15
16AC_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>
23static int
8b082ed9 24password_conversation(int, const struct pam_message **, struct pam_response **, void *) { return 0; }
3c586e38
FC
25static 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>
31static int
8b082ed9 32password_conversation(int, struct pam_message **, struct pam_response **, void *) { return 0; }
3c586e38 33static 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