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_NET_IF],
10 AC_CACHE_CHECK([whether <net/if.h> is self-contained],
11 [gl_cv_header_net_if_h_selfcontained],
13 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <net/if.h>]],
14 [[struct if_nameindex ni;]])],
15 [gl_cv_header_net_if_h_selfcontained=yes],
16 [gl_cv_header_net_if_h_selfcontained=no])
18 if test $gl_cv_header_net_if_h_selfcontained = yes; then
19 GL_GENERATE_NET_IF_H=false
21 GL_GENERATE_NET_IF_H=true
22 AC_CHECK_HEADERS([net/if.h], [], [], [[#include <sys/socket.h>]])
23 gl_NEXT_HEADERS([net/if.h])
24 if test $ac_cv_header_net_if_h = yes; then
29 AC_SUBST([HAVE_NET_IF_H])