Blame m4/arpa_inet_h.m4

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