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/pdns_check_lmdb.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 '')
-rw-r--r-- | m4/pdns_check_lmdb.m4 | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/m4/pdns_check_lmdb.m4 b/m4/pdns_check_lmdb.m4 new file mode 100644 index 0000000..5a54f07 --- /dev/null +++ b/m4/pdns_check_lmdb.m4 @@ -0,0 +1,49 @@ +dnl invoking this makes lmdb a requirement +AC_DEFUN([PDNS_CHECK_LMDB], [ + AC_MSG_CHECKING([where to find the lmdb library and headers]) + AC_ARG_WITH([lmdb], + AS_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[ + with_lmdb=$withval + ],[ + with_lmdb=auto + ]) + AC_MSG_RESULT([$with_lmdb]) + + AS_IF([test "$with_lmdb" != "no"], [ + AS_IF([test "x$with_lmdb" = "xyes" -o "x$with_lmdb" = "xauto"], [ + PKG_CHECK_MODULES([LMDB], [lmdb], [ + AC_DEFINE([HAVE_LMDB], [1], [Define to 1 if you have LMDB]) + [HAVE_LMDB=1] + ], [ : ] + ) + ], [ + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + AS_IF([test -d "$with_lmdb/include"], [ + LMDB_CFLAGS="-I$with_lmdb/include" + LMDB_LIBS="-L$with_lmdb/lib" + ],[ + LMDB_CFLAGS="-I$with_lmdb" + LMDB_LIBS="-L$with_lmdb" + ]) + CPPFLAGS="$LMDB_CFLAGS" + LIBS="$LMDB_LIBS" + + AC_SEARCH_LIBS([mdb_env_open], [lmdb], [ + AC_CHECK_HEADERS([lmdb.h], [ + dnl ac_cv_search_mdb_env_open contains '-llmdb' + LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_open" + AC_DEFINE([HAVE_LMDB], [1], [Define to 1 if you have LMDB]) + [HAVE_LMDB=1] + ], [ + AC_MSG_ERROR([lmdb headers not found in $with_lmdb]) + ]) + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + AC_SUBST([LMDB_CFLAGS]) + AC_SUBST([LMDB_LIBS]) + ]) + ]) + ]) + AM_CONDITIONAL([HAVE_LMDB], [test "x$LMDB_LIBS" != "x"]) +]) |