1 ## Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3 ## Squid software is distributed under GPLv2+ license and includes
4 ## contributions from numerous individuals and organizations.
5 ## Please see the COPYING and CONTRIBUTORS files for details.
8 dnl check for --with-tdb option
9 AC_DEFUN([SQUID_CHECK_LIBTDB],[
11 AS_HELP_STRING([--without-tdb],
12 [Do not use Samba TrivialDB. Default: auto-detect]), [
15 : # Nothing special to do here
18 AS_IF([test ! -d "$withval"],
19 AC_MSG_ERROR([--with-tdb path ($with_tdb) does not point to a directory])
21 LIBTDB_PATH="-L$withval/lib"
22 CPPFLAGS="-I$withval/include $CPPFLAGS"
26 AH_TEMPLATE(USE_TRIVIALDB,[Samba TrivialDB support is available])
27 AS_IF([test "x$with_tdb" != "xno"],[
28 SQUID_STATE_SAVE(squid_libtdb_state)
29 LIBS="$LIBS $LIBTDB_PATH"
30 PKG_CHECK_MODULES([LIBTDB],[tdb],[CPPFLAGS="$CPPFLAGS $LIBTDB_CFLAGS"],[:])
31 AC_CHECK_HEADERS([sys/stat.h tdb.h],,,[
36 SQUID_STATE_ROLLBACK(squid_libtdb_state) #de-pollute LIBS
38 AS_IF([test "x$with_tdb" = "xyes" -a "x$LIBTDB_LIBS" = "x"],
39 AC_MSG_ERROR([Required TrivialDB library not found])
41 AS_IF([test "x$LIBTDB_LIBS" != "x"],[
42 CXXFLAGS="$LIBTDB_CFLAGS $CXXFLAGS"
43 LIBTDB_LIBS="$LIBTDB_PATH $LIBTDB_LIBS"
44 AC_DEFINE_UNQUOTED(USE_TRIVIALDB, HAVE_TDB_H, [Samba TrivialDB support is available])
47 AC_MSG_NOTICE([Samba TrivialDB library support: ${with_tdb:=auto} ${LIBTDB_PATH} ${LIBTDB_LIBS}])