arpa_inet_h.m4 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # arpa_inet_h.m4 serial 5
  2. dnl Copyright (C) 2006, 2008 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. ARPA_INET_H='arpa/inet.h'
  17. HAVE_ARPA_INET_H=0
  18. fi
  19. AC_SUBST([HAVE_ARPA_INET_H])
  20. dnl Execute this unconditionally, because ARPA_INET_H may be set by other
  21. dnl modules, after this code is executed.
  22. gl_CHECK_NEXT_HEADERS([arpa/inet.h])
  23. ])
  24. dnl Unconditionally enables the replacement of <arpa/inet.h>.
  25. AC_DEFUN([gl_REPLACE_ARPA_INET_H],
  26. [
  27. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
  28. ARPA_INET_H='arpa/inet.h'
  29. ])
  30. AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
  31. [
  32. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  33. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
  34. GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
  35. ])
  36. AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
  37. [
  38. GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
  39. GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
  40. dnl Assume proper GNU behavior unless another module says otherwise.
  41. HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
  42. HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
  43. ARPA_INET_H=''; AC_SUBST([ARPA_INET_H])
  44. ])