From: Amos Jeffries Date: Wed, 5 May 2010 07:42:45 +0000 (+1200) Subject: Author: Francesco Chemolli X-Git-Tag: SQUID_3_1_4~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c916c7773bbdb6583b785a0e95d4043bbebdf2a1;p=thirdparty%2Fsquid.git Author: Francesco Chemolli Portability fix: improve detecition of libdb-related headers. --- diff --git a/configure.in b/configure.in index 36cc967bcf..f956531c5e 100644 --- a/configure.in +++ b/configure.in @@ -2846,7 +2846,24 @@ AC_SUBST(LIB_LDAP) AC_SUBST(LIB_LBER) dnl Check for libdb +dnl this is not fully functional if db.h is for a differend db version DBLIB= + +dnl check that dbopen is actually defined in the header +dnl FIXME: in case of failure undef db-related includes etc. +AC_CHECK_DECL(dbopen,,,[ +#if HAVE_SYS_TYPES_H +#include +#endif +#if HAVE_LIMITS_H +#include +#endif +#if HAVE_DB_185_H +#include +#elif HAVE_DB_H +#include +#endif]) + dnl 1.85 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [ SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb" diff --git a/helpers/external_acl/session/config.test b/helpers/external_acl/session/config.test index 42aec74614..83b0f99047 100755 --- a/helpers/external_acl/session/config.test +++ b/helpers/external_acl/session/config.test @@ -4,7 +4,7 @@ if [ -f /usr/include/db_185.h ]; then exit 0 fi -if [ -f /usr/include/db.h ]; then +if [ -f /usr/include/db.h ] && grep dbopen /usr/include/db.h; then exit 0 fi exit 1 diff --git a/helpers/external_acl/session/squid_session.c b/helpers/external_acl/session/squid_session.c index f92c0c98c3..56add1baae 100644 --- a/helpers/external_acl/session/squid_session.c +++ b/helpers/external_acl/session/squid_session.c @@ -43,12 +43,11 @@ #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ #endif -#if defined(HAVE_DB_185_H) + +#if HAVE_DB_185_H #include -#elif defined(HAVE_DB_H) +#elif HAVE_DB_H #include -#else -#include #endif static int session_ttl = 3600;