52
52
dnl the check for those headers unconditional; yet cygwin reports
53
53
dnl that the headers are present but cannot be compiled (since on
54
54
dnl cygwin, all socket information should come from sys/socket.h).
55
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
56
if test $ac_cv_header_winsock2_h = yes; then
55
AC_CHECK_HEADERS([ws2tcpip.h])
61
56
if test $ac_cv_header_ws2tcpip_h = yes; then
62
gl_PREREQ_SYS_H_WINSOCK2
67
63
AC_SUBST([HAVE_SYS_SOCKET_H])
68
AC_SUBST([HAVE_WINSOCK2_H])
69
64
AC_SUBST([HAVE_WS2TCPIP_H])
71
66
AC_SUBST([SYS_SOCKET_H])
69
# Common prerequisites of of the <sys/socket.h> replacement and of the
70
# <sys/select.h> replacement.
71
# Sets and substitutes HAVE_WINSOCK2_H.
72
AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
74
m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
75
m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
76
AC_CHECK_HEADERS_ONCE([sys/socket.h])
77
if test $ac_cv_header_sys_socket_h != yes; then
78
dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
79
dnl the check for those headers unconditional; yet cygwin reports
80
dnl that the headers are present but cannot be compiled (since on
81
dnl cygwin, all socket information should come from sys/socket.h).
82
AC_CHECK_HEADERS([winsock2.h])
84
if test "$ac_cv_header_winsock2_h" = yes; then
86
UNISTD_H_HAVE_WINSOCK2_H=1
87
SYS_IOCTL_H_HAVE_WINSOCK2_H=1
91
AC_SUBST([HAVE_WINSOCK2_H])
94
AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
96
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
97
AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
98
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
101
AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
103
GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
104
GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
105
GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
106
GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
107
GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
108
GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
109
GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
110
GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
111
GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
112
GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
113
GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
114
GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
115
GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
116
GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN])