]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: check if getaddrinfo() is available
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 25 Apr 2014 15:29:59 +0000 (17:29 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 29 Apr 2014 10:43:03 +0000 (12:43 +0200)
This allows disabling IPv6 support and keeping getaddrinfo().

configure
nameserv.c

index 7d914453cf5fbf79a883b62887ce32fb51fca13b..db022426db6811b941341919272d95883e07e52d 100755 (executable)
--- 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>' 'sys/timepps.h' '' '' ''; then
index 328212b46ffe199505bcbfe4b9792de04d2b809e..f8a4b63a80e1b854c7ee346f75f61c451d2f5398 100644 (file)
@@ -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;