>From f7a517ac04e5186da5d0b3c0727a0cb8dc5cb214 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 27 Aug 2020 01:09:20 +0200 Subject: [PATCH 6/9] 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...". --- ChangeLog | 7 +++++++ m4/socketlib.m4 | 32 +++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f32743..47846b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2020-08-26 Bruno Haible + 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 + 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 2372a27..48dd7d6 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 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 #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' -- 2.7.4