dirmngr: Improve detection of ADNS.

* configure.ac (HAVE_ADNS_FREE): New ac_define.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-11-09 20:34:42 +01:00
parent bce0e3f71d
commit f92e95175e
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 9 additions and 6 deletions

View File

@ -943,12 +943,8 @@ AC_ARG_WITH(adns,
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi])
if test "$with_adns" != "no"; then
AC_CHECK_HEADERS(adns.h,
AC_CHECK_LIB(adns, adns_free,
[have_adns=yes],
[CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}]),
[CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}])
AC_CHECK_HEADERS(adns.h,AC_CHECK_LIB(adns, adns_init_strcfg,[have_adns=yes]))
AC_CHECK_FUNCS(adns_free)
AC_MSG_CHECKING([if adns supports adns_if_tormode])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <adns.h>
@ -959,6 +955,8 @@ if test "$with_adns" != "no"; then
AC_DEFINE(HAVE_ADNS_IF_TORMODE,1,[define if adns_if_tormode is available])
fi
fi
CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
if test "$have_adns" = "yes"; then
ADNSLIBS="-ladns"
fi

View File

@ -65,6 +65,11 @@
# define AI_ADDRCONFIG 0
#endif
/* Provide a replacement function for older ADNS versions. */
#ifndef HAVE_ADNS_FREE
# define adns_free(a) free ((a))
#endif
/* Not every installation has gotten around to supporting SRVs or
CERTs yet... */
#ifndef T_SRV