]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Francesco Chemolli <kinkie@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 5 May 2010 07:42:45 +0000 (19:42 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 5 May 2010 07:42:45 +0000 (19:42 +1200)
Portability fix: improve detecition of libdb-related headers.

configure.in
helpers/external_acl/session/config.test
helpers/external_acl/session/squid_session.c

index 36cc967bcf30666d02fcf092dfb349a7aa8654cb..f956531c5e7bdc4cec0f21da5a36eeeb8865a38d 100644 (file)
@@ -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 <sys/types.h>
+#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_DB_185_H
+#include <db_185.h>
+#elif HAVE_DB_H
+#include <db.h>
+#endif])
+
 dnl 1.85
 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [
 SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb"
index 42aec74614b636fa6310bb4b587a9c90cd3ac4e5..83b0f9904725763384b64c9c1a896f9f8fe80d80 100755 (executable)
@@ -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
index f92c0c98c322af69d9eee9e23b1c529451587d41..56add1baae8e676a57784036cfef07b4454764e6 100644 (file)
 #ifndef        __BIT_TYPES_DEFINED__
 #define        __BIT_TYPES_DEFINED__
 #endif
-#if defined(HAVE_DB_185_H)
+
+#if HAVE_DB_185_H
 #include <db_185.h>
-#elif defined(HAVE_DB_H)
+#elif HAVE_DB_H
 #include <db.h>
-#else
-#include <db_185.h>
 #endif
 
 static int session_ttl = 3600;