arpa_inet_h.m4 1.8 KB

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