arpa_inet_h.m4 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # arpa_inet_h.m4 serial 13
  2. dnl Copyright (C) 2006, 2008-2014 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. dnl Check for declarations of anything we want to poison if the
  23. dnl corresponding gnulib module is not in use.
  24. gl_WARN_ON_USE_PREPARE([[
  25. /* On some systems, this header is not self-consistent. */
  26. #if !(defined __GLIBC__ || defined __UCLIBC__)
  27. # include <sys/socket.h>
  28. #endif
  29. #ifdef __TANDEM
  30. # include <netdb.h>
  31. #endif
  32. #include <arpa/inet.h>
  33. ]], [inet_ntop inet_pton])
  34. ])
  35. AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
  36. [
  37. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  38. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
  39. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  40. ])
  41. AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
  42. [
  43. GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
  44. GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
  45. dnl Assume proper GNU behavior unless another module says otherwise.
  46. HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
  47. HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
  48. REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP])
  49. REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON])
  50. ])