2 dnl AUTHOR: Squid Web Cache team
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.
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.
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.
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.
29 dnl these checks must be performed in the same order as here defined,
30 dnl and have mostly been lifted out of an inlined configure.in.
32 dnl checks for a broken solaris header file, and sets squid_cv_broken_krb5_h
33 dnl to yes if that's the case
34 AC_DEFUN([SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H], [
35 AC_CACHE_CHECK([for broken Solaris krb5.h],squid_cv_broken_krb5_h, [
36 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
39 ]])], [ squid_cv_broken_krb5_h=no ], [
40 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
41 #if defined(__cplusplus)
42 #define KRB5INT_BEGIN_DECLS extern "C" {
43 #define KRB5INT_END_DECLS
48 ]])], [ squid_cv_broken_krb5_h=yes ], [ squid_cv_broken_krb5_h=no ])
51 ]) dnl SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
54 dnl check the max skew in the krb5 context, and sets squid_cv_max_skew_context
55 AC_DEFUN([SQUID_CHECK_MAX_SKEW_IN_KRB5_CONTEXT],[
56 AC_CACHE_CHECK([for max_skew in struct krb5_context],
57 squid_cv_max_skew_context, [
60 #if HAVE_BROKEN_SOLARIS_KRB5_H
61 #if defined(__cplusplus)
62 #define KRB5INT_BEGIN_DECLS extern "C" {
63 #define KRB5INT_END_DECLS
68 krb5_context kc; kc->max_skew = 1;
70 ],[ squid_cv_max_skew_context=yes ],
71 [ squid_cv_max_skew_context=no ])
75 dnl check whether the kerberos context has a memory cache. Sets
76 dnl squid_cv_memory_cache if that's the case.
77 AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[
78 AC_CACHE_CHECK([for memory cache], squid_cv_memory_cache, [
81 #if HAVE_BROKEN_SOLARIS_KRB5_H
82 #if defined(__cplusplus)
83 #define KRB5INT_BEGIN_DECLS extern "C" {
84 #define KRB5INT_END_DECLS
94 krb5_init_context(&context);
95 return krb5_cc_resolve(context, "MEMORY:test_cache", &cc);
98 ], [ squid_cv_memory_cache=yes ], [ squid_cv_memory_cache=no ])
103 dnl checks that gssapi is ok, and sets squid_cv_working_gssapi accordingly
104 AC_DEFUN([SQUID_CHECK_WORKING_GSSAPI], [
105 AC_CACHE_CHECK([for working gssapi], squid_cv_working_gssapi, [
106 AC_RUN_IFELSE([AC_LANG_SOURCE([[
107 #ifdef HAVE_HEIMDAL_KERBEROS
108 #ifdef HAVE_GSSAPI_GSSAPI_H
109 #include <gssapi/gssapi.h>
110 #elif defined(HAVE_GSSAPI_H)
114 #ifdef HAVE_GSSAPI_GSSAPI_H
115 #include <gssapi/gssapi.h>
116 #elif defined(HAVE_GSSAPI_H)
119 #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
120 #include <gssapi/gssapi_krb5.h>
122 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
123 #include <gssapi/gssapi_generic.h>
132 gss_create_empty_oid_set(&val, &set);
136 ]])], [ squid_cv_working_gssapi=yes ], [ squid_cv_working_gssapi=no ])])
140 dnl check for a working spnego, and set squid_cv_have_spnego
141 AC_DEFUN([SQUID_CHECK_SPNEGO_SUPPORT], [
142 AC_CACHE_CHECK([for spnego support], squid_cv_have_spnego, [
143 AC_RUN_IFELSE([AC_LANG_SOURCE([[
144 #ifdef HAVE_HEIMDAL_KERBEROS
145 #ifdef HAVE_GSSAPI_GSSAPI_H
146 #include <gssapi/gssapi.h>
147 #elif defined(HAVE_GSSAPI_H)
151 #ifdef HAVE_GSSAPI_GSSAPI_H
152 #include <gssapi/gssapi.h>
153 #elif defined(HAVE_GSSAPI_H)
156 #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
157 #include <gssapi/gssapi_krb5.h>
159 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
160 #include <gssapi/gssapi_generic.h>
164 int main(int argc, char *argv[]) {
165 OM_uint32 major_status,minor_status;
166 gss_OID_set gss_mech_set;
169 static gss_OID_desc _gss_mech_spnego = {6, (void *)"\x2b\x06\x01\x05\x05\x02"};
170 gss_OID gss_mech_spnego = &_gss_mech_spnego;
172 major_status = gss_indicate_mechs( &minor_status, &gss_mech_set);
174 for (i=0;i<gss_mech_set->count;i++) {
175 if (!memcmp(gss_mech_set->elements[i].elements,gss_mech_spnego->elements,gss_mech_set->elements[i].length)) {
183 [ squid_cv_have_spnego=yes ], [ squid_cv_have_spnego=no ])])
186 dnl checks that krb5 is functional. Sets squid_cv_working_krb5
187 AC_DEFUN([SQUID_CHECK_WORKING_KRB5],[
188 AC_CACHE_CHECK([for working krb5], squid_cv_working_krb5, [
189 AC_RUN_IFELSE([AC_LANG_SOURCE([[
191 #if HAVE_BROKEN_SOLARIS_KRB5_H
192 #if defined(__cplusplus)
193 #define KRB5INT_BEGIN_DECLS extern "C" {
194 #define KRB5INT_END_DECLS
204 krb5_context context;
206 krb5_init_context(&context);
210 ]])], [ squid_cv_working_krb5=yes ], [ squid_cv_working_krb5=no ])])