2 dnl Copyright (C) 2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
11 if test $HAVE_WINSOCK2_H = 1; then
12 dnl Native Windows API (not Cygwin).
13 AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
14 [gl_cv_func_wsastartup], [
18 #ifdef HAVE_WINSOCK2_H
19 # include <winsock2.h>
21 WORD wVersionRequested = MAKEWORD(1, 1);
23 int err = WSAStartup(wVersionRequested, &wsaData);
25 gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no)
28 if test "$gl_cv_func_wsastartup" = "yes"; then
29 AC_DEFINE([WINDOWS_SOCKETS], 1, [Define if WSAStartup is needed.])
34 dnl Solaris has most socket functions in libsocket.
35 AC_CACHE_CHECK([whether setsockopt requires -lsocket], [gl_cv_lib_socket], [
41 char setsockopt();], [setsockopt();],
49 char setsockopt();], [setsockopt();],
50 [gl_cv_lib_socket=yes])
54 if test $gl_cv_lib_socket = yes; then
62 # Prerequisites of lib/sockets.c.
63 AC_DEFUN([gl_PREREQ_SOCKETS], [