From 0a5a56544c379b12fe65c3a303c6ac62d81f0e68 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 8 Nov 2021 12:26:44 +0100 Subject: [PATCH] dnsdist: Add a configure option to disable CDB --- pdns/dnsdistdist/configure.ac | 2 +- pdns/dnsdistdist/m4/dnsdist_with_cdb.m4 | 39 +++++++++++++++++++++++++ pdns/dnsdistdist/m4/pdns_check_cdb.m4 | 1 - 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 pdns/dnsdistdist/m4/dnsdist_with_cdb.m4 delete mode 120000 pdns/dnsdistdist/m4/pdns_check_cdb.m4 diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index eb1006f3b8..65a44ac840 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -98,7 +98,7 @@ AS_IF([test "x$enable_dns_over_https" != "xno"], [ PDNS_WITH_NGHTTP2 -PDNS_CHECK_CDB +DNSDIST_WITH_CDB PDNS_CHECK_LMDB PDNS_ENABLE_IPCIPHER diff --git a/pdns/dnsdistdist/m4/dnsdist_with_cdb.m4 b/pdns/dnsdistdist/m4/dnsdist_with_cdb.m4 new file mode 100644 index 0000000000..d874e2ee5b --- /dev/null +++ b/pdns/dnsdistdist/m4/dnsdist_with_cdb.m4 @@ -0,0 +1,39 @@ +AC_DEFUN([DNSDIST_WITH_CDB], [ + AC_MSG_CHECKING([whether we will we liniking with libcdb]) + HAVE_CDB=0 + AC_ARG_WITH([cdb], + AS_HELP_STRING([--with-cdb], [use CDB @<:@default=auto@:>@]), + [with_cdb=$withval], + [with_cdb=auto] + ) + AC_MSG_RESULT([$with_cdb]) + + AS_IF([test "x$with_cdb" != "xno"], [ + AS_IF([test "x$with_cdb" = "xyes" -o "x$with_cdb" = "xauto"], [ + PKG_CHECK_MODULES([CDB], [libcdb], [ + [HAVE_CDB=1] + AC_DEFINE([HAVE_CDB], [1], [Define to 1 if you have CDB]) + ], + [AC_CHECK_HEADERS([cdb.h], + [AC_CHECK_LIB([cdb], [cdb_find], + [ + CDB_LIBS="-lcdb" + AC_DEFINE([HAVE_CDB], [1], [Define to 1 if you have CDB]) + [HAVE_CDB=1] + ], + [:] + )], + [:] + )] + ) + ]) + ]) + AC_SUBST(CDB_LIBS) + AC_SUBST(CDB_CFLAGS) + AM_CONDITIONAL([HAVE_CDB], [test "x$CDB_LIBS" != "x"]) + AS_IF([test "x$with_cdb" = "xyes"], [ + AS_IF([test x"$CDB_LIBS" = "x"], [ + AC_MSG_ERROR([CDB requested but libraries were not found]) + ]) + ]) +]) diff --git a/pdns/dnsdistdist/m4/pdns_check_cdb.m4 b/pdns/dnsdistdist/m4/pdns_check_cdb.m4 deleted file mode 120000 index 02cc194939..0000000000 --- a/pdns/dnsdistdist/m4/pdns_check_cdb.m4 +++ /dev/null @@ -1 +0,0 @@ -../../../m4/pdns_check_cdb.m4 \ No newline at end of file -- 2.47.2