summaryrefslogtreecommitdiff
path: root/m4/sys_socket_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/sys_socket_h.m4')
-rw-r--r--m4/sys_socket_h.m430
1 files changed, 21 insertions, 9 deletions
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index f210378..1471aea 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2018 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 24
+dnl Copyright (C) 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -104,17 +104,11 @@ AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
gl_CHECK_NEXT_HEADERS([sys/socket.h])
if test $ac_cv_header_sys_socket_h = yes; then
HAVE_SYS_SOCKET_H=1
- HAVE_WS2TCPIP_H=0
else
HAVE_SYS_SOCKET_H=0
- if test $ac_cv_header_ws2tcpip_h = yes; then
- HAVE_WS2TCPIP_H=1
- else
- HAVE_WS2TCPIP_H=0
- fi
fi
AC_SUBST([HAVE_SYS_SOCKET_H])
- AC_SUBST([HAVE_WS2TCPIP_H])
+ gl_PREREQ_SYS_H_WS2TCPIP
])
# Common prerequisites of the <sys/socket.h> replacement and of the
@@ -142,6 +136,24 @@ AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
AC_SUBST([HAVE_WINSOCK2_H])
])
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <arpa/inet.h> replacement.
+# Sets and substitutes HAVE_WS2TCPIP_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
+[
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_WS2TCPIP_H=0
+ else
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+ AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.