dnl provides RRA_LIB_CDB_SWITCH to set CPPFLAGS, LDFLAGS, and LIBS to include
dnl the kadmin client libraries, saving the ecurrent values, and
dnl RRA_LIB_CDB_RESTORE to restore those settings to before the last
-dnl RRA_LIB_CDB_SWITCH. Define HAVE_CDB if the library is found.
+dnl RRA_LIB_CDB_SWITCH. Defines HAVE_CDB and sets rra_use_CDB to true if the
+dnl library is found.
dnl
-dnl Depends on RRA_SET_LDFLAGS.
+dnl Depends on the lib-helper.m4 infrastructure.
dnl
dnl Written by Russ Allbery <rra@stanford.edu>
dnl Copyright 2010, 2013
AC_DEFUN([_RRA_LIB_CDB_INTERNAL],
[RRA_LIB_HELPER_PATHS([CDB])
RRA_LIB_CDB_SWITCH
- AC_CHECK_LIB([cdb], [cdb_init], [CDB_LIBS=-lcdb],
+ AC_CHECK_LIB([cdb], [cdb_init],
+ [CDB_LIBS=-lcdb
+ AC_DEFINE([HAVE_CDB], 1, [Define if libcdb is available.])
+ rra_use_CDB=true],
[AS_IF([test x"$1" = xtrue],
[AC_MSG_ERROR([cannot find usable TinyCDB library])])])
AC_CHECK_HEADERS([cdb.h])
AC_DEFUN([RRA_LIB_CDB],
[RRA_LIB_HELPER_VAR_INIT([CDB])
RRA_LIB_HELPER_WITH([tinycdb], [TinyCDB], [CDB])
- _RRA_LIB_CDB_INTERNAL([true])
- AC_DEFINE([HAVE_CDB], 1, [Define if libcdb is available.])])
+ _RRA_LIB_CDB_INTERNAL([true])])
dnl The main macro for packages with optional kadmin client support.
AC_DEFUN([RRA_LIB_CDB_OPTIONAL],
AS_IF([test x"$rra_use_CDB" != xfalse],
[AS_IF([test x"$rra_use_CDB" = xtrue],
[_RRA_LIB_CDB_INTERNAL([true])],
- [_RRA_LIB_CDB_INTERNAL([false])])])
- AS_IF([test x"$CDB_LIBS" != x],
- [AC_DEFINE([HAVE_CDB], 1, [Define if libcdb is available.])])])
+ [_RRA_LIB_CDB_INTERNAL([false])])])])