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
716 B

  1. dnl AX_GETHOSTBYNAME_R checks for gethostbyname_r() function and sets
  2. dnl $ax_cv_have_gethostbyname_r accordingly and defines
  3. dnl HAVE_GETHOSTBYNAME_R.
  4. AC_DEFUN([AX_GETHOSTBYNAME_R], [
  5. AH_TEMPLATE([HAVE_GETHOSTBYNAME_R])
  6. AC_CACHE_CHECK([for gethostbyname_r], [ax_cv_have_gethostbyname_r],
  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. gethostbyname_r (NULL, NULL, NULL, 0, NULL, NULL);
  19. ])],
  20. [ax_cv_have_gethostbyname_r=yes],
  21. [ax_cv_have_gethostbyname_r=no])])
  22. AS_IF([test "x$ax_cv_have_gethostbyname_r" = "xyes"],
  23. [AC_DEFINE([HAVE_GETHOSTBYNAME_R])])
  24. ])