diff options
author | Yang Tse <yangsita@gmail.com> | 2005-12-18 04:47:29 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2005-12-18 04:47:29 +0000 |
commit | 1d9efefdfafe75d7f6f76b169aa95e4c8d42bd33 (patch) | |
tree | f74fb45042ca014f91d5af27e4363304def9acb5 /configure.ac | |
parent | 14a8b3f6b214c0154de07f81160171bee3121a83 (diff) | |
download | c-ares-1d9efefdfafe75d7f6f76b169aa95e4c8d42bd33.tar.gz c-ares-1d9efefdfafe75d7f6f76b169aa95e4c8d42bd33.tar.bz2 c-ares-1d9efefdfafe75d7f6f76b169aa95e4c8d42bd33.zip |
Fix Msys/Mingw not detecting getnameinfo() with AC_CHECK_FUNCS
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 5b3431a..fe21513 100644 --- a/configure.ac +++ b/configure.ac @@ -247,6 +247,35 @@ AC_TRY_LINK( [], ) +dnl Msys/Mingw does not detect getnameinfo() in AC_CHECK_FUNCS. +dnl +if test "$ac_cv_func_getnameinfo" = "no"; then + AC_MSG_CHECKING([deeper and deeper for getnameinfo]) + AC_TRY_LINK([ +#undef inline +#ifdef HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <winsock2.h> +#include <ws2tcpip.h> +#else +#include <sys/types.h> +#include <sys/socket.h> +#include <netdb.h> +#endif + ],[ + getnameinfo(0, 0, 0, 0, 0, 0, 0); + ],[ + AC_MSG_RESULT([yes]) + ac_cv_func_getnameinfo="yes" + AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1, + [Define to 1 if you have the getnameinfo function.]) + ],[ + AC_MSG_RESULT([no]) + ]) +fi + + dnl check for inet_pton AC_CHECK_FUNCS(inet_pton) dnl Some systems have it, but not IPv6 |