Bugzilla – Bug 625
configure fails to detect getaddrinfo() on Tru64 v5.1
Last modified: 2013-11-20 14:49:44 MST
Tru64 v5.1 has getaddrinfo(), but not in the form most systems have it. From /usr/include/netdb.h: #if defined (_SOCKADDR_LEN) || defined (_XOPEN_SOURCE_EXTENDED) #define getaddrinfo ngetaddrinfo #else #define getaddrinfo ogetaddrinfo #endif The configure script only looks for the library symbol, so it doesn't find the function (Sudo hg tip here): checking for getaddrinfo... no checking for getaddrinfo in -lsocket... no checking for getaddrinfo in -linet... no checking for getaddrinfo in -lsocket -lnsl... no It thus enables building compat/getaddrinfo.c, which fails due to conflicting definitions: libtool: compile: cc -c -I../../include -I.. -I../.. -D__STDC_WANT_LIB_EXT1__=1 -std1 -warnprotos -readonly_strings -fast -O4 ../../compat/getaddrinfo.c -DPIC -o .libs/getaddrinfo.o [several warnings about redefined cpp symbols] cc: Error: ../../compat/getaddrinfo.h, line 36: In this declaration, the struct "addrinfo" is redefined. (redefstruct) struct addrinfo { ^ cc: Error: ../../compat/getaddrinfo.h, line 72: In this declaration, the type of "gai_strerror" is not compatible with the type of a previous declaration of "gai_strerror" at line number 293 in file /usr/include/netdb.h. (notcompat) const char *gai_strerror(int ecode); ------------^ [...] If I manually edit config.h so that HAVE_GETADDRINFO is #defined, then the build succeeds. It would probably make sense to check for getaddrinfo() using AC_LINK_IFELSE() instead of AC_CHECK_FUNCS(), but the concomitant usage of SUDO_CHECK_LIB() makes the solution less than straightforward.
I've checked in a dedicated check for getaddrifo() that should address this.
And it does, sure enough. Sudo now builds (and tests) cleanly on Tru64 v5.1. Thank you for the fix!