changeset 14893:262fbc6e4790

strerror: simplify replacement Only strerror-override depends on winsock2.h; our strerror.c file does not. This also fixes mingw strerror_r-posix use of winsock2.h via strerror-override. Since we assume C89 which guarantees a declaration for sterror, we don't need to repeat that check. * m4/strerror.m4 (gl_PREREQ_STRERROR): Delete. * modules/strerror (configure.ac): No prereqs needed here... * modules/strerror-override (configure.ac): ...but this needs it. (Files): Add file for needed prereq macro. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 08 Jun 2011 05:12:15 -0600
parents 5059ee60d09a
children b22360ddefc4
files ChangeLog m4/strerror.m4 modules/strerror modules/strerror-override
diffstat 4 files changed, 11 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-08  Eric Blake  <eblake@redhat.com>
+
+	strerror: simplify replacement
+	* m4/strerror.m4 (gl_PREREQ_STRERROR): Delete.
+	* modules/strerror (configure.ac): No prereqs needed here...
+	* modules/strerror-override (configure.ac): ...but this needs it.
+	(Files): Add file for needed prereq macro.
+
 2011-06-08  Bruno Haible  <bruno@clisp.org>
 
 	strerror_r-posix: Tweaks.
--- a/m4/strerror.m4
+++ b/m4/strerror.m4
@@ -1,4 +1,4 @@
-# strerror.m4 serial 13
+# strerror.m4 serial 14
 dnl Copyright (C) 2002, 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -48,16 +48,3 @@
     REPLACE_STRERROR=1
   fi
 ])
-
-# Prerequisites of lib/strerror.c.
-AC_DEFUN([gl_PREREQ_STRERROR], [
-  AC_CHECK_DECLS([strerror])
-  AC_CHECK_HEADERS_ONCE([sys/socket.h])
-  if test $ac_cv_header_sys_socket_h != yes; then
-    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
-    dnl the check for those headers unconditional; yet cygwin reports
-    dnl that the headers are present but cannot be compiled (since on
-    dnl cygwin, all socket information should come from sys/socket.h).
-    AC_CHECK_HEADERS([winsock2.h])
-  fi
-])
--- a/modules/strerror
+++ b/modules/strerror
@@ -16,7 +16,6 @@
 gl_FUNC_STRERROR
 if test $REPLACE_STRERROR = 1; then
   AC_LIBOBJ([strerror])
-  gl_PREREQ_STRERROR
 fi
 gl_MODULE_INDICATOR([strerror])
 gl_STRING_MODULE_INDICATOR([strerror])
--- a/modules/strerror-override
+++ b/modules/strerror-override
@@ -4,6 +4,7 @@
 Files:
 lib/strerror-override.h
 lib/strerror-override.c
+m4/sys_socket_h.m4
 
 Depends-on:
 errno
@@ -12,6 +13,7 @@
 AC_REQUIRE([gl_HEADER_ERRNO_H])
 if test -n "$ERRNO_H"; then
   AC_LIBOBJ([strerror-override])
+  gl_PREREQ_SYS_H_WINSOCK2
 fi
 
 Makefile.am: