From: Miroslav Lichvar Date: Fri, 25 Apr 2014 15:29:59 +0000 (+0200) Subject: configure: check if getaddrinfo() is available X-Git-Tag: 1.30-pre1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d243f1f8feac1241a6d5be71964e9b9df5d06aa2;p=thirdparty%2Fchrony.git configure: check if getaddrinfo() is available This allows disabling IPv6 support and keeping getaddrinfo(). --- diff --git a/configure b/configure index 7d914453..db022426 100755 --- a/configure +++ b/configure @@ -413,6 +413,12 @@ then fi fi +if test_code 'getaddrinfo()' 'sys/types.h sys/socket.h netdb.h' '' '' \ + 'return getaddrinfo(0, 0, 0, 0);' +then + add_def HAVE_GETADDRINFO +fi + timepps_h="" if [ $feat_pps = "1" ]; then if test_code '' 'sys/timepps.h' '' '' ''; then diff --git a/nameserv.c b/nameserv.c index 328212b4..f8a4b63a 100644 --- a/nameserv.c +++ b/nameserv.c @@ -46,7 +46,7 @@ DNS_SetAddressFamily(int family) DNS_Status DNS_Name2IPAddress(const char *name, IPAddr *addr) { -#ifdef HAVE_IPV6 +#ifdef HAVE_GETADDRINFO struct addrinfo hints, *res, *ai; int result;