X-Git-Url: https://git.eyrie.org/?a=blobdiff_plain;f=m4%2Ftinycdb.m4;h=1c9ef437e10a0d4411cf127a00774ed11f036bea;hb=a5cde2ff73f2ec6c98ba41961d3378b516c9e29f;hp=cb8c1f73b29d0721e2a13a81440484cc527a4492;hpb=5035d3b9fbbcef295faea99c67b973545031dc80;p=kerberos%2Fkrb5-strength.git diff --git a/m4/tinycdb.m4 b/m4/tinycdb.m4 index cb8c1f7..1c9ef43 100644 --- a/m4/tinycdb.m4 +++ b/m4/tinycdb.m4 @@ -9,9 +9,10 @@ dnl substitution variables CDB_CPPFLAGS, CDB_LDFLAGS, and CDB_LIBS. Also 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 dnl Copyright 2010, 2013 @@ -35,7 +36,10 @@ dnl says to fail if the libcdb library could not be found. 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]) @@ -45,8 +49,7 @@ dnl The main macro for packages with mandatory kadmin client support. 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], @@ -55,6 +58,4 @@ 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])])])])