From: Amos Jeffries Date: Sun, 30 Nov 2008 05:29:55 +0000 (-0700) Subject: Real fix build errors in squid_kerb_auth X-Git-Tag: SQUID_3_2_0_1~1318 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bea882d65d7034e05c86bbe211d515124445366;p=thirdparty%2Fsquid.git Real fix build errors in squid_kerb_auth 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. --- diff --git a/helpers/negotiate_auth/squid_kerb_auth/Makefile.am b/helpers/negotiate_auth/squid_kerb_auth/Makefile.am index 71a95dbb83..4932346caa 100644 --- a/helpers/negotiate_auth/squid_kerb_auth/Makefile.am +++ b/helpers/negotiate_auth/squid_kerb_auth/Makefile.am @@ -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 diff --git a/helpers/negotiate_auth/squid_kerb_auth/configure.in b/helpers/negotiate_auth/squid_kerb_auth/configure.in index 49e61cd0aa..d77d86a24e 100644 --- a/helpers/negotiate_auth/squid_kerb_auth/configure.in +++ b/helpers/negotiate_auth/squid_kerb_auth/configure.in @@ -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 index 0000000000..f6b9d5227b --- /dev/null +++ b/helpers/negotiate_auth/squid_kerb_auth/squid_compat.h @@ -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 */ diff --git a/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth_test.c b/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth_test.c index 60576ecb74..6d509e2f38 100644 --- a/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth_test.c +++ b/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth_test.c @@ -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; }