diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 21:11:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 21:11:59 +0000 |
commit | 3cd01b932e1c85394272ae64fae67ebeda92fb00 (patch) | |
tree | c5a3115d710afc1879ddea5349362a2bc651733c /m4/dnsdist_with_cdb.m4 | |
parent | Initial commit. (diff) | |
download | dnsdist-3cd01b932e1c85394272ae64fae67ebeda92fb00.tar.xz dnsdist-3cd01b932e1c85394272ae64fae67ebeda92fb00.zip |
Adding upstream version 1.8.3.upstream/1.8.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/dnsdist_with_cdb.m4')
-rw-r--r-- | m4/dnsdist_with_cdb.m4 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/m4/dnsdist_with_cdb.m4 b/m4/dnsdist_with_cdb.m4 new file mode 100644 index 0000000..d874e2e --- /dev/null +++ b/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]) + ]) + ]) +]) |