strerror: simplify replacement
authorEric Blake <eblake@redhat.com>
Wed, 8 Jun 2011 11:12:15 +0000 (05:12 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 8 Jun 2011 11:12:15 +0000 (05:12 -0600)
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>
ChangeLog
m4/strerror.m4
modules/strerror
modules/strerror-override

index d57fd3f..7e9ad87 100644 (file)
--- 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.
index 1ae1a2d..048b03c 100644 (file)
@@ -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 @@ AC_DEFUN([gl_FUNC_STRERROR],
     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
-])
index a0b7014..1d60662 100644 (file)
@@ -16,7 +16,6 @@ configure.ac:
 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])
index a31e8a1..bbdf7b8 100644 (file)
@@ -4,6 +4,7 @@ strerror_override() function: provide strings for gnulib-specific errno values
 Files:
 lib/strerror-override.h
 lib/strerror-override.c
+m4/sys_socket_h.m4
 
 Depends-on:
 errno
@@ -12,6 +13,7 @@ configure.ac:
 AC_REQUIRE([gl_HEADER_ERRNO_H])
 if test -n "$ERRNO_H"; then
   AC_LIBOBJ([strerror-override])
+  gl_PREREQ_SYS_H_WINSOCK2
 fi
 
 Makefile.am: