aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-11-09 19:34:42 +0000
committerWerner Koch <[email protected]>2015-11-09 19:34:42 +0000
commitf92e95175e90120362a7d6376fb32307e11267b5 (patch)
tree21d936ec20f982586f11da8c3bbb0e0ca0c60cf3
parentscd: Add reder information to --card-status. (diff)
downloadgnupg-f92e95175e90120362a7d6376fb32307e11267b5.tar.gz
gnupg-f92e95175e90120362a7d6376fb32307e11267b5.zip
dirmngr: Improve detection of ADNS.
* configure.ac (HAVE_ADNS_FREE): New ac_define. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--configure.ac10
-rw-r--r--dirmngr/dns-stuff.c5
2 files changed, 9 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 22d1cfc42..57bf85e1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 3220d7659..cae2c5737 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -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