md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
[gnulib.git] / m4 / sockets.m4
index 615b6e8..b407391 100644 (file)
@@ -1,31 +1,13 @@
-# sockets.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# sockets.m4 serial 7
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_SOCKETS],
 [
-  AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
-
-  AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
-                 [gl_cv_func_wsastartup], [
-    am_save_LIBS="$LIBS"
-    LIBS="$LIBS -lws2_32"
-    AC_TRY_LINK([
-#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="$am_save_LIBS"])
-  if test "$gl_cv_func_wsastartup" = "yes"; then
-    AC_DEFINE([WINDOWS_SOCKETS], 1, [Define if WSAStartup is needed.])
-    LIBS="$LIBS -lws2_32"
-  fi
+  AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([gl_SOCKETLIB])
   gl_PREREQ_SOCKETS
 ])