You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
655 B

  1. dnl AX_GETADDRINFO checks for getaddrinfo() function and sets
  2. dnl $ax_cv_have_getaddrinfo accordingly and defines
  3. dnl HAVE_GETADDRINFO.
  4. AC_DEFUN([AX_GETADDRINFO], [
  5. AH_TEMPLATE([HAVE_GETADDRINFO])
  6. AC_CACHE_CHECK([for getaddrinfo], [ax_cv_have_getaddrinfo],
  7. [AC_COMPILE_IFELSE(
  8. [AC_LANG_PROGRAM([
  9. #ifdef __cplusplus
  10. #include <cstddef>
  11. #else
  12. #include <stddef.h>
  13. #endif
  14. #include <sys/types.h>
  15. #include <sys/socket.h>
  16. #include <netdb.h>
  17. ], [
  18. getaddrinfo (NULL, NULL, NULL, NULL);
  19. ])],
  20. [ax_cv_have_getaddrinfo=yes],
  21. [ax_cv_have_getaddrinfo=no])])
  22. AS_IF([test "x$ax_cv_have_getaddrinfo" = "xyes"],
  23. [AC_DEFINE([HAVE_GETADDRINFO])])
  24. ])