]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability fix: improve detecition of libdb-related headers.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 27 Apr 2010 10:17:20 +0000 (12:17 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 27 Apr 2010 10:17:20 +0000 (12:17 +0200)
configure.in
helpers/external_acl/session/config.test
helpers/external_acl/session/squid_session.c

index 2ceb7bb6316e7bcf7f6f3ce1e8cc2a42cd1451a5..8d9a2c45e451d298a11288074f915d97d30c244c 100644 (file)
@@ -2844,17 +2844,24 @@ AC_SUBST(LDAPLIB)
 AC_SUBST(LBERLIB)
 
 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,,,[
+AC_INCLUDES_DEFAULT
+#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"
   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
+AC_INCLUDES_DEFAULT
 #if HAVE_DB_185_H
 #include <db_185.h>
 #elif HAVE_DB_H
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 3af08324cb058ae352aceeaec41daa92a174a7c3..ba529d82f5bea77462dbabafa8538bd068455bcf 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;