dirmngr: Improve detection of ADNS.
authorWerner Koch <wk@gnupg.org>
Mon, 9 Nov 2015 19:34:42 +0000 (20:34 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 9 Nov 2015 19:34:42 +0000 (20:34 +0100)
* configure.ac (HAVE_ADNS_FREE): New ac_define.

Signed-off-by: Werner Koch <wk@gnupg.org>
configure.ac
dirmngr/dns-stuff.c

index 22d1cfc..57bf85e 100644 (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
index 3220d76..cae2c57 100644 (file)
 # 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