Patch from Albert Chin to fix getaddrinfo on Tru64 UNIX 5.x.
authorMartin Pool <mbp@samba.org>
Tue, 19 Feb 2002 23:40:47 +0000 (23:40 +0000)
committerMartin Pool <mbp@samba.org>
Tue, 19 Feb 2002 23:40:47 +0000 (23:40 +0000)
configure.in

index 1af15ad..9e50c42 100644 (file)
@@ -315,7 +315,18 @@ dnl AC_MSG_NOTICE([Looking in libraries: $LIBS])
 AC_CHECK_FUNCS(inet_ntop, , AC_LIBOBJ(lib/inet_ntop)) 
 AC_CHECK_FUNCS(inet_pton, , AC_LIBOBJ(lib/inet_pton))
 
-AC_CHECK_FUNCS(getaddrinfo, , AC_LIBOBJ(lib/getaddrinfo)) 
+# Tru64 UNIX has getaddrinfo() but has it renamed in libc as
+# something else so we must include <netdb.h> to get the
+# redefinition.
+AC_MSG_CHECKING([for getaddrinfo])
+AC_TRY_LINK([#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>],[getaddrinfo(NULL, NULL, NULL, NULL);],
+       [AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_GETADDRINFO, 1,
+               [Define if you have the `getaddrinfo' function.])],
+       [AC_MSG_RESULT([no])
+       AC_LIBOBJ(lib/getaddrinfo)])
 AC_CHECK_FUNCS(getnameinfo, , AC_LIBOBJ(lib/getnameinfo))
 
 AC_CHECK_MEMBER([struct sockaddr.sa_len],