Blame m4/arpa_inet_h.m4

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