Blame m4/netinet_in_h.m4

Packit Service a2489d
# netinet_in_h.m4 serial 5
Packit Service a2489d
dnl Copyright (C) 2006-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
AC_DEFUN([gl_HEADER_NETINET_IN],
Packit Service a2489d
[
Packit Service a2489d
  AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
Packit Service a2489d
    [gl_cv_header_netinet_in_h_selfcontained],
Packit Service a2489d
    [
Packit Service a2489d
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
Packit Service a2489d
        [gl_cv_header_netinet_in_h_selfcontained=yes],
Packit Service a2489d
        [gl_cv_header_netinet_in_h_selfcontained=no])
Packit Service a2489d
    ])
Packit Service a2489d
  if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
Packit Service a2489d
    NETINET_IN_H=''
Packit Service a2489d
  else
Packit Service a2489d
    NETINET_IN_H='netinet/in.h'
Packit Service a2489d
    AC_CHECK_HEADERS([netinet/in.h])
Packit Service a2489d
    gl_CHECK_NEXT_HEADERS([netinet/in.h])
Packit Service a2489d
    if test $ac_cv_header_netinet_in_h = yes; then
Packit Service a2489d
      HAVE_NETINET_IN_H=1
Packit Service a2489d
    else
Packit Service a2489d
      HAVE_NETINET_IN_H=0
Packit Service a2489d
    fi
Packit Service a2489d
    AC_SUBST([HAVE_NETINET_IN_H])
Packit Service a2489d
  fi
Packit Service a2489d
  AC_SUBST([NETINET_IN_H])
Packit Service a2489d
  AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"])
Packit Service a2489d
])