arpa_inet_h.m4 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # arpa_inet_h.m4 serial 14
  2. dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. dnl Written by Simon Josefsson and Bruno Haible
  7. AC_DEFUN([gl_HEADER_ARPA_INET],
  8. [
  9. dnl Use AC_REQUIRE here, so that the default behavior below is expanded
  10. dnl once only, before all statements that occur in other macros.
  11. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
  12. AC_CHECK_HEADERS_ONCE([arpa/inet.h])
  13. if test $ac_cv_header_arpa_inet_h = yes; then
  14. HAVE_ARPA_INET_H=1
  15. else
  16. HAVE_ARPA_INET_H=0
  17. fi
  18. AC_SUBST([HAVE_ARPA_INET_H])
  19. dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
  20. gl_CHECK_NEXT_HEADERS([arpa/inet.h])
  21. AC_REQUIRE([gl_FEATURES_H])
  22. gl_PREREQ_SYS_H_WS2TCPIP
  23. dnl Check for declarations of anything we want to poison if the
  24. dnl corresponding gnulib module is not in use.
  25. gl_WARN_ON_USE_PREPARE([[
  26. /* On some systems, this header is not self-consistent. */
  27. #if !(defined __GLIBC__ || defined __UCLIBC__)
  28. # include <sys/socket.h>
  29. #endif
  30. #ifdef __TANDEM
  31. # include <netdb.h>
  32. #endif
  33. #include <arpa/inet.h>
  34. ]], [inet_ntop inet_pton])
  35. ])
  36. AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
  37. [
  38. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  39. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
  40. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  41. ])
  42. AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
  43. [
  44. GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
  45. GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
  46. dnl Assume proper GNU behavior unless another module says otherwise.
  47. HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
  48. HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
  49. REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP])
  50. REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON])
  51. ])