]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Real fix build errors in squid_kerb_auth
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 30 Nov 2008 05:29:55 +0000 (22:29 -0700)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 30 Nov 2008 05:29:55 +0000 (22:29 -0700)
Seems my configure hack overlooked some auto-conf magic side-effects.
This moves most squid compat hacks into squid_compat.h for now.
Really fixes the current build issues in squid_kerb_auth with Squid.

helpers/negotiate_auth/squid_kerb_auth/Makefile.am
helpers/negotiate_auth/squid_kerb_auth/configure.in
helpers/negotiate_auth/squid_kerb_auth/squid_compat.h [new file with mode: 0644]
helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth_test.c

index 71a95dbb834abe36e77fa7fda4aeb66e55a2db7f..4932346caa2dff29e49ba2b18543e34aa09e5eeb 100644 (file)
@@ -16,12 +16,12 @@ SPNEGO_SOURCE= \
 EXTRA_DIST += $(SPNEGO_SOURCE)
 
 if HAVE_SPNEGO
-squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c base64.h
-squid_kerb_auth_test_SOURCES = squid_kerb_auth_test.c base64.c base64.h
+squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c base64.h squid_compat.h
+squid_kerb_auth_test_SOURCES = squid_kerb_auth_test.c base64.c base64.h squid_compat.h
 else
-squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c base64.h $(SPNEGO_SOURCE)
+squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c base64.h $(SPNEGO_SOURCE) squid_compat.h
 INCLUDES = -Ispnegohelp 
-squid_kerb_auth_test_SOURCES = squid_kerb_auth_test.c base64.c base64.h
+squid_kerb_auth_test_SOURCES = squid_kerb_auth_test.c base64.c base64.h squdi_compat.h
 endif
 
 
index 49e61cd0aa84631d011f44927af50b8951b8c2fc..d77d86a24e93b3d523faa2606972d7bdb1834e22 100644 (file)
@@ -465,15 +465,7 @@ AH_TOP([ /* This is building inside Squid. We need their config as well. */
 #undef HAVE_SQUID
 
 #if HAVE_SQUID
-#include "config.h"
- /* We want the Squid type and library definitions without the package ones */
-#undef VERSION
-#undef PACKAGE
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
+#include "squid_compat.h"
 #endif /* HAVE_SQUID */
 ])
 AH_BOTTOM([
diff --git a/helpers/negotiate_auth/squid_kerb_auth/squid_compat.h b/helpers/negotiate_auth/squid_kerb_auth/squid_compat.h
new file mode 100644 (file)
index 0000000..f6b9d52
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef SQUID__HELPERS_NEGOTIATE_AUTH_SQUID_KERB_AUTH_SQUID_COMPAT_H
+#define SQUID__HELPERS_NEGOTIATE_AUTH_SQUID_KERB_AUTH_SQUID_COMPAT_H
+
+/*
+ * We use a HAVE_SQUID define to override ther Squid-specific package
+ * definitions for their includes.
+ * AYJ: This whole bit needs re-working when compat.h exists.
+ * We will only need the compat.h and its library from squid.
+ */
+
+#if HAVE_SQUID
+
+#include "config.h"
+
+ /* We want the Squid type and library definitions without the package ones */
+#undef VERSION
+#undef PACKAGE
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME  
+#undef PACKAGE_STRING 
+#undef PACKAGE_TARNAME 
+#undef PACKAGE_VERSION 
+#endif /* HAVE_SQUID */
+
+#endif /* SQUID__HELPERS_NEGOTIATE_AUTH_SQUID_KERB_AUTH_SQUID_COMPAT_H */
index 60576ecb7483182176cded353b05302842c16e93..6d509e2f3894e44a34e6113b3dfd8dca5365dd5c 100644 (file)
@@ -79,7 +79,9 @@ static const char *LogTime()
 
     gettimeofday(&now, NULL);
     if (now.tv_sec != last_t) {
-        tm = localtime(&now.tv_sec);
+        // FreeBSD defines tv_sec as long in non-ARM systems with a TODO note
+        time_t tmp = now.tv_sec;
+        tm = localtime(&tmp);
         strftime(buf, 127, "%Y/%m/%d %H:%M:%S", tm);
         last_t = now.tv_sec;
     }