]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE macro (#2316)
authorAmos Jeffries <yadij@users.noreply.github.com>
Sun, 4 Jan 2026 02:21:53 +0000 (02:21 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 4 Jan 2026 04:01:01 +0000 (04:01 +0000)
* trivial whitespace cleanup
* reposition for alphabetical naming order
* move SQUID_DEFINE_BOOL inside the check macro

acinclude/krb5.m4

index 156c6a25980ae86ff8c64120ef078b7ded9c4ecd..a09cabd645493dfe07347f1ced200ba1ca24a27e 100644 (file)
@@ -5,6 +5,27 @@
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
+dnl check whether the Kerberos context has a memory cache
+AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[
+  AC_REQUIRE([SQUID_STATE_SAVE])
+  AC_REQUIRE([SQUID_STATE_ROLLBACK])
+  AC_REQUIRE([SQUID_DEFINE_BOOL])
+  AC_CACHE_CHECK([for Kerberos context memory cache],squid_cv_krb5_memory_cache,[
+    SQUID_STATE_SAVE(squid_krb5_test)
+    CPPFLAGS="-I${srcdir:-.} $CPPFLAGS"
+    AC_RUN_IFELSE([
+      AC_LANG_PROGRAM([[#include "compat/krb5.h"]],[[
+        krb5_context c;
+        krb5_ccache cc;
+        krb5_init_context(&c);
+        return krb5_cc_resolve(c, "MEMORY:test_cache", &cc);
+      ]])
+    ],[squid_cv_krb5_memory_cache=yes],[squid_cv_krb5_memory_cache=no],[:])
+    SQUID_STATE_ROLLBACK(squid_krb5_test)
+  ])
+  SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_krb5_memory_cache,[kerberos has MEMORY: cache support])
+]) dnl SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE
+
 AC_DEFUN([SQUID_CHECK_SOLARIS_KRB5],[
   # no pkg-config for solaris native Kerberos
   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],[
   ])
 ])
 
-dnl check whether the kerberos context has a memory cache. Sets
-dnl squid_cv_memory_cache if that's the case.
-AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE],[
-  AC_CACHE_CHECK([for memory cache], squid_cv_memory_cache, [
-    SQUID_STATE_SAVE(squid_krb5_test)
-    CPPFLAGS="-I${srcdir:-.} $CPPFLAGS"
-    AC_RUN_IFELSE([
-      AC_LANG_SOURCE([[
-#include "compat/krb5.h"
-int main(int argc, char *argv[])
-{
-    krb5_context context;
-    krb5_ccache cc;
-
-    krb5_init_context(&context);
-    return krb5_cc_resolve(context, "MEMORY:test_cache", &cc);
-}
-      ]])
-    ], [ squid_cv_memory_cache=yes ], [ squid_cv_memory_cache=no ], [:])
-    SQUID_STATE_ROLLBACK(squid_krb5_test)
-  ])
-])
-
 dnl check whether the kerberos context has a memory keytab. Sets
 dnl squid_cv_memory_keytab if that's the case.
 AC_DEFUN([SQUID_CHECK_KRB5_CONTEXT_MEMORY_KEYTAB],[
@@ -275,9 +273,6 @@ AC_DEFUN([SQUID_CHECK_KRB5_FUNCS],[
   SQUID_STATE_ROLLBACK(squid_krb5_test)
 
   SQUID_CHECK_KRB5_CONTEXT_MEMORY_CACHE
-  SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_CACHE,$squid_cv_memory_cache,
-       [Define if kerberos has MEMORY: cache support])
-
   SQUID_CHECK_KRB5_CONTEXT_MEMORY_KEYTAB
   SQUID_DEFINE_BOOL(HAVE_KRB5_MEMORY_KEYTAB,$squid_cv_memory_keytab,
        [Define if kerberos has MEMORY: keytab support])