autoupdate
[gnulib.git] / m4 / netinet_in_h.m4
blob926f7f95430a6b57ec88942aa0b2af4ca6575262
1 # netinet_in_h.m4
2 # serial 6
3 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_HEADER_NETINET_IN],
10   AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
11     [gl_cv_header_netinet_in_h_selfcontained],
12     [
13       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
14         [gl_cv_header_netinet_in_h_selfcontained=yes],
15         [gl_cv_header_netinet_in_h_selfcontained=no])
16     ])
17   if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
18     GL_GENERATE_NETINET_IN_H=false
19   else
20     GL_GENERATE_NETINET_IN_H=true
21     AC_CHECK_HEADERS([netinet/in.h])
22     gl_CHECK_NEXT_HEADERS([netinet/in.h])
23     if test $ac_cv_header_netinet_in_h = yes; then
24       HAVE_NETINET_IN_H=1
25     else
26       HAVE_NETINET_IN_H=0
27     fi
28     AC_SUBST([HAVE_NETINET_IN_H])
29   fi