summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-27 01:09:20 +0200
committerBruno Haible <bruno@clisp.org>2020-08-27 01:30:35 +0200
commit51cb7685103affbb4d9cb802143738c8c211f1f9 (patch)
treed9a929884765f3ea33dc8509a8148e874da44c3a
parent1c3333e1a81d1278c90b242c334d7c6234395b02 (diff)
downloadgnulib-51cb7685103affbb4d9cb802143738c8c211f1f9.tar.gz
socketlib: Change configure message.
* m4/socketlib.m4 (gl_SOCKETLIB): Say "checking for WSAStartup..." instead of "checking if we need to call WSAStartup in winsock2.h and -lws2_32...".
-rw-r--r--ChangeLog7
-rw-r--r--m4/socketlib.m432
2 files changed, 26 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index a3f0ce517c..afcf00038c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2020-08-26 Bruno Haible <bruno@clisp.org>
+ socketlib: Change configure message.
+ * m4/socketlib.m4 (gl_SOCKETLIB): Say "checking for WSAStartup..."
+ instead of "checking if we need to call WSAStartup in winsock2.h and
+ -lws2_32...".
+
+2020-08-26 Bruno Haible <bruno@clisp.org>
+
include_next: Change configure message.
* m4/include_next.m4 (gl_INCLUDE_NEXT): Say "checking whether source
code line length is unlimited..." instead of "checking whether system
diff --git a/m4/socketlib.m4 b/m4/socketlib.m4
index 2372a27807..48dd7d66c7 100644
--- a/m4/socketlib.m4
+++ b/m4/socketlib.m4
@@ -1,4 +1,4 @@
-# socketlib.m4 serial 2
+# socketlib.m4 serial 3
dnl Copyright (C) 2008-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,
@@ -14,21 +14,27 @@ AC_DEFUN([gl_SOCKETLIB],
LIBSOCKET=
if test $HAVE_WINSOCK2_H = 1; then
dnl Native Windows API (not Cygwin).
- AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
- [gl_cv_func_wsastartup], [
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lws2_32"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ dnl If the function WSAStartup exists (declared in <winsock2.h> and
+ dnl defined through -lws2_32), we need to call it.
+ AC_CACHE_CHECK([for WSAStartup],
+ [gl_cv_func_wsastartup], [
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
#endif]], [[
- WORD wVersionRequested = MAKEWORD(1, 1);
- WSADATA wsaData;
- int err = WSAStartup(wVersionRequested, &wsaData);
- WSACleanup ();]])],
- gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no)
- LIBS="$gl_save_LIBS"
- ])
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();
+ ]])
+ ],
+ [gl_cv_func_wsastartup=yes],
+ [gl_cv_func_wsastartup=no])
+ LIBS="$gl_save_LIBS"
+ ])
if test "$gl_cv_func_wsastartup" = "yes"; then
AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
LIBSOCKET='-lws2_32'