From: Amos Jeffries Date: Fri, 14 Nov 2008 09:43:02 +0000 (+1300) Subject: Make squid_kerb_auth build out of tree along with squid X-Git-Tag: SQUID_3_2_0_1~1334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1f95b42100eb1f9fdeecd56db8fdcb9acd1d5b9;p=thirdparty%2Fsquid.git Make squid_kerb_auth build out of tree along with squid --- diff --git a/configure.in b/configure.in index d537a186f6..92dfc6a810 100644 --- a/configure.in +++ b/configure.in @@ -38,6 +38,11 @@ dnl Pass squid.conf directory base location to code files as a compiler define CFLAGS="-DDEFAULT_SQUID_CONFIG_DIR=\\\"$sysconfdir\\\" $CFLAGS" CXXFLAGS="-DDEFAULT_SQUID_CONFIG_DIR=\\\"$sysconfdir\\\" $CXXFLAGS" +dnl Make the squid top srcdir available to sub-packages as --with-squid=PATH +new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir" +ac_configure_args="$new_configure_args" + + use_loadable_modules=1 AC_MSG_CHECKING(whether to use loadable modules) AC_ARG_ENABLE(loadable-modules, diff --git a/helpers/negotiate_auth/squid_kerb_auth/configure.in b/helpers/negotiate_auth/squid_kerb_auth/configure.in index 0bb1fa10e2..0d71005e5e 100644 --- a/helpers/negotiate_auth/squid_kerb_auth/configure.in +++ b/helpers/negotiate_auth/squid_kerb_auth/configure.in @@ -17,6 +17,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([squid_kerb_auth],[1.0.5],[markus_moeller@compuserve.com]) AM_INIT_AUTOMAKE(squid_kerb_auth,1.0.5) +AC_CONFIG_SRCDIR([squid_kerb_auth.c]) AC_PROG_CC AC_PROG_CPP @@ -379,38 +380,19 @@ LIBS=$old_LIBS AC_C_BIGENDIAN -eval ac_p_include=$includedir -CPPFLAGS="$CPPFLAGS -I$ac_p_include -I../../../include" -AC_CACHE_CHECK([for SQUID],ac_cv_have_squid,[ -AC_TRY_RUN([ -#include -int main(int argc, char *argv[]) { -#ifdef SQUID_CONFIG_H -return 0; -#else -return 1; -#endif -}], - ac_cv_have_squid=yes, - ac_cv_have_squid=no)]) -eval ac_p_lib=$libdir -LDFLAGS="$LDFLAGS -L../../../lib -L$ac_p_lib $w_flag$ac_p_lib$w_flag_2" -if test x"$ac_cv_have_squid" = x"yes"; then - AC_DEFINE(HAVE_SQUID,1, [Define to 1 if you have SQUID]) - AC_CHECK_HEADERS(getaddrinfo.h getnameinfo.h util.h) - AC_CHECK_DECLS([xgetaddrinfo], [], [], [[#include ]]) - AC_CHECK_DECLS([xfreeaddrinfo], [], [], [[#include ]]) - AC_CHECK_DECLS([xgai_strerror], [], [], [[#include ]]) - AC_CHECK_DECLS([xgetnameinfo], [], [], [[#include ]]) - AC_CHECK_DECLS([xstrdup], [], [], [[#include ]]) - AC_CHECK_DECLS([xmalloc], [], [], [[#include ]]) - AC_CHECK_DECLS([xfree], [], [], [[#include ]]) - AC_CHECK_LIB(m,main) - AC_CHECK_LIB(mw,main) - LIBS="-lmiscutil $LIBS" -fi +AC_CHECK_HEADERS( \ + errno.h \ + netdb.h \ + stdio.h \ + stdlib.h \ + string.h \ + sys/time.h\ + time.h \ + unistd.h \ +) + +AC_CONFIG_HEADER(ska_config.h) -AC_CONFIG_HEADER(config.h) AH_TOP([/* * ----------------------------------------------------------------------------- * @@ -440,6 +422,70 @@ AH_TOP([/* * ----------------------------------------------------------------------------- */ ]) + +squid_dir= +AC_ARG_WITH([squid], + AC_HELP_STRING([--with-squid=PATH], + [Special option for building bundled inside Squid. Do not define manually.]), + [ squid_dir=$withval ] +) + +eval ac_p_include=$includedir +CPPFLAGS="$CPPFLAGS -I$ac_p_include -I../../../ -I$squid_dir/include -I$squid_dir/src " +AC_CACHE_CHECK([for SQUID at '$squid_dir' ],ac_cv_have_squid,[ +AC_TRY_RUN([ +#include +int main(int argc, char *argv[]) { +#ifdef SQUID_CONFIG_H +return 0; +#else +return 1; +#endif +}], + ac_cv_have_squid=yes, + ac_cv_have_squid=no) +]) +eval ac_p_lib=$libdir +LDFLAGS="$LDFLAGS -L../../../lib -L$ac_p_lib $w_flag$ac_p_lib$w_flag_2" +if test "x$ac_cv_have_squid" = "xyes"; then + AC_DEFINE(HAVE_SQUID,1, [Define to 1 if you have SQUID]) + AC_CHECK_HEADERS(getaddrinfo.h getnameinfo.h util.h) + AC_CHECK_DECLS([xgetaddrinfo], [], [], [[#include ]]) + AC_CHECK_DECLS([xfreeaddrinfo], [], [], [[#include ]]) + AC_CHECK_DECLS([xgai_strerror], [], [], [[#include ]]) + AC_CHECK_DECLS([xgetnameinfo], [], [], [[#include ]]) + AC_CHECK_DECLS([xstrdup], [], [], [[#include ]]) + AC_CHECK_DECLS([xmalloc], [], [], [[#include ]]) + AC_CHECK_DECLS([xfree], [], [], [[#include ]]) + AC_CHECK_LIB(m,main) + AC_CHECK_LIB(mw,main) + LIBS="-lmiscutil $LIBS" +AH_TOP([ /* This is building inside Squid. We need their config as well. */ +/* bit of autoconf magic hack */ +#undef HAVE_SQUID + +#if HAVE_SQUID +#include "config.h" +#endif +]) +AH_BOTTOM([ +/* Squid provides a few compat libraries */ +#ifdef HAVE_SQUID +#ifdef HAVE_GETADDRINFO_H +#include "getaddrinfo.h" +#endif +#ifdef HAVE_GETNAMEINFO_H +#include "getnameinfo.h" +#endif +#ifdef HAVE_UTIL_H +#include "util.h" +#endif +#endif /* HAVE_SQUID */ +]) + +fi + + AH_BOTTOM([ #ifdef HAVE_HEIMDAL_KERBEROS #ifdef HAVE_GSSAPI_GSSAPI_H @@ -507,6 +553,6 @@ done AC_OUTPUT(Makefile) -echo "configure: updating config.h" -sed -e "s/|MAIL|/"$PACKAGE_BUGREPORT"/" config.h > .config.h.tmp -mv .config.h.tmp config.h +echo "configure: updating ska_config.h" +sed -e "s/|MAIL|/"$PACKAGE_BUGREPORT"/" ska_config.h > .ska_config.h.tmp +mv .ska_config.h.tmp ska_config.h diff --git a/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c b/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c index bdf04332b0..b2621f67d6 100644 --- a/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c +++ b/helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c @@ -29,73 +29,31 @@ /* * Hosted at http://sourceforge.net/projects/squidkerbauth */ +#include "ska_config.h" + +#if HAVE_STRING_H #include +#endif +#if HAVE_STDIO_H #include +#endif +#if HAVE_STDLIB_H #include +#endif +#if HAVE_NETDB_H #include +#endif +#if HAVE_UNISTD_H #include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_SYS_TIME_H #include +#endif -#include "config.h" -#ifdef HAVE_SQUID -#ifdef PACKAGE -#undef PACKAGE -#endif -#ifdef PACKAGE_BUGREPORT -#undef PACKAGE_BUGREPORT -#endif -#ifdef PACKAGE_NAME -#undef PACKAGE_NAME -#endif -#ifdef PACKAGE_STRING -#undef PACKAGE_STRING -#endif -#ifdef PACKAGE_TARNAME -#undef PACKAGE_TARNAME -#endif -#ifdef PACKAGE_VERSION -#undef PACKAGE_VERSION -#endif -#ifdef VERSION -#undef VERSION -#endif -#ifdef HAVE_GETADDRINFO_H -#include "getaddrinfo.h" -#endif -#ifdef HAVE_GETNAMEINFO_H -#include "getnameinfo.h" -#endif -#ifdef HAVE_UTIL_H -#include "util.h" -#endif -#ifdef PACKAGE -#undef PACKAGE -#endif -#ifdef PACKAGE_BUGREPORT -#undef PACKAGE_BUGREPORT -#endif -#ifdef PACKAGE_NAME -#undef PACKAGE_NAME -#endif -#ifdef PACKAGE_STRING -#undef PACKAGE_STRING -#endif -#ifdef PACKAGE_TARNAME -#undef PACKAGE_TARNAME -#endif -#ifdef PACKAGE_VERSION -#undef PACKAGE_VERSION -#endif -#ifdef VERSION -#undef VERSION -#endif -/* - * Reset varibles - */ -#include "config.h" -#endif #if !defined(HAVE_DECL_XGETADDRINFO) || !HAVE_DECL_XGETADDRINFO #define xgetaddrinfo getaddrinfo #endif 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 ef4157c13e..60576ecb74 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 @@ -25,68 +25,34 @@ * Hosted at http://sourceforge.net/projects/squidkerbauth */ +#include "ska_config.h" + +#if HAVE_STRING_H #include +#endif +#if HAVE_STDIO_H #include +#endif +#if HAVE_STDLIB_H #include +#endif +#if HAVE_NETDB_H #include +#endif +#if HAVE_UNISTD_H #include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_SYS_TIME_H #include +#endif +#if HAVE_ERRNO_H #include +#endif -#include "config.h" -#ifdef HAVE_SQUID -#ifdef PACKAGE -#undef PACKAGE -#endif -#ifdef PACKAGE_BUGREPORT -#undef PACKAGE_BUGREPORT -#endif -#ifdef PACKAGE_NAME -#undef PACKAGE_NAME -#endif -#ifdef PACKAGE_STRING -#undef PACKAGE_STRING -#endif -#ifdef PACKAGE_TARNAME -#undef PACKAGE_TARNAME -#endif -#ifdef PACKAGE_VERSION -#undef PACKAGE_VERSION -#endif -#ifdef VERSION -#undef VERSION -#endif -#ifdef HAVE_UTIL_H -#include "util.h" -#endif -#ifdef PACKAGE -#undef PACKAGE -#endif -#ifdef PACKAGE_BUGREPORT -#undef PACKAGE_BUGREPORT -#endif -#ifdef PACKAGE_NAME -#undef PACKAGE_NAME -#endif -#ifdef PACKAGE_STRING -#undef PACKAGE_STRING -#endif -#ifdef PACKAGE_TARNAME -#undef PACKAGE_TARNAME -#endif -#ifdef PACKAGE_VERSION -#undef PACKAGE_VERSION -#endif -#ifdef VERSION -#undef VERSION -#endif -/* - * Reset varibles - */ -#include "config.h" -#endif #if !defined(HAVE_DECL_XMALLOC) || !HAVE_DECL_XMALLOC #define xmalloc malloc #endif diff --git a/include/config.h b/include/config.h index 8bfbe58ae3..7b0e6527df 100644 --- a/include/config.h +++ b/include/config.h @@ -35,8 +35,13 @@ #define SQUID_CONFIG_H #include "autoconf.h" /* For GNU autoconf variables */ + +#if !defined(HAVE_SQUID) +/* sub-packages define their own version details */ #include "version.h" +#endif + /* To keep API definitions clear */ #ifdef __cplusplus #define SQUIDCEXTERN extern "C"