]> git.ipfire.org Git - thirdparty/pdns.git/blame - m4/pdns_check_lmdb.m4
Update secpoll for rec-4.1.14 release.
[thirdparty/pdns.git] / m4 / pdns_check_lmdb.m4
CommitLineData
f335e87e 1dnl invoking this makes lmdb a requirement
2AC_DEFUN([PDNS_CHECK_LMDB], [
3 AC_MSG_CHECKING([where to find the lmdb library and headers])
4 AC_ARG_WITH([lmdb],
5 AC_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[
6 with_lmdb=$withval
7 ],[
8 with_lmdb=auto
9 ])
10 AC_MSG_RESULT([$with_lmdb])
11
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])
16 ])
17 ], [
18 save_CPPFLAGS=$CPPFLAGS
19 save_LIBS=$LIBS
20 AS_IF([test -d "$with_lmdb/include"], [
21 LMDB_CFLAGS="-I$with_lmdb/include"
22 LMDB_LIBS="-L$with_lmdb/lib"
23 ],[
24 LMDB_CFLAGS="-I$with_lmdb"
25 LMDB_LIBS="-L$with_lmdb"
26 ])
27 CPPFLAGS="$LMDB_CFLAGS"
28 LIBS="$LMDB_LIBS"
29
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"
34 ], [
35 AC_MSG_ERROR([lmdb headers not found in $with_lmdb])
36 ])
37 CPPFLAGS="$save_CPPFLAGS"
38 LIBS="$save_LIBS"
39 AC_SUBST([LMDB_CFLAGS])
40 AC_SUBST([LMDB_LIBS])
41 ])
42 ])
43 ], [
44 AC_MSG_ERROR([--with-lmdb is set to 'no', but lmdb support is required])
45 ])
46])