]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/external/session/required.m4
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / acl / external / session / required.m4
index b52dbc70135c385f5d41f0a2286218ab8117d5de..e721cc1c23301a2274e11e7eb57ff57d6cb45bd3 100755 (executable)
@@ -1,8 +1,27 @@
-## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+## Copyright (C) 1996-2020 The Squid Software Foundation and contributors
 ##
 ## Squid software is distributed under GPLv2+ license and includes
 ## contributions from numerous individuals and organizations.
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <db.h>]],[[DB_ENV *db_env = NULL; db_env_create(&db_env, 0);]])],[BUILD_HELPER="session"],[])
+SQUID_CHECK_LIBTDB
+if test "$with_tdb" != "no"; then
+    BUILD_HELPER="session"
+fi
+
+LIBBDB_LIBS=
+AH_TEMPLATE(USE_BERKLEYDB,[BerkleyDB support is available])
+if test "x$with_tdb" = "xno"; then
+  AC_CHECK_HEADERS(db.h,[
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <db.h>]],[[
+      DB_ENV *db_env = nullptr;
+      db_env_create(&db_env, 0);
+    ]])],[
+      AC_DEFINE_UNQUOTED(USE_BERKLEYDB, HAVE_DB_H, [BerkleyDB support is available])
+      BUILD_HELPER="session"
+      LIBBDB_LIBS="-ldb"
+    ],[])
+  ])
+fi
+AC_SUBST(LIBBDB_LIBS)