1 dnl invoking this makes lmdb a requirement
2 AC_DEFUN([PDNS_CHECK_LMDB], [
3 AC_MSG_CHECKING([where to find the lmdb library and headers])
5 AC_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[
10 AC_MSG_RESULT([$with_lmdb])
12 AS_IF([test "$with_lmdb" != "no"], [
13 AS_IF([test "x$with_lmdb" = "xyes" -o "x$with_lmdb" = "xauto"], [
14 PKG_CHECK_MODULES([LMDB], [lmdb], [ : ], [
15 AC_MSG_ERROR([lmdb not found via pkg-config, please install lmdb or set --with-lmdb to your lmdb installation directory])
18 save_CPPFLAGS=$CPPFLAGS
20 AS_IF([test -d "$with_lmdb/include"], [
21 LMDB_CFLAGS="-I$with_lmdb/include"
22 LMDB_LIBS="-L$with_lmdb/lib"
24 LMDB_CFLAGS="-I$with_lmdb"
25 LMDB_LIBS="-L$with_lmdb"
27 CPPFLAGS="$LMDB_CFLAGS"
30 AC_SEARCH_LIBS([mdb_env_open], [lmdb], [
31 AC_CHECK_HEADERS([lmdb.h], [
32 dnl ac_cv_search_mdb_env_open contains '-llmdb'
33 LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_open"
35 AC_MSG_ERROR([lmdb headers not found in $with_lmdb])
37 CPPFLAGS="$save_CPPFLAGS"
39 AC_SUBST([LMDB_CFLAGS])
44 AC_MSG_ERROR([--with-lmdb is set to 'no', but lmdb support is required])