From 824f1c79441adfcf081304901a23ef060614500a Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Mon, 20 Jan 2003 15:04:16 +0000 Subject: [PATCH] Only look for a system getaddrinfo/getnameinfo if AI_PASSIVE is defined by system headers. This fixes compile errors on Irix 6.5. --- configure.in | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/configure.in b/configure.in index 59cb99d1..72a47816 100644 --- a/configure.in +++ b/configure.in @@ -327,20 +327,35 @@ 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)) -# Tru64 UNIX has getaddrinfo() but has it renamed in libc as -# something else so we must include to get the -# redefinition. -AC_CHECK_FUNCS(getaddrinfo, , - [AC_MSG_CHECKING([for getaddrinfo by including ]) - AC_TRY_LINK([#include - #include - #include ],[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)) +# Irix 6.5 has getaddrinfo but not the corresponding defines, so use +# builtin getaddrinfo if one of the defines don't exist +AC_MSG_CHECKING([whether defines needed by getaddrinfo exist]) +AC_EGREP_CPP(yes, [ +#include +#include +#include +#ifdef AI_PASSIVE +yes +#endif], [ + AC_MSG_RESULT(yes) + # Tru64 UNIX has getaddrinfo() but has it renamed in libc as + # something else so we must include to get the + # redefinition. + AC_CHECK_FUNCS(getaddrinfo, , + [AC_MSG_CHECKING([for getaddrinfo by including ]) + AC_TRY_LINK([#include + #include + #include ],[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_MSG_RESULT(no) + ) + AC_CHECK_MEMBER([struct sockaddr.sa_len], [ AC_DEFINE(HAVE_SOCKADDR_LEN) ], -- 2.34.1