Blame m4/arpa_inet_h.m4

Packit 33f14e
# arpa_inet_h.m4 serial 13
Packit 33f14e
dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
Packit 33f14e
dnl This file is free software; the Free Software Foundation
Packit 33f14e
dnl gives unlimited permission to copy and/or distribute it,
Packit 33f14e
dnl with or without modifications, as long as this notice is preserved.
Packit 33f14e
Packit 33f14e
dnl Written by Simon Josefsson and Bruno Haible
Packit 33f14e
Packit 33f14e
AC_DEFUN([gl_HEADER_ARPA_INET],
Packit 33f14e
[
Packit 33f14e
  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
Packit 33f14e
  dnl once only, before all statements that occur in other macros.
Packit 33f14e
  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
Packit 33f14e
Packit 33f14e
  AC_CHECK_HEADERS_ONCE([arpa/inet.h])
Packit 33f14e
  if test $ac_cv_header_arpa_inet_h = yes; then
Packit 33f14e
    HAVE_ARPA_INET_H=1
Packit 33f14e
  else
Packit 33f14e
    HAVE_ARPA_INET_H=0
Packit 33f14e
  fi
Packit 33f14e
  AC_SUBST([HAVE_ARPA_INET_H])
Packit 33f14e
  dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
Packit 33f14e
  gl_CHECK_NEXT_HEADERS([arpa/inet.h])
Packit 33f14e
Packit 33f14e
  AC_REQUIRE([gl_FEATURES_H])
Packit 33f14e
Packit 33f14e
  dnl Check for declarations of anything we want to poison if the
Packit 33f14e
  dnl corresponding gnulib module is not in use.
Packit 33f14e
  gl_WARN_ON_USE_PREPARE([[
Packit 33f14e
/* On some systems, this header is not self-consistent.  */
Packit 33f14e
#if !(defined __GLIBC__ || defined __UCLIBC__)
Packit 33f14e
# include <sys/socket.h>
Packit 33f14e
#endif
Packit 33f14e
#ifdef __TANDEM
Packit 33f14e
# include <netdb.h>
Packit 33f14e
#endif
Packit 33f14e
#include <arpa/inet.h>
Packit 33f14e
    ]], [inet_ntop inet_pton])
Packit 33f14e
])
Packit 33f14e
Packit 33f14e
AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
Packit 33f14e
[
Packit 33f14e
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit 33f14e
  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
Packit 33f14e
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit 33f14e
])
Packit 33f14e
Packit 33f14e
AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
Packit 33f14e
[
Packit 33f14e
  GNULIB_INET_NTOP=0;     AC_SUBST([GNULIB_INET_NTOP])
Packit 33f14e
  GNULIB_INET_PTON=0;     AC_SUBST([GNULIB_INET_PTON])
Packit 33f14e
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit 33f14e
  HAVE_DECL_INET_NTOP=1;  AC_SUBST([HAVE_DECL_INET_NTOP])
Packit 33f14e
  HAVE_DECL_INET_PTON=1;  AC_SUBST([HAVE_DECL_INET_PTON])
Packit 33f14e
  REPLACE_INET_NTOP=0;    AC_SUBST([REPLACE_INET_NTOP])
Packit 33f14e
  REPLACE_INET_PTON=0;    AC_SUBST([REPLACE_INET_PTON])
Packit 33f14e
])