dirmngr: Check that getaddrinfo is available.
authorWerner Koch <wk@gnupg.org>
Wed, 21 Oct 2015 20:11:59 +0000 (22:11 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 21 Oct 2015 20:11:59 +0000 (22:11 +0200)
* dirmngr/Makefile.am (t_http_SOURCES): Add dns-stuff.c.
(t_ldap_parse_uri_SOURCES): Ditto.
* dirmngr/dns-stuff.c: Bail out if neither ADNS nor getaddrinfo is
available.
--

We used to have replacement code for getaddrinfo and thus check for it
in configure.  However, this was for the old http and dns-cert code
from common/.  For dirmngr I made liberal use of getaddrinfo w/o
without checking.  Just in case someone tries to build on an old
platform we now error our with a suitable #error.

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

index 8cb1bb7..0d4400f 100644 (file)
@@ -128,7 +128,7 @@ endif
 
 
 # http tests
-t_http_SOURCES = t-http.c http.c
+t_http_SOURCES = t-http.c http.c dns-stuff.c
 t_http_CFLAGS  = -DWITHOUT_NPTH=1 \
                 $(LIBGCRYPT_CFLAGS) $(NTBTLS_CFLAGS) $(LIBGNUTLS_CFLAGS) \
                  $(GPG_ERROR_CFLAGS)
@@ -136,7 +136,8 @@ t_http_LDADD   = $(t_common_ldadd) \
                 $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(DNSLIBS)
 
 t_ldap_parse_uri_SOURCES = \
-       t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h http.c \
+       t-ldap-parse-uri.c ldap-parse-uri.c ldap-parse-uri.h \
+        http.c dns-stuff.c \
         $(ldap_url) $(t_common_src)
 t_ldap_parse_uri_CFLAGS = -DWITHOUT_NPTH=1
 t_ldap_parse_uri_LDADD = $(ldaplibs) $(t_common_ldadd)
index 00d2b3e..3fa6054 100644 (file)
 # include <adns.h>
 #endif
 
+#if !defined(HAVE_GETADDRINFO) && !defined(USE_ADNS)
+# error Either getaddrinfo or the ADNS libary is required.
+#endif
+
 #include "util.h"
 #include "host2net.h"
 #include "dns-stuff.h"