Blame m4/arpa_inet_h.m4

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