Skip to content

Commit 2e34a40

Browse files
yadijsquid-anubis
authored andcommitted
Polish SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE macro (#2316)
* trivial whitespace cleanup * reposition for alphabetical naming order * move SQUID_DEFINE_BOOL inside the check macro
1 parent 82e1486 commit 2e34a40

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

acinclude/krb5.m4

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@
55
## Please see the COPYING and CONTRIBUTORS files for details.
66
##
77

8+
dnl check whether the Kerberos context has a memory cache
9+
AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[
10+
AC_REQUIRE([SQUID_STATE_SAVE])
11+
AC_REQUIRE([SQUID_STATE_ROLLBACK])
12+
AC_REQUIRE([SQUID_DEFINE_BOOL])
13+
AC_CACHE_CHECK([for Kerberos context memory cache],squid_cv_krb5_memory_cache,[
14+
SQUID_STATE_SAVE(squid_krb5_test)
15+
CPPFLAGS="-I${srcdir:-.} $CPPFLAGS"
16+
AC_RUN_IFELSE([
17+
AC_LANG_PROGRAM([[#include "compat/krb5.h"]],[[
18+
krb5_context c;
19+
krb5_ccache cc;
20+
krb5_init_context(&c);
21+
return krb5_cc_resolve(c, "MEMORY:test_cache", &cc);
22+
]])
23+
],[squid_cv_krb5_memory_cache=yes],[squid_cv_krb5_memory_cache=no],[:])
24+
SQUID_STATE_ROLLBACK(squid_krb5_test)
25+
])
26+
SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_krb5_memory_cache,[kerberos has MEMORY: cache support])
27+
]) dnl SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE
28+
829
AC_DEFUN([SQUID_CHECK_SOLARIS_KRB5],[
930
# no pkg-config for solaris native Kerberos
1031
AS_IF([test "$cross_compiling" = "no" -a "x$with_mit_krb5" != "xyes" -a "x$with_mit_krb5" != "xno"],[
@@ -42,29 +63,6 @@ AC_DEFUN([SQUID_CHECK_SOLARIS_KRB5],[
4263
])
4364
])
4465

45-
dnl check whether the kerberos context has a memory cache. Sets
46-
dnl squid_cv_memory_cache if that's the case.
47-
AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[
48-
AC_CACHE_CHECK([for memory cache], squid_cv_memory_cache, [
49-
SQUID_STATE_SAVE(squid_krb5_test)
50-
CPPFLAGS="-I${srcdir:-.} $CPPFLAGS"
51-
AC_RUN_IFELSE([
52-
AC_LANG_SOURCE([[
53-
#include "compat/krb5.h"
54-
int main(int argc, char *argv[])
55-
{
56-
krb5_context context;
57-
krb5_ccache cc;
58-
59-
krb5_init_context(&context);
60-
return krb5_cc_resolve(context, "MEMORY:test_cache", &cc);
61-
}
62-
]])
63-
], [ squid_cv_memory_cache=yes ], [ squid_cv_memory_cache=no ], [:])
64-
SQUID_STATE_ROLLBACK(squid_krb5_test)
65-
])
66-
])
67-
6866
dnl check whether the kerberos context has a memory keytab. Sets
6967
dnl squid_cv_memory_keytab if that's the case.
7068
AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_KEYTAB],[
@@ -275,9 +273,6 @@ AC_DEFUN([SQUID_CHECK_KRB5_FUNCS],[
275273
SQUID_STATE_ROLLBACK(squid_krb5_test)
276274
277275
SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE
278-
SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_memory_cache,
279-
[Define if kerberos has MEMORY: cache support])
280-
281276
SQUID_CHECK_KRB5_CONTEXT_MEMORY_KEYTAB
282277
SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_KEYTAB,$squid_cv_memory_keytab,
283278
[Define if kerberos has MEMORY: keytab support])

0 commit comments

Comments
 (0)