]> Savannah Git Hosting - gnulib.git/commitdiff
socketlib: Change configure message.
authorBruno Haible <bruno@clisp.org>
Wed, 26 Aug 2020 23:09:20 +0000 (01:09 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Aug 2020 23:30:35 +0000 (01:30 +0200)
* m4/socketlib.m4 (gl_SOCKETLIB): Say "checking for WSAStartup..."
instead of "checking if we need to call WSAStartup in winsock2.h and
-lws2_32...".

ChangeLog
m4/socketlib.m4

index a3f0ce517cd36c69840dab755b56cfcff48bef7f..afcf00038c6e5563996e5cd8bc5f950cf52dfd75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
index 2372a27807e90c04198f8361d748763cbda0213d..48dd7d66c78a8c84df6e561ba67de5c40d1f7d81 100644 (file)
@@ -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'