gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gsasl branch, master, updated. gsasl-1-5-4-6-g485b2a5


From: Simon Josefsson
Subject: [SCM] GNU gsasl branch, master, updated. gsasl-1-5-4-6-g485b2a5
Date: Thu, 09 Dec 2010 17:57:16 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gsasl".

http://git.savannah.gnu.org/cgit/gsasl.git/commit/?id=485b2a51b7e73050dad653511640c3cbf1a209e4

The branch, master has been updated
       via  485b2a51b7e73050dad653511640c3cbf1a209e4 (commit)
      from  3989a8c75ec01b87d41119cb75c95a16380a3341 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 485b2a51b7e73050dad653511640c3cbf1a209e4
Author: Simon Josefsson <address@hidden>
Date:   Thu Dec 9 18:54:28 2010 +0100

    Update gnulib files.

-----------------------------------------------------------------------

Summary of changes:
 gl/Makefile.am             |    7 +-
 gl/arpa_inet.in.h          |    4 +
 gl/gettext.h               |    2 +-
 gl/iconv.in.h              |   45 +++++----
 gl/intprops.h              |   14 ++-
 gl/m4/alloca.m4            |    6 +-
 gl/m4/arpa_inet_h.m4       |    8 +-
 gl/m4/dup2.m4              |   13 ++-
 gl/m4/fcntl-o.m4           |   63 +++++++++----
 gl/m4/getdelim.m4          |    8 +-
 gl/m4/getline.m4           |    8 +-
 gl/m4/getopt.m4            |   33 +++---
 gl/m4/getpass.m4           |    8 ++-
 gl/m4/glibc21.m4           |   13 ++-
 gl/m4/gnulib-common.m4     |   15 +++-
 gl/m4/gnulib-comp.m4       |    1 +
 gl/m4/iconv.m4             |   26 ++++--
 gl/m4/iconv_h.m4           |    4 +-
 gl/m4/iconv_open.m4        |  234 +++++++++++++++++++++++++-------------------
 gl/m4/mbrtowc.m4           |    9 +-
 gl/m4/memchr.m4            |   11 +-
 gl/m4/mmap-anon.m4         |    6 +-
 gl/m4/open.m4              |   10 ++-
 gl/m4/poll.m4              |   35 ++++---
 gl/m4/printf.m4            |  170 +++++++++++++++++---------------
 gl/m4/putenv.m4            |    6 +-
 gl/m4/readline.m4          |   18 +++-
 gl/m4/setenv.m4            |   20 +++-
 gl/m4/stat.m4              |   12 ++-
 gl/m4/stdint.m4            |    4 +-
 gl/m4/symlink.m4           |   15 ++-
 gl/m4/sys_ioctl_h.m4       |    4 +-
 gl/m4/sys_select_h.m4      |    4 +-
 gl/m4/sys_socket_h.m4      |   26 ++++-
 gl/m4/unistd_h.m4          |    7 +-
 gl/m4/vasnprintf.m4        |    3 +-
 gl/m4/wchar_h.m4           |    6 +-
 gl/mbrtowc.c               |    2 +-
 gl/printf-parse.c          |    2 +-
 gl/printf-parse.h          |    6 +-
 gl/stdint.in.h             |   68 ++++++++------
 gl/striconv.c              |   29 ++++--
 gl/string.in.h             |   14 ++--
 gl/sys_socket.in.h         |    9 ++-
 gl/unistd.in.h             |   23 ++++-
 gl/vasnprintf.c            |   11 +-
 gl/wchar.in.h              |    4 +
 gl/xmalloc.c               |    2 +-
 gltests/fcntl.in.h         |    2 +-
 gltests/test-getopt.h      |    2 +-
 gltests/test-iconv-h.c     |    4 -
 lib/build-aux/gendocs.sh   |   12 ++-
 lib/gl/Makefile.am         |    4 +-
 lib/gl/gettext.h           |    2 +-
 lib/gl/m4/alloca.m4        |    6 +-
 lib/gl/m4/fcntl-o.m4       |   63 +++++++++----
 lib/gl/m4/getdelim.m4      |    8 +-
 lib/gl/m4/getline.m4       |    8 +-
 lib/gl/m4/glibc2.m4        |    6 +-
 lib/gl/m4/glibc21.m4       |   13 ++-
 lib/gl/m4/gnulib-common.m4 |   15 +++-
 lib/gl/m4/iconv.m4         |   26 ++++--
 lib/gl/m4/intdiv0.m4       |    4 +-
 lib/gl/m4/memchr.m4        |   11 +-
 lib/gl/m4/memmem.m4        |   23 +++--
 lib/gl/m4/mmap-anon.m4     |    6 +-
 lib/gl/m4/printf.m4        |  170 +++++++++++++++++---------------
 lib/gl/m4/stdint.m4        |    4 +-
 lib/gl/m4/unistd_h.m4      |    7 +-
 lib/gl/m4/vasnprintf.m4    |    3 +-
 lib/gl/m4/wchar_h.m4       |    6 +-
 lib/gl/printf-parse.c      |    2 +-
 lib/gl/printf-parse.h      |    6 +-
 lib/gl/stdint.in.h         |   68 ++++++++------
 lib/gl/string.in.h         |   14 ++--
 lib/gl/unistd.in.h         |   23 ++++-
 lib/gl/vasnprintf.c        |   11 +-
 lib/gl/wchar.in.h          |    4 +
 lib/gltests/intprops.h     |   14 ++-
 lib/maint.mk               |    7 +-
 maint.mk                   |    7 +-
 81 files changed, 974 insertions(+), 635 deletions(-)
 mode change 100644 => 100755 lib/build-aux/gendocs.sh

diff --git a/gl/Makefile.am b/gl/Makefile.am
index 0131320..c13982e 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -120,6 +120,7 @@ arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) 
$(ARG_NONNULL_H)
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
              -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
              -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
@@ -457,6 +458,7 @@ iconv.h: iconv.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \
+             -e 's|@''GNULIB_ICONV''@|$(GNULIB_ICONV)|g' \
              -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
              -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
              -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
@@ -1347,6 +1349,7 @@ sys/socket.h: sys_socket.in.h $(CXXDEFS_H) 
$(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
              -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
              -e 
's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+             -e 
's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g'
 \
              -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
              -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -1457,7 +1460,6 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-             -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
@@ -1478,6 +1480,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' 
\
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
              -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
              -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
@@ -1489,6 +1492,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
@@ -1594,6 +1598,7 @@ wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
              -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
index 84a4006..f17d642 100644
--- a/gl/arpa_inet.in.h
+++ b/gl/arpa_inet.in.h
@@ -23,6 +23,10 @@
 #endif
 @PRAGMA_COLUMNS@
 
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
 /* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
    under MinGW.
    But avoid namespace pollution on glibc systems.  */
diff --git a/gl/gettext.h b/gl/gettext.h
index b1145d5..f08759e 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -54,7 +54,7 @@
    it now, to make later inclusions of <libintl.h> a NOP.  */
 #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
 # include <cstdlib>
-# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
 #  include <libintl.h>
 # endif
 #endif
diff --git a/gl/iconv.in.h b/gl/iconv.in.h
index 3a39279..46397dd 100644
--- a/gl/iconv.in.h
+++ b/gl/iconv.in.h
@@ -36,22 +36,24 @@
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
-#if @REPLACE_ICONV_OPEN@
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV_OPEN@
 /* An iconv_open wrapper that supports the IANA standardized encoding names
    ("ISO-8859-1" etc.) as far as possible.  */
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  define iconv_open rpl_iconv_open
-# endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iconv_open rpl_iconv_open
+#  endif
 _GL_FUNCDECL_RPL (iconv_open, iconv_t,
                   (const char *tocode, const char *fromcode)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (iconv_open, iconv_t,
                   (const char *tocode, const char *fromcode));
-#else
+# else
 _GL_CXXALIAS_SYS (iconv_open, iconv_t,
                   (const char *tocode, const char *fromcode));
-#endif
+# endif
 _GL_CXXALIASWARN (iconv_open);
+#endif
 
 #if @REPLACE_ICONV_UTF@
 /* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
@@ -66,10 +68,11 @@ _GL_CXXALIASWARN (iconv_open);
 # define _ICONV_UTF32LE_UTF8 (iconv_t)(-168)
 #endif
 
-#if @REPLACE_ICONV@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  define iconv rpl_iconv
-# endif
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iconv rpl_iconv
+#  endif
 _GL_FUNCDECL_RPL (iconv, size_t,
                   (iconv_t cd,
                    @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
@@ -78,24 +81,30 @@ _GL_CXXALIAS_RPL (iconv, size_t,
                   (iconv_t cd,
                    @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
                    char **outbuf, size_t *outbytesleft));
-#else
+# else
 _GL_CXXALIAS_SYS (iconv, size_t,
                   (iconv_t cd,
                    @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
                    char **outbuf, size_t *outbytesleft));
-#endif
+# endif
 _GL_CXXALIASWARN (iconv);
-
-#if @REPLACE_ICONV@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  define iconv_close rpl_iconv_close
+# ifndef ICONV_CONST
+#  define ICONV_CONST @ICONV_CONST@
 # endif
+#endif
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iconv_close rpl_iconv_close
+#  endif
 _GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
 _GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
-#else
+# else
 _GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
-#endif
+# endif
 _GL_CXXALIASWARN (iconv_close);
+#endif
 
 
 #endif /* _GL_ICONV_H */
diff --git a/gl/intprops.h b/gl/intprops.h
index 46f4d47..0c27875 100644
--- a/gl/intprops.h
+++ b/gl/intprops.h
@@ -68,13 +68,17 @@
 #  define signed_type_or_expr__(t) 1
 # endif
 
+/* Bound on length of the string representing an unsigned integer
+   value representable in B bits.  log10 (2.0) < 146/485.  The
+   smallest value of B where this bound is not tight is 2621.  */
+# define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
+
 /* Bound on length of the string representing an integer type or expression T.
-   Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485;
-   add 1 for integer division truncation; add 1 more for a minus sign
-   if needed.  */
+   Subtract 1 for the sign bit if T is signed, and then add 1 more for
+   a minus sign if needed.  */
 # define INT_STRLEN_BOUND(t) \
-  ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \
-   + signed_type_or_expr__ (t) + 1)
+  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) \
+   + signed_type_or_expr__ (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
    including the terminating null.  */
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index f3ee343..80d67aa 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,4 +1,4 @@
-# alloca.m4 serial 9
+# alloca.m4 serial 10
 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -7,10 +7,6 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_FUNC_ALLOCA],
 [
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   AC_REQUIRE([AC_FUNC_ALLOCA])
   if test $ac_cv_func_alloca_works = no; then
     gl_PREREQ_ALLOCA
diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4
index 15a30e2..80fdb40 100644
--- a/gl/m4/arpa_inet_h.m4
+++ b/gl/m4/arpa_inet_h.m4
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 8
-dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 10
+dnl Copyright (C) 2006, 2008-2010 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.
@@ -22,11 +22,13 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
   dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([arpa/inet.h])
 
+  AC_REQUIRE([gl_FEATURES_H])
+
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 /* On some systems, this header is not self-consistent.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ || defined __UCLIBC__)
 # include <sys/socket.h>
 #endif
 #include <arpa/inet.h>
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
index 998d66f..d8bf2cd 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -1,4 +1,4 @@
-#serial 10
+#serial 11
 dnl Copyright (C) 2002, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,15 +17,16 @@ AC_DEFUN([gl_FUNC_DUP2],
       [AC_RUN_IFELSE([
          AC_LANG_PROGRAM([[#include <unistd.h>
 #include <errno.h>]],
-           [if (dup2 (1, 1) == 0)
-              return 1;
+           [int result = 0;
+            if (dup2 (1, 1) == 0)
+              result |= 1;
             close (0);
             if (dup2 (0, 0) != -1)
-              return 2;
+              result |= 2;
             /* Many gnulib modules require POSIX conformance of EBADF.  */
             if (dup2 (1, 1000000) == -1 && errno != EBADF)
-              return 3;
-            return 0;
+              result |= 4;
+            return result;
            ])
         ],
         [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
index 1adacc8..46fad47 100644
--- a/gl/m4/fcntl-o.m4
+++ b/gl/m4/fcntl-o.m4
@@ -1,4 +1,4 @@
-# fcntl-o.m4 serial 2
+# fcntl-o.m4 serial 3
 dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,34 +37,61 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
             };
           ]],
           [[
-            int status = !constants;
+            int result = !constants;
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0
-                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
-                status |= 32;
+              if (symlink (".", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
               unlink (sym);
             }
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);
-              char c;
-              struct stat st0, st1;
-              if (fd < 0
-                  || fstat (fd, &st0) != 0
-                  || sleep (1) != 0
-                  || read (fd, &c, 1) != 1
-                  || close (fd) != 0
-                  || stat (file, &st1) != 0
-                  || st0.st_atime != st1.st_atime)
-                status |= 64;
+              if (fd < 0)
+                result |= 8;
+              else
+                {
+                  struct stat st0;
+                  if (fstat (fd, &st0) != 0)
+                    result |= 16;
+                  else
+                    {
+                      char c;
+                      sleep (1);
+                      if (read (fd, &c, 1) != 1)
+                        result |= 24;
+                      else
+                        {
+                          if (close (fd) != 0)
+                            result |= 32;
+                          else
+                            {
+                              struct stat st1;
+                              if (stat (file, &st1) != 0)
+                                result |= 40;
+                              else
+                                if (st0.st_atime != st1.st_atime)
+                                  result |= 64;
+                            }
+                        }
+                    }
+                }
             }
-            return status;]])],
+            return result;]])],
        [gl_cv_header_working_fcntl_h=yes],
        [case $? in #(
-        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
         64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
          *) gl_cv_header_working_fcntl_h='no';;
         esac],
        [gl_cv_header_working_fcntl_h=cross-compiling])])
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index 4beb150..49c1444 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 6
+# getdelim.m4 serial 8
 
 dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 dnl
@@ -38,7 +38,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
         size_t siz = 0;
         int len = getdelim (&line, &siz, '\n', in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getdelim (&line, &siz, '\n', in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -57,7 +57,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
          [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
index 8300560..8f6c585 100644
--- a/gl/m4/getline.m4
+++ b/gl/m4/getline.m4
@@ -1,4 +1,4 @@
-# getline.m4 serial 21
+# getline.m4 serial 23
 
 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
@@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
         size_t siz = 0;
         int len = getline (&line, &siz, in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -54,7 +54,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getline (&line, &siz, in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -65,7 +65,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
          [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index d05e9d9..29a7187 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 31
+# getopt.m4 serial 32
 dnl Copyright (C) 2002-2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -231,6 +231,7 @@ dnl is ambiguous with environment values that contain 
newlines.
                            #include <stddef.h>
                            #include <string.h>
            ]], [[
+             int result = 0;
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
                 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
@@ -241,7 +242,7 @@ dnl is ambiguous with environment values that contain 
newlines.
                myargv[2] = 0;
                opterr = 0;
                if (getopt (2, myargv, "+a") != '?')
-                 return 1;
+                 result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
                 and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -251,33 +252,33 @@ dnl is ambiguous with environment values that contain 
newlines.
 
                optind = 1;
                if (getopt (4, argv, "p::") != 'p')
-                 return 2;
-               if (optarg != NULL)
-                 return 3;
-               if (getopt (4, argv, "p::") != -1)
-                 return 4;
-               if (optind != 2)
-                 return 5;
+                 result |= 2;
+               else if (optarg != NULL)
+                 result |= 4;
+               else if (getopt (4, argv, "p::") != -1)
+                 result |= 6;
+               else if (optind != 2)
+                 result |= 8;
              }
              /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
              {
                char *argv[] = { "program", "foo", "-p", NULL };
                optind = 0;
                if (getopt (3, argv, "-p") != 1)
-                 return 6;
-               if (getopt (3, argv, "-p") != 'p')
-                 return 7;
+                 result |= 16;
+               else if (getopt (3, argv, "-p") != 'p')
+                 result |= 32;
              }
              /* This code fails on glibc 2.11.  */
              {
                char *argv[] = { "program", "-b", "-a", NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 return 8;
-               if (getopt (3, argv, "+:a:b") != ':')
-                 return 9;
+                 result |= 64;
+               else if (getopt (3, argv, "+:a:b") != ':')
+                 result |= 64;
              }
-             return 0;
+             return result;
            ]])],
         [gl_cv_func_getopt_gnu=yes],
         [gl_cv_func_getopt_gnu=no],
diff --git a/gl/m4/getpass.m4 b/gl/m4/getpass.m4
index cb80a65..8072e46 100644
--- a/gl/m4/getpass.m4
+++ b/gl/m4/getpass.m4
@@ -1,4 +1,4 @@
-# getpass.m4 serial 11
+# getpass.m4 serial 12
 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -8,6 +8,9 @@ dnl with or without modifications, as long as this notice is 
preserved.
 # Provide a getpass() function if the system doesn't have it.
 AC_DEFUN([gl_FUNC_GETPASS],
 [
+  dnl Persuade Solaris <unistd.h> and <stdlib.h> to declare getpass().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   AC_REPLACE_FUNCS([getpass])
   AC_CHECK_DECLS_ONCE([getpass])
   if test $ac_cv_func_getpass = no; then
@@ -19,6 +22,9 @@ AC_DEFUN([gl_FUNC_GETPASS],
 # arbitrary length (not just 8 bytes as on HP-UX).
 AC_DEFUN([gl_FUNC_GETPASS_GNU],
 [
+  dnl Persuade Solaris <unistd.h> and <stdlib.h> to declare getpass().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   AC_CHECK_DECLS_ONCE([getpass])
   dnl TODO: Detect when GNU getpass() is already found in glibc.
   AC_LIBOBJ([getpass])
diff --git a/gl/m4/glibc21.m4 b/gl/m4/glibc21.m4
index 68ada9d..bd08b38 100644
--- a/gl/m4/glibc21.m4
+++ b/gl/m4/glibc21.m4
@@ -1,17 +1,17 @@
-# glibc21.m4 serial 4
-dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
+# glibc21.m4 serial 5
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010 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.
 
-# Test for the GNU C Library, version 2.1 or newer.
+# Test for the GNU C Library, version 2.1 or newer, or uClibc.
 # From Bruno Haible.
 
 AC_DEFUN([gl_GLIBC21],
   [
-    AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
+    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
       [ac_cv_gnu_library_2_1],
-      [AC_EGREP_CPP([Lucky GNU user],
+      [AC_EGREP_CPP([Lucky],
         [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
@@ -19,6 +19,9 @@ AC_DEFUN([gl_GLIBC21],
   Lucky GNU user
  #endif
 #endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
         ],
         [ac_cv_gnu_library_2_1=yes],
         [ac_cv_gnu_library_2_1=no])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 4c7ac30..d0c8b66 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 20
+# gnulib-common.m4 serial 21
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -102,6 +102,19 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
     [Define to 1 when the gnulib module $1 should be tested.])
 ])
 
+# Test whether <features.h> exists.
+# Set HAVE_FEATURES_H.
+AC_DEFUN([gl_FEATURES_H],
+[
+  AC_CHECK_HEADERS_ONCE([features.h])
+  if test $ac_cv_header_features_h = yes; then
+    HAVE_FEATURES_H=1
+  else
+    HAVE_FEATURES_H=0
+  fi
+  AC_SUBST([HAVE_FEATURES_H])
+])
+
 # m4_foreach_w
 # is a backport of autoconf-2.59c's m4_foreach_w.
 # Remove this macro when we can assume autoconf >= 2.60.
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 1f4a1f4..b506970 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -329,6 +329,7 @@ AC_SUBST([LTALLOCA])
   gl_HOSTENT
   # Code from module iconv:
   AM_ICONV
+  gl_ICONV_MODULE_INDICATOR([iconv])
   # Code from module iconv-h:
   gl_ICONV_H
   # Code from module iconv_open:
diff --git a/gl/m4/iconv.m4 b/gl/m4/iconv.m4
index 425145c..006c907 100644
--- a/gl/m4/iconv.m4
+++ b/gl/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 15 (gettext-0.18.2)
+# iconv.m4 serial 17 (gettext-0.18.2)
 dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -78,6 +78,7 @@ AC_DEFUN([AM_ICONV_LINK],
 #include <string.h>
 int main ()
 {
+  int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
@@ -94,7 +95,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
       }
   }
   /* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -113,7 +115,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
       }
   }
   /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
@@ -131,7 +134,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
-          return 1;
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -150,7 +154,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
@@ -164,8 +169,8 @@ int main ()
       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
       /* Try HP-UX names.  */
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
-  return 0;
+    result |= 16;
+  return result;
 }]])],
         [am_cv_func_iconv_works=yes],
         [am_cv_func_iconv_works=no],
@@ -252,5 +257,12 @@ size_t iconv();
          $am_cv_proto_iconv])
     AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
       [Define as const if the declaration of iconv() needs const.])
+    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+    m4_ifdef([gl_ICONV_H_DEFAULTS],
+      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+       if test -n "$am_cv_proto_iconv_arg1"; then
+         ICONV_CONST="const"
+       fi
+      ])
   fi
 ])
diff --git a/gl/m4/iconv_h.m4 b/gl/m4/iconv_h.m4
index 7366cb9..3b9987b 100644
--- a/gl/m4/iconv_h.m4
+++ b/gl/m4/iconv_h.m4
@@ -1,4 +1,4 @@
-# iconv_h.m4 serial 6
+# iconv_h.m4 serial 7
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -29,7 +29,9 @@ AC_DEFUN([gl_ICONV_MODULE_INDICATOR],
 
 AC_DEFUN([gl_ICONV_H_DEFAULTS],
 [
+  GNULIB_ICONV=0;       AC_SUBST([GNULIB_ICONV])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  ICONV_CONST=;         AC_SUBST([ICONV_CONST])
   REPLACE_ICONV=0;      AC_SUBST([REPLACE_ICONV])
   REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
   REPLACE_ICONV_UTF=0;  AC_SUBST([REPLACE_ICONV_UTF])
diff --git a/gl/m4/iconv_open.m4 b/gl/m4/iconv_open.m4
index 8219ecf..da9b1fd 100644
--- a/gl/m4/iconv_open.m4
+++ b/gl/m4/iconv_open.m4
@@ -1,4 +1,4 @@
-# iconv_open.m4 serial 8
+# iconv_open.m4 serial 11
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,7 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
     dnl We know that GNU libiconv and GNU libc do.
     AC_EGREP_CPP([gnu_iconv], [
       #include <iconv.h>
-      #if defined _LIBICONV_VERSION || defined __GLIBC__
+      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined 
__UCLIBC__)
        gnu_iconv
       #endif
       ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
@@ -52,12 +52,6 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_REQUIRE([gl_ICONV_H_DEFAULTS])
   if test "$am_cv_func_iconv" = yes; then
-    if test -n "$am_cv_proto_iconv_arg1"; then
-      ICONV_CONST="const"
-    else
-      ICONV_CONST=
-    fi
-    AC_SUBST([ICONV_CONST])
     AC_CACHE_CHECK([whether iconv supports conversion between UTF-8 and 
UTF-{16,32}{BE,LE}],
       [gl_cv_func_iconv_supports_utf],
       [
@@ -70,9 +64,9 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF],
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#define ASSERT(expr) if (!(expr)) return 1;
 int main ()
 {
+  int result = 0;
   /* Test conversion from UTF-8 to UTF-16BE with no errors.  */
   {
     static const char input[] =
@@ -80,25 +74,33 @@ int main ()
     static const char expected[] =
       "\000J\000a\000p\000a\000n\000e\000s\000e\000 
\000(\145\345\147\054\212\236\000)\000 
\000[\330\065\335\015\330\065\335\036\330\065\335\055\000]";
     iconv_t cd;
-    char buf[100];
-    const char *inptr;
-    size_t inbytesleft;
-    char *outptr;
-    size_t outbytesleft;
-    size_t res;
     cd = iconv_open ("UTF-16BE", "UTF-8");
-    ASSERT (cd != (iconv_t)(-1));
-    inptr = input;
-    inbytesleft = sizeof (input) - 1;
-    outptr = buf;
-    outbytesleft = sizeof (buf);
-    res = iconv (cd,
-                 (ICONV_CONST char **) &inptr, &inbytesleft,
-                 &outptr, &outbytesleft);
-    ASSERT (res == 0 && inbytesleft == 0);
-    ASSERT (outptr == buf + (sizeof (expected) - 1));
-    ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
-    ASSERT (iconv_close (cd) == 0);
+    if (cd == (iconv_t)(-1))
+      result |= 1;
+    else
+      {
+        char buf[100];
+        const char *inptr;
+        size_t inbytesleft;
+        char *outptr;
+        size_t outbytesleft;
+        size_t res;
+        inptr = input;
+        inbytesleft = sizeof (input) - 1;
+        outptr = buf;
+        outbytesleft = sizeof (buf);
+        res = iconv (cd,
+                     (ICONV_CONST char **) &inptr, &inbytesleft,
+                     &outptr, &outbytesleft);
+        if (!(res == 0 && inbytesleft == 0))
+          result |= 1;
+        else if (!(outptr == buf + (sizeof (expected) - 1)))
+          result |= 1;
+        else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+          result |= 1;
+        else if (!(iconv_close (cd) == 0))
+          result |= 1;
+      }
   }
   /* Test conversion from UTF-8 to UTF-16LE with no errors.  */
   {
@@ -107,25 +109,33 @@ int main ()
     static const char expected[] =
       "J\000a\000p\000a\000n\000e\000s\000e\000 
\000(\000\345\145\054\147\236\212)\000 
\000[\000\065\330\015\335\065\330\036\335\065\330\055\335]\000";
     iconv_t cd;
-    char buf[100];
-    const char *inptr;
-    size_t inbytesleft;
-    char *outptr;
-    size_t outbytesleft;
-    size_t res;
     cd = iconv_open ("UTF-16LE", "UTF-8");
-    ASSERT (cd != (iconv_t)(-1));
-    inptr = input;
-    inbytesleft = sizeof (input) - 1;
-    outptr = buf;
-    outbytesleft = sizeof (buf);
-    res = iconv (cd,
-                 (ICONV_CONST char **) &inptr, &inbytesleft,
-                 &outptr, &outbytesleft);
-    ASSERT (res == 0 && inbytesleft == 0);
-    ASSERT (outptr == buf + (sizeof (expected) - 1));
-    ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
-    ASSERT (iconv_close (cd) == 0);
+    if (cd == (iconv_t)(-1))
+      result |= 2;
+    else
+      {
+        char buf[100];
+        const char *inptr;
+        size_t inbytesleft;
+        char *outptr;
+        size_t outbytesleft;
+        size_t res;
+        inptr = input;
+        inbytesleft = sizeof (input) - 1;
+        outptr = buf;
+        outbytesleft = sizeof (buf);
+        res = iconv (cd,
+                     (ICONV_CONST char **) &inptr, &inbytesleft,
+                     &outptr, &outbytesleft);
+        if (!(res == 0 && inbytesleft == 0))
+          result |= 2;
+        else if (!(outptr == buf + (sizeof (expected) - 1)))
+          result |= 2;
+        else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+          result |= 2;
+        else if (!(iconv_close (cd) == 0))
+          result |= 2;
+      }
   }
   /* Test conversion from UTF-8 to UTF-32BE with no errors.  */
   {
@@ -134,25 +144,33 @@ int main ()
     static const char expected[] =
       
"\000\000\000J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000
 
\000\000\000(\000\000\145\345\000\000\147\054\000\000\212\236\000\000\000)\000\000\000
 \000\000\000[\000\001\325\015\000\001\325\036\000\001\325\055\000\000\000]";
     iconv_t cd;
-    char buf[100];
-    const char *inptr;
-    size_t inbytesleft;
-    char *outptr;
-    size_t outbytesleft;
-    size_t res;
     cd = iconv_open ("UTF-32BE", "UTF-8");
-    ASSERT (cd != (iconv_t)(-1));
-    inptr = input;
-    inbytesleft = sizeof (input) - 1;
-    outptr = buf;
-    outbytesleft = sizeof (buf);
-    res = iconv (cd,
-                 (ICONV_CONST char **) &inptr, &inbytesleft,
-                 &outptr, &outbytesleft);
-    ASSERT (res == 0 && inbytesleft == 0);
-    ASSERT (outptr == buf + (sizeof (expected) - 1));
-    ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
-    ASSERT (iconv_close (cd) == 0);
+    if (cd == (iconv_t)(-1))
+      result |= 4;
+    else
+      {
+        char buf[100];
+        const char *inptr;
+        size_t inbytesleft;
+        char *outptr;
+        size_t outbytesleft;
+        size_t res;
+        inptr = input;
+        inbytesleft = sizeof (input) - 1;
+        outptr = buf;
+        outbytesleft = sizeof (buf);
+        res = iconv (cd,
+                     (ICONV_CONST char **) &inptr, &inbytesleft,
+                     &outptr, &outbytesleft);
+        if (!(res == 0 && inbytesleft == 0))
+          result |= 4;
+        else if (!(outptr == buf + (sizeof (expected) - 1)))
+          result |= 4;
+        else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+          result |= 4;
+        else if (!(iconv_close (cd) == 0))
+          result |= 4;
+      }
   }
   /* Test conversion from UTF-8 to UTF-32LE with no errors.  */
   {
@@ -161,25 +179,33 @@ int main ()
     static const char expected[] =
       
"J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000
 
\000\000\000(\000\000\000\345\145\000\000\054\147\000\000\236\212\000\000)\000\000\000
 
\000\000\000[\000\000\000\015\325\001\000\036\325\001\000\055\325\001\000]\000\000\000";
     iconv_t cd;
-    char buf[100];
-    const char *inptr;
-    size_t inbytesleft;
-    char *outptr;
-    size_t outbytesleft;
-    size_t res;
     cd = iconv_open ("UTF-32LE", "UTF-8");
-    ASSERT (cd != (iconv_t)(-1));
-    inptr = input;
-    inbytesleft = sizeof (input) - 1;
-    outptr = buf;
-    outbytesleft = sizeof (buf);
-    res = iconv (cd,
-                 (ICONV_CONST char **) &inptr, &inbytesleft,
-                 &outptr, &outbytesleft);
-    ASSERT (res == 0 && inbytesleft == 0);
-    ASSERT (outptr == buf + (sizeof (expected) - 1));
-    ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
-    ASSERT (iconv_close (cd) == 0);
+    if (cd == (iconv_t)(-1))
+      result |= 8;
+    else
+      {
+        char buf[100];
+        const char *inptr;
+        size_t inbytesleft;
+        char *outptr;
+        size_t outbytesleft;
+        size_t res;
+        inptr = input;
+        inbytesleft = sizeof (input) - 1;
+        outptr = buf;
+        outbytesleft = sizeof (buf);
+        res = iconv (cd,
+                     (ICONV_CONST char **) &inptr, &inbytesleft,
+                     &outptr, &outbytesleft);
+        if (!(res == 0 && inbytesleft == 0))
+          result |= 8;
+        else if (!(outptr == buf + (sizeof (expected) - 1)))
+          result |= 8;
+        else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+          result |= 8;
+        else if ((iconv_close (cd) == 0))
+          result |= 8;
+      }
   }
   /* Test conversion from UTF-16BE to UTF-8 with no errors.
      This test fails on NetBSD 3.0.  */
@@ -189,27 +215,35 @@ int main ()
     static const char expected[] =
       "Japanese (\346\227\245\346\234\254\350\252\236) 
[\360\235\224\215\360\235\224\236\360\235\224\255]";
     iconv_t cd;
-    char buf[100];
-    const char *inptr;
-    size_t inbytesleft;
-    char *outptr;
-    size_t outbytesleft;
-    size_t res;
     cd = iconv_open ("UTF-8", "UTF-16BE");
-    ASSERT (cd != (iconv_t)(-1));
-    inptr = input;
-    inbytesleft = sizeof (input) - 1;
-    outptr = buf;
-    outbytesleft = sizeof (buf);
-    res = iconv (cd,
-                 (ICONV_CONST char **) &inptr, &inbytesleft,
-                 &outptr, &outbytesleft);
-    ASSERT (res == 0 && inbytesleft == 0);
-    ASSERT (outptr == buf + (sizeof (expected) - 1));
-    ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
-    ASSERT (iconv_close (cd) == 0);
+    if (cd == (iconv_t)(-1))
+      result |= 16;
+    else
+      {
+        char buf[100];
+        const char *inptr;
+        size_t inbytesleft;
+        char *outptr;
+        size_t outbytesleft;
+        size_t res;
+        inptr = input;
+        inbytesleft = sizeof (input) - 1;
+        outptr = buf;
+        outbytesleft = sizeof (buf);
+        res = iconv (cd,
+                     (ICONV_CONST char **) &inptr, &inbytesleft,
+                     &outptr, &outbytesleft);
+        if (!(res == 0 && inbytesleft == 0))
+          result |= 16;
+        else if (!(outptr == buf + (sizeof (expected) - 1)))
+          result |= 16;
+        else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+          result |= 16;
+        else if (!(iconv_close (cd) == 0))
+          result |= 16;
+      }
   }
-  return 0;
+  return result;
 }]])],
           [gl_cv_func_iconv_supports_utf=yes],
           [gl_cv_func_iconv_supports_utf=no],
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index 28b9c43..1de9aab 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 18
+# mbrtowc.m4 serial 19
 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -271,6 +271,7 @@ changequote([,])dnl
 #include <wchar.h>
 int main ()
 {
+  int result = 0;
   /* This fails on Solaris.  */
   if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
     {
@@ -283,7 +284,7 @@ int main ()
         {
           input[1] = '\0';
           if (mbrtowc (&wc, input + 2, 5, &state) != 1)
-            return 1;
+            result |= 1;
         }
     }
   /* This fails on HP-UX 11.11.  */
@@ -298,10 +299,10 @@ int main ()
         {
           input[1] = '\0';
           if (mbrtowc (&wc, input + 2, 5, &state) != 2)
-            return 1;
+            result |= 2;
         }
     }
-  return 0;
+  return result;
 }]])],
           [gl_cv_func_mbrtowc_retval=yes],
           [gl_cv_func_mbrtowc_retval=no],
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4
index b05a79a..46db9fb 100644
--- a/gl/m4/memchr.m4
+++ b/gl/m4/memchr.m4
@@ -1,4 +1,4 @@
-# memchr.m4 serial 9
+# memchr.m4 serial 10
 dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
 # endif
 #endif
 ]], [[
+  int result = 0;
   char *fence = NULL;
 #if HAVE_SYS_MMAN_H && HAVE_MPROTECT
 # if HAVE_MAP_ANONYMOUS
@@ -58,14 +59,14 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
   if (fence)
     {
       if (memchr (fence, 0, 0))
-        return 1;
+        result |= 1;
       strcpy (fence - 9, "12345678");
       if (memchr (fence - 9, 0, 79) != fence - 1)
-        return 2;
+        result |= 2;
       if (memchr (fence - 1, 0, 3) != fence - 1)
-        return 3;
+        result |= 4;
     }
-  return 0;
+  return result;
 ]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
       [dnl Be pessimistic for now.
        gl_cv_func_memchr_works="guessing no"])])
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index a6b7b9a..e20fc3c 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,4 +1,4 @@
-# mmap-anon.m4 serial 8
+# mmap-anon.m4 serial 9
 dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,10 +15,6 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_FUNC_MMAP_ANON],
 [
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
diff --git a/gl/m4/open.m4 b/gl/m4/open.m4
index 469177c..36c52e7 100644
--- a/gl/m4/open.m4
+++ b/gl/m4/open.m4
@@ -1,4 +1,4 @@
-# open.m4 serial 9
+# open.m4 serial 10
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,14 @@ AC_DEFUN([gl_FUNC_OPEN],
 #endif
 int main ()
 {
+  int result = 0;
 #if HAVE_LSTAT
-  if (open ("conftest.lnk/", O_RDONLY) != -1) return 2;
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
 #endif
-  return open ("conftest.sl/", O_CREAT, 0600) >= 0;
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
 }]])],
             [gl_cv_func_open_slash=yes],
             [gl_cv_func_open_slash=no],
diff --git a/gl/m4/poll.m4 b/gl/m4/poll.m4
index 3859597..52fab91 100644
--- a/gl/m4/poll.m4
+++ b/gl/m4/poll.m4
@@ -1,4 +1,4 @@
-# poll.m4 serial 11
+# poll.m4 serial 12
 dnl Copyright (c) 2003, 2005, 2006, 2007, 2009, 2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -20,27 +20,30 @@ AC_DEFUN([gl_FUNC_POLL],
 #include <poll.h>
          int main()
          {
+           int result = 0;
            struct pollfd ufd;
            /* Try /dev/null for reading.  */
            ufd.fd = open ("/dev/null", O_RDONLY);
-           if (ufd.fd < 0)
-             /* If /dev/null does not exist, it's not MacOS X nor AIX. */
-             return 0;
-           ufd.events = POLLIN;
-           ufd.revents = 0;
-           if (!(poll (&ufd, 1, 0) == 1 && ufd.revents == POLLIN))
-             return 1;
+           /* If /dev/null does not exist, it's not MacOS X nor AIX. */
+           if (ufd.fd >= 0)
+             {
+               ufd.events = POLLIN;
+               ufd.revents = 0;
+               if (!(poll (&ufd, 1, 0) == 1 && ufd.revents == POLLIN))
+                 result |= 1;
+             }
            /* Try /dev/null for writing.  */
            ufd.fd = open ("/dev/null", O_WRONLY);
-           if (ufd.fd < 0)
-             /* If /dev/null does not exist, it's not MacOS X nor AIX. */
-             return 0;
-           ufd.events = POLLOUT;
-           ufd.revents = 0;
-           if (!(poll (&ufd, 1, 0) == 1 && ufd.revents == POLLOUT))
-             return 1;
+           /* If /dev/null does not exist, it's not MacOS X nor AIX. */
+           if (ufd.fd >= 0)
+             {
+               ufd.events = POLLOUT;
+               ufd.revents = 0;
+               if (!(poll (&ufd, 1, 0) == 1 && ufd.revents == POLLOUT))
+                 result |= 2;
+             }
            /* Trying /dev/tty may be too environment dependent.  */
-           return 0;
+           return result;
          }]])],
          [gl_cv_func_poll=yes],
          [gl_cv_func_poll=no],
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index e850862..6d1cbfe 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 35
+# printf.m4 serial 40
 dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -32,25 +32,26 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
 static char buf[100];
 int main ()
 {
+  int result = 0;
 #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
   buf[0] = '\0';
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
-    return 1;
+    result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
       || strcmp (buf, "12345672 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
       || strcmp (buf, "12345673 33") != 0)
-    return 1;
+    result |= 4;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
       || strcmp (buf, "1.5 33") != 0)
-    return 1;
-  return 0;
+    result |= 8;
+  return result;
 }]])],
         [gl_cv_func_printf_sizes_c99=yes],
         [gl_cv_func_printf_sizes_c99=no],
@@ -102,19 +103,20 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
 static char buf[10000];
 int main ()
 {
+  int result = 0;
   buf[0] = '\0';
   if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000 33") != 0)
-    return 1;
+    result |= 1;
   buf[0] = '\0';
   if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000e+00 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.75 33") != 0)
-    return 1;
-  return 0;
+    result |= 4;
+  return result;
 }]])],
         [gl_cv_func_printf_long_double=yes],
         [gl_cv_func_printf_long_double=no],
@@ -175,39 +177,40 @@ static char buf[10000];
 static double zero = 0.0;
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%f", 1.0 / 0.0) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%f", -1.0 / 0.0) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%f", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 2;
   if (sprintf (buf, "%e", 1.0 / 0.0) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 4;
   if (sprintf (buf, "%e", -1.0 / 0.0) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 4;
   if (sprintf (buf, "%e", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 8;
   if (sprintf (buf, "%g", 1.0 / 0.0) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 16;
   if (sprintf (buf, "%g", -1.0 / 0.0) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 16;
   if (sprintf (buf, "%g", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 32;
   /* This test fails on HP-UX 10.20.  */
   if (have_minus_zero ())
     if (sprintf (buf, "%g", - zero) < 0
         || strcmp (buf, "-0") != 0)
-    return 1;
-  return 0;
+    result |= 64;
+  return result;
 }]])],
         [gl_cv_func_printf_infinite=yes],
         [gl_cv_func_printf_infinite=no],
@@ -289,34 +292,35 @@ static char buf[10000];
 static long double zeroL = 0.0L;
 int main ()
 {
+  int result = 0;
   nocrash_init();
   if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 1;
 #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined 
__x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || 
defined _I386 || defined _M_IX86 || defined _X86_))
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
@@ -335,13 +339,13 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   {
     /* Signalling NaN.  */
@@ -349,81 +353,81 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   { /* Pseudo-NaN.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
   }
   { /* Pseudo-Infinity.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
   }
   { /* Pseudo-Zero.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
   }
   { /* Unnormalized number.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
   }
   { /* Pseudo-Denormal.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
   }
 #endif
-  return 0;
+  return result;
 }]])],
             [gl_cv_func_printf_infinite_long_double=yes],
             [gl_cv_func_printf_infinite_long_double=no],
@@ -439,16 +443,9 @@ changequote(,)dnl
                                          # Guess yes on FreeBSD >= 6.
                    freebsd[1-5]*)        
gl_cv_func_printf_infinite_long_double="guessing no";;
                    freebsd* | kfreebsd*) 
gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # Guess yes on MacOS X >= 10.3.
-                   darwin[1-6].*)        
gl_cv_func_printf_infinite_long_double="guessing no";;
-                   darwin*)              
gl_cv_func_printf_infinite_long_double="guessing yes";;
                                          # Guess yes on HP-UX >= 11.
                    hpux[7-9]* | hpux10*) 
gl_cv_func_printf_infinite_long_double="guessing no";;
                    hpux*)                
gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # Guess yes on NetBSD >= 3.
-                   netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | 
netbsdcoff[1-2]*)
-                                         
gl_cv_func_printf_infinite_long_double="guessing no";;
-                   netbsd*)              
gl_cv_func_printf_infinite_long_double="guessing yes";;
                                          # If we don't know, assume the worst.
                    *)                    
gl_cv_func_printf_infinite_long_double="guessing no";;
                  esac
@@ -483,37 +480,38 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
 static char buf[100];
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.922p+1 33") != 0
           && strcmp (buf, "0x3.244p+0 33") != 0
           && strcmp (buf, "0x6.488p-1 33") != 0
           && strcmp (buf, "0xc.91p-2 33") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "-0X1.922P+1 33") != 0
           && strcmp (buf, "-0X3.244P+0 33") != 0
           && strcmp (buf, "-0X6.488P-1 33") != 0
           && strcmp (buf, "-0XC.91P-2 33") != 0))
-    return 1;
+    result |= 2;
   /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
   if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.83p+0 33") != 0
           && strcmp (buf, "0x3.05p-1 33") != 0
           && strcmp (buf, "0x6.0ap-2 33") != 0
           && strcmp (buf, "0xc.14p-3 33") != 0))
-    return 1;
+    result |= 4;
   /* This catches a FreeBSD 6.1 bug.  See
      <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
   if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
       || buf[0] == '0')
-    return 1;
+    result |= 8;
   /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
   if (sprintf (buf, "%.1a", 1.999) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
+    result |= 16;
   /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
      glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
   if (sprintf (buf, "%.1La", 1.999L) < 0
@@ -521,8 +519,8 @@ int main ()
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
-  return 0;
+    result |= 32;
+  return result;
 }]])],
         [gl_cv_func_printf_directive_a=yes],
         [gl_cv_func_printf_directive_a=no],
@@ -533,7 +531,7 @@ int main ()
              AC_EGREP_CPP([BZ2908], [
                #include <features.h>
                #ifdef __GNU_LIBRARY__
-                #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
+                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 
2)) && !defined __UCLIBC__
                  BZ2908
                 #endif
                #endif
@@ -566,17 +564,18 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
 static char buf[100];
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
       || strcmp (buf, "1234567.000000 33") != 0)
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%F", 1.0 / 0.0) < 0
       || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
-    return 1;
+    result |= 2;
   /* This catches a Cygwin 1.5.x bug.  */
   if (sprintf (buf, "%.F", 1234.0) < 0
       || strcmp (buf, "1234") != 0)
-    return 1;
-  return 0;
+    result |= 4;
+  return result;
 }]])],
         [gl_cv_func_printf_directive_f=yes],
         [gl_cv_func_printf_directive_f=no],
@@ -671,6 +670,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
 #include <string.h>
 int main ()
 {
+  int result = 0;
   char buf[100];
   /* Test whether %ls works at all.
      This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
@@ -680,7 +680,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "abc") != 0)
-      return 1;
+      result |= 1;
   }
   /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
      assertion failure inside libc), but not on OpenBSD 4.0.  */
@@ -689,7 +689,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "a") != 0)
-      return 1;
+      result |= 2;
   }
   /* Test whether precisions in %ls are supported as specified in ISO C 99
      section 7.19.6.1:
@@ -704,9 +704,9 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%.2ls", wstring) < 0
         || strcmp (buf, "ab") != 0)
-      return 1;
+      result |= 8;
   }
-  return 0;
+  return result;
 }]])],
         [gl_cv_func_printf_directive_ls=yes],
         [gl_cv_func_printf_directive_ls=no],
@@ -889,8 +889,9 @@ changequote([,])dnl
 
 dnl Test whether the *printf family of functions supports large precisions.
 dnl On mingw, precisions larger than 512 are treated like 512, in integer,
-dnl floating-point or pointer output. On BeOS, precisions larger than 1044
-dnl crash the program.
+dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
+dnl than 510 in floating-point output crash the program. On BeOS, precisions
+dnl larger than 1044 crash the program.
 dnl Result is gl_cv_func_printf_precision.
 
 AC_DEFUN([gl_PRINTF_PRECISION],
@@ -907,20 +908,24 @@ AC_DEFUN([gl_PRINTF_PRECISION],
 static char buf[5000];
 int main ()
 {
+  int result = 0;
 #ifdef __BEOS__
   /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
   return 1;
 #endif
   if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
-    return 1;
-  return 0;
+    result |= 1;
+  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+    result |= 2;
+  return result;
 }]])],
         [gl_cv_func_printf_precision=yes],
         [gl_cv_func_printf_precision=no],
         [
 changequote(,)dnl
          case "$host_os" in
-           # Guess no only on native Win32 and BeOS systems.
+           # Guess no only on Solaris, native Win32, and BeOS systems.
+           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
            mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
            beos*)        gl_cv_func_printf_precision="guessing no" ;;
            *)            gl_cv_func_printf_precision="guessing yes" ;;
@@ -1439,12 +1444,14 @@ dnl                                  1  2  3  4  5  6  
7  8  9 10 11 12 13 14 15
 dnl   glibc 2.5                      .  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .
 dnl   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
+dnl   MacOS X 10.5.8                 .  .  .  #  #  .  .  .  .  .  .  #  .  .  
.  .  .  .  .  .
 dnl   MacOS X 10.3.9                 .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
 dnl   OpenBSD 3.9, 4.0               .  .  #  #  #  #  .  #  .  #  .  #  .  #  
.  .  .  .  .  .
 dnl   Cygwin 1.7.0 (2009)            .  .  .  #  .  .  .  ?  .  .  .  .  .  ?  
.  .  .  .  .  .
 dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  
.  .  .  .  .  .
 dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  
.  .  .  .  .  .
-dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  .  .  
.  .  .  .  .  .
+dnl   Solaris 11 2010-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  
.  .  .  .  .  .
+dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  
.  .  .  .  .  .
 dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  .  .  
.  .  .  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  
#  #  #  #  #  #
 dnl   AIX 5.2, 7.1                   .  .  #  #  #  .  .  .  .  .  .  #  .  .  
.  .  .  .  .  .
@@ -1455,6 +1462,7 @@ dnl   HP-UX 10.20                    #  .  #  .  #  #  .  
?  .  .  #  #  .  .  .
 dnl   IRIX 6.5                       #  .  #  #  #  #  .  #  .  .  .  #  .  .  
.  .  #  .  .  .
 dnl   OSF/1 5.1                      #  .  #  #  #  #  .  .  .  .  .  #  .  .  
.  .  #  .  .  #
 dnl   OSF/1 4.0d                     #  .  #  #  #  #  .  .  .  .  .  #  .  .  
#  #  #  #  #  #
+dnl   NetBSD 5.0                     .  .  .  #  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
 dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  
.  .  .  ?  ?  ?
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  
.  .  .  .  .  .
 dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  
.  .  .  .  .  .
diff --git a/gl/m4/putenv.m4 b/gl/m4/putenv.m4
index dd9140c..a7f0b27 100644
--- a/gl/m4/putenv.m4
+++ b/gl/m4/putenv.m4
@@ -1,4 +1,4 @@
-# putenv.m4 serial 16
+# putenv.m4 serial 17
 dnl Copyright (C) 2002-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,11 +21,11 @@ AC_DEFUN([gl_FUNC_PUTENV],
 
     /* Try to remove it.  */
     if (putenv ("CONFTEST_putenv"))
-      return 1;
+      return 2;
 
     /* Make sure it was deleted.  */
     if (getenv ("CONFTEST_putenv") != 0)
-      return 1;
+      return 3;
 
     return 0;
               ]])],
diff --git a/gl/m4/readline.m4 b/gl/m4/readline.m4
index 27f8162..7a97ecb 100644
--- a/gl/m4/readline.m4
+++ b/gl/m4/readline.m4
@@ -1,4 +1,4 @@
-# readline.m4 serial 7
+# readline.m4 serial 8
 dnl Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,7 +40,12 @@ AC_DEFUN([gl_FUNC_READLINE],
       AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
 #include <readline/readline.h>]],
           [[readline((char*)0);]])],
-        [gl_cv_lib_readline=" -l$extra_lib"])
+        [if test -n "$extra_lib"; then
+           gl_cv_lib_readline="yes, requires -l$extra_lib"
+         else
+           gl_cv_lib_readline="yes"
+         fi
+        ])
       if test "$gl_cv_lib_readline" != no; then
         break
       fi
@@ -50,9 +55,10 @@ AC_DEFUN([gl_FUNC_READLINE],
 
   if test "$gl_cv_lib_readline" != no; then
     AC_DEFINE([HAVE_READLINE], [1], [Define if you have the readline library.])
-    if test "$gl_cv_lib_readline" != " -l"; then
-      LIBREADLINE="$LIBREADLINE$gl_cv_lib_readline"
-      LTLIBREADLINE="$LTLIBREADLINE$gl_cv_lib_readline"
+    extra_lib=`echo "$gl_cv_lib_readline" | sed -n -e 's/yes, requires //p'`
+    if test -n "$extra_lib"; then
+      LIBREADLINE="$LIBREADLINE $extra_lib"
+      LTLIBREADLINE="$LTLIBREADLINE $extra_lib"
     fi
     AC_MSG_CHECKING([how to link with libreadline])
     AC_MSG_RESULT([$LIBREADLINE])
@@ -68,7 +74,7 @@ AC_DEFUN([gl_FUNC_READLINE],
 
   AC_CHECK_HEADERS([readline/readline.h])
 
-  if test $gl_cv_lib_readline = no; then
+  if test "$gl_cv_lib_readline" = no; then
     AC_LIBOBJ([readline])
     gl_PREREQ_READLINE
   fi
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index de7171e..4948079 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,4 +1,4 @@
-# setenv.m4 serial 18
+# setenv.m4 serial 19
 dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,10 +27,20 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
        #include <errno.h>
        #include <string.h>
       ]], [[
-       if (setenv ("", "", 0) != -1) return 1;
-       if (errno != EINVAL) return 2;
-       if (setenv ("a", "=", 1) != 0) return 3;
-       if (strcmp (getenv ("a"), "=") != 0) return 4;
+       int result = 0;
+       {
+         if (setenv ("", "", 0) != -1)
+           result |= 1;
+         else if (errno != EINVAL)
+           result |= 2;
+       }
+       {
+         if (setenv ("a", "=", 1) != 0)
+           result |= 4;
+         else if (strcmp (getenv ("a"), "=") != 0)
+           result |= 8;
+       }
+       return result;
       ]])],
       [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
       [gl_cv_func_setenv_works="guessing no"])])
diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4
index 75e1d94..1ad8ef5 100644
--- a/gl/m4/stat.m4
+++ b/gl/m4/stat.m4
@@ -1,4 +1,4 @@
-# serial 5
+# serial 6
 
 # Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
@@ -36,11 +36,15 @@ AC_DEFUN([gl_FUNC_STAT],
        AC_RUN_IFELSE(
          [AC_LANG_PROGRAM(
            [[#include <sys/stat.h>
-]], [[struct stat st;
-      if (!stat ("conftest.tmp/", &st)) return 1;
+]], [[int result = 0;
+      struct stat st;
+      if (!stat ("conftest.tmp/", &st))
+        result |= 1;
 #if HAVE_LSTAT
-      if (!stat ("conftest.lnk/", &st)) return 2;
+      if (!stat ("conftest.lnk/", &st))
+        result |= 2;
 #endif
+      return result;
            ]])],
          [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
          [gl_cv_func_stat_file_slash="guessing no"])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index c5e813a..7fe2836 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 35
+# stdint.m4 serial 36
 dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -259,7 +259,7 @@ static const char *macro_values[] =
           || strncmp (value, "((int)"/*)*/, 6) == 0
           || strncmp (value, "((signed short)"/*)*/, 15) == 0
           || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return 1;
+        return mv - macro_values + 1;
     }
   return 0;
 ]])],
diff --git a/gl/m4/symlink.m4 b/gl/m4/symlink.m4
index fb61984..3a991b8 100644
--- a/gl/m4/symlink.m4
+++ b/gl/m4/symlink.m4
@@ -1,4 +1,4 @@
-# serial 3
+# serial 4
 # See if we need to provide symlink replacement.
 
 dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
@@ -24,9 +24,16 @@ AC_DEFUN([gl_FUNC_SYMLINK],
       [AC_RUN_IFELSE(
          [AC_LANG_PROGRAM(
            [[#include <unistd.h>
-]], [[if (!symlink ("a", "conftest.link/")) return 1;
-      if (symlink ("conftest.f", "conftest.lnk2")) return 2;
-      if (!symlink ("a", "conftest.lnk2/")) return 3;]])],
+           ]],
+           [[int result = 0;
+             if (!symlink ("a", "conftest.link/"))
+               result |= 1;
+             if (symlink ("conftest.f", "conftest.lnk2"))
+               result |= 2;
+             else if (!symlink ("a", "conftest.lnk2/"))
+               result |= 4;
+             return result;
+           ]])],
          [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
          [gl_cv_func_symlink_works="guessing no"])
       rm -f conftest.f conftest.link conftest.lnk2])
diff --git a/gl/m4/sys_ioctl_h.m4 b/gl/m4/sys_ioctl_h.m4
index f6face2..5c342a5 100644
--- a/gl/m4/sys_ioctl_h.m4
+++ b/gl/m4/sys_ioctl_h.m4
@@ -1,4 +1,4 @@
-# sys_ioctl_h.m4 serial 8
+# sys_ioctl_h.m4 serial 9
 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,7 @@ AC_DEFUN([gl_SYS_IOCTL_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <sys/ioctl.h>
 /* Some platforms declare ioctl in the wrong header.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <unistd.h>
 #endif
     ]], [ioctl])
diff --git a/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
index 95e7818..0e8063e 100644
--- a/gl/m4/sys_select_h.m4
+++ b/gl/m4/sys_select_h.m4
@@ -1,4 +1,4 @@
-# sys_select_h.m4 serial 14
+# sys_select_h.m4 serial 15
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -61,7 +61,7 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require prerequisite headers.  */
 #include <sys/types.h>
-#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
 #include <sys/select.h>
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index 9f4db56..c7627cb 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 17
+# sys_socket_h.m4 serial 20
 dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,6 +57,23 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
   if test $ac_cv_type_sa_family_t = no; then
     HAVE_SA_FAMILY_T=0
   fi
+  if test $ac_cv_type_struct_sockaddr_storage != no; then
+    AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+      [],
+      [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+      [#include <sys/types.h>
+       #ifdef HAVE_SYS_SOCKET_H
+       #include <sys/socket.h>
+       #endif
+       #ifdef HAVE_WS2TCPIP_H
+       #include <ws2tcpip.h>
+       #endif
+      ])
+  fi
+  if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+     || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+    SYS_SOCKET_H='sys/socket.h'
+  fi
   gl_PREREQ_SYS_H_WINSOCK2
 
   dnl Check for declarations of anything we want to poison if the
@@ -64,10 +81,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require prerequisite headers.  */
 #include <sys/types.h>
-#if !defined __GLIBC__ && HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#include <sys/select.h>
+#include <sys/socket.h>
     ]], [socket connect accept bind getpeername getsockname getsockopt
     listen recv send recvfrom sendto setsockopt shutdown accept4])
 ])
@@ -148,6 +162,8 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
   GNULIB_SHUTDOWN=0;    AC_SUBST([GNULIB_SHUTDOWN])
   GNULIB_ACCEPT4=0;     AC_SUBST([GNULIB_ACCEPT4])
   HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+                        AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
   HAVE_SA_FAMILY_T=1;   AC_SUBST([HAVE_SA_FAMILY_T])
   HAVE_ACCEPT4=1;       AC_SUBST([HAVE_ACCEPT4])
 ])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 48d06c7..e2f7f2b 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 46
+# unistd_h.m4 serial 48
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_UNISTD_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
 /* Some systems declare various items in the wrong headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <fcntl.h>
 # include <stdio.h>
 # include <stdlib.h>
@@ -104,7 +104,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
-  HAVE_GETDOMAINNAME=1;   AC_SUBST([HAVE_GETDOMAINNAME])
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
   HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
@@ -125,6 +124,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
   HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
+  HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
   HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
   HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
@@ -136,6 +136,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
+  REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index ebe3c52..9c04520 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 31
+# vasnprintf.m4 serial 32
 dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,6 +40,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 # Prequisites of lib/printf-parse.h, lib/printf-parse.c.
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
+  AC_REQUIRE([gl_FEATURES_H])
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
index 8cae82d..8c8fad9 100644
--- a/gl/m4/wchar_h.m4
+++ b/gl/m4/wchar_h.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 33
+# wchar_h.m4 serial 35
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -26,6 +26,8 @@ AC_DEFUN([gl_WCHAR_H],
   fi
   AC_SUBST([HAVE_WCHAR_H])
 
+  AC_REQUIRE([gl_FEATURES_H])
+
   AC_REQUIRE([gt_TYPE_WINT_T])
   if test $gt_cv_c_wint_t = yes; then
     HAVE_WINT_T=1
@@ -38,7 +40,7 @@ AC_DEFUN([gl_WCHAR_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require additional headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 # include <stdio.h>
 # include <time.h>
diff --git a/gl/mbrtowc.c b/gl/mbrtowc.c
index 5c2650e..25dac59 100644
--- a/gl/mbrtowc.c
+++ b/gl/mbrtowc.c
@@ -91,7 +91,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 
     /* Here m > 0.  */
 
-# if __GLIBC__
+# if __GLIBC__ || defined __UCLIBC__
     /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
     mbtowc (NULL, NULL, 0);
 # endif
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index ca7baa7..58cd889 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -206,7 +206,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, 
arguments *a)
                   dp->flags |= FLAG_ZERO;
                   cp++;
                 }
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
               else if (*cp == 'I')
                 {
                   dp->flags |= FLAG_LOCALIZED;
diff --git a/gl/printf-parse.h b/gl/printf-parse.h
index 66d693d..1b27040 100644
--- a/gl/printf-parse.h
+++ b/gl/printf-parse.h
@@ -23,6 +23,10 @@
      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
      STATIC             Set to 'static' to declare the function static.  */
 
+#if HAVE_FEATURES_H
+# include <features.h> /* for __GLIBC__, __UCLIBC__ */
+#endif
+
 #include "printf-args.h"
 
 
@@ -33,7 +37,7 @@
 #define FLAG_SPACE       8      /* space flag */
 #define FLAG_ALT        16      /* # flag */
 #define FLAG_ZERO       32
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
 # define FLAG_LOCALIZED 64      /* I flag, uses localized digits */
 #endif
 
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index d34d4fa..9909f57 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -134,40 +134,53 @@ typedef unsigned int gl_uint32_t;
 #define int32_t gl_int32_t
 #define uint32_t gl_uint32_t
 
+/* If the system defines INT64_MAX, assume int64_t works.  That way,
+   if the underlying platform defines int64_t to be a 64-bit long long
+   int, the code below won't mistakenly define it to be a 64-bit long
+   int, which would mess up C++ name mangling.  */
+
+#if INT64_MAX
+# define GL_INT64_T
+#else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
-#if LONG_MAX >> 31 >> 31 == 1
-# undef int64_t
+# if LONG_MAX >> 31 >> 31 == 1
+#  undef int64_t
 typedef long int gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
-#elif defined _MSC_VER
-# undef int64_t
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# elif defined _MSC_VER
+#  undef int64_t
 typedef __int64 gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
-#elif @HAVE_LONG_LONG_INT@
-# undef int64_t
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# elif @HAVE_LONG_LONG_INT@
+#  undef int64_t
 typedef long long int gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# endif
 #endif
 
-#if ULONG_MAX >> 31 >> 31 >> 1 == 1
-# undef uint64_t
-typedef unsigned long int gl_uint64_t;
-# define uint64_t gl_uint64_t
+#if UINT64_MAX
 # define GL_UINT64_T
-#elif defined _MSC_VER
-# undef uint64_t
+#else
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#  undef uint64_t
+typedef unsigned long int gl_uint64_t;
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# elif defined _MSC_VER
+#  undef uint64_t
 typedef unsigned __int64 gl_uint64_t;
-# define uint64_t gl_uint64_t
-# define GL_UINT64_T
-#elif @HAVE_UNSIGNED_LONG_LONG_INT@
-# undef uint64_t
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  undef uint64_t
 typedef unsigned long long int gl_uint64_t;
-# define uint64_t gl_uint64_t
-# define GL_UINT64_T
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# endif
 #endif
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
@@ -312,17 +325,14 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 #define INT32_MAX  2147483647
 #define UINT32_MAX  4294967295U
 
-#undef INT64_MIN
-#undef INT64_MAX
-#ifdef GL_INT64_T
+#if defined GL_INT64_T && ! defined INT64_MAX
 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
    evaluates the latter incorrectly in preprocessor expressions.  */
 # define INT64_MIN  (- INTMAX_C (1) << 63)
 # define INT64_MAX  INTMAX_C (9223372036854775807)
 #endif
 
-#undef UINT64_MAX
-#ifdef GL_UINT64_T
+#if defined GL_UINT64_T && ! defined UINT64_MAX
 # define UINT64_MAX  UINTMAX_C (18446744073709551615)
 #endif
 
diff --git a/gl/striconv.c b/gl/striconv.c
index 64b1137..d6d3acf 100644
--- a/gl/striconv.c
+++ b/gl/striconv.c
@@ -1,5 +1,5 @@
 /* Charset conversion.
-   Copyright (C) 2001-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
   /* Set to the initial state.  */
   iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -82,7 +83,7 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
             else
               return -1;
           }
-# if !defined _LIBICONV_VERSION && !defined __GLIBC__
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
         /* Irix iconv() inserts a NUL byte if it cannot convert.
            NetBSD iconv() inserts a question mark if it cannot convert.
            Only GNU libiconv and GNU libc are known to prefer to fail rather
@@ -97,7 +98,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     {
       char *outptr = tmpbuf;
       size_t outsize = tmpbufsize;
@@ -131,7 +133,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
   /* Return to the initial state.  */
   iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -156,7 +159,7 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
             else
               goto fail;
           }
-# if !defined _LIBICONV_VERSION && !defined __GLIBC__
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
         /* Irix iconv() inserts a NUL byte if it cannot convert.
            NetBSD iconv() inserts a question mark if it cannot convert.
            Only GNU libiconv and GNU libc are known to prefer to fail rather
@@ -170,7 +173,8 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     {
       size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
 
@@ -207,7 +211,7 @@ str_cd_iconv (const char *src, iconv_t cd)
      to a trailing NUL byte in the output.  But not for UTF-7.  So that this
      function is usable for UTF-7, we have to exclude the NUL byte from the
      conversion and add it by hand afterwards.  */
-# if !defined _LIBICONV_VERSION && !defined __GLIBC__
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
   /* Irix iconv() inserts a NUL byte if it cannot convert.
      NetBSD iconv() inserts a question mark if it cannot convert.
      Only GNU libiconv and GNU libc are known to prefer to fail rather
@@ -272,7 +276,8 @@ str_cd_iconv (const char *src, iconv_t cd)
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
   /* Set to the initial state.  */
   iconv (cd, NULL, NULL, NULL, NULL);
 # endif
@@ -324,7 +329,8 @@ str_cd_iconv (const char *src, iconv_t cd)
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
-     || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
     for (;;)
       {
         /* Here outptr + outbytes_remaining = result + result_size - 1.  */
@@ -410,7 +416,8 @@ str_iconv (const char *src, const char *from_codeset, const 
char *to_codeset)
       char *result;
 
       /* Avoid glibc-2.1 bug with EUC-KR.  */
-# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined 
_LIBICONV_VERSION
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+     && !defined _LIBICONV_VERSION
       if (c_strcasecmp (from_codeset, "EUC-KR") == 0
           || c_strcasecmp (to_codeset, "EUC-KR") == 0)
         {
diff --git a/gl/string.in.h b/gl/string.in.h
index 54cd583..b0c2ba1 100644
--- a/gl/string.in.h
+++ b/gl/string.in.h
@@ -87,7 +87,7 @@ _GL_CXXALIAS_SYS_CAST2 (memchr,
                         void *, (void const *__s, int __c, size_t __n),
                         void const *, (void const *__s, int __c, size_t __n));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
 _GL_CXXALIASWARN1 (memchr, void const *,
@@ -172,7 +172,7 @@ _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, 
size_t)
 _GL_CXXALIAS_SYS_CAST2 (memrchr,
                         void *, (void const *, int, size_t),
                         void const *, (void const *, int, size_t));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
@@ -202,7 +202,7 @@ _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int 
__c_in)
 _GL_CXXALIAS_SYS_CAST2 (rawmemchr,
                         void *, (void const *__s, int __c_in),
                         void const *, (void const *__s, int __c_in));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
 _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
@@ -293,7 +293,7 @@ _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int 
__c_in)
 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
                         char *, (char const *__s, int __c_in),
                         char const *, (char const *__s, int __c_in));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
 _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
@@ -439,7 +439,7 @@ _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char 
const *__accept)
 _GL_CXXALIAS_SYS_CAST2 (strpbrk,
                         char *, (char const *__s, char const *__accept),
                         const char *, (char const *__s, char const *__accept));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
 _GL_CXXALIASWARN1 (strpbrk, char const *,
@@ -541,7 +541,7 @@ _GL_CXXALIAS_SYS_CAST2 (strstr,
                         char *, (const char *haystack, const char *needle),
                         const char *, (const char *haystack, const char 
*needle));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strstr, const char *,
@@ -590,7 +590,7 @@ _GL_CXXALIAS_SYS_CAST2 (strcasestr,
                         char *, (const char *haystack, const char *needle),
                         const char *, (const char *haystack, const char 
*needle));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strcasestr, const char *,
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index 8fded70..339cabb 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -70,7 +70,14 @@
 typedef unsigned short  sa_family_t;
 #endif
 
-#if address@hidden@
+#if @HAVE_STRUCT_SOCKADDR_STORAGE@
+/* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1.  */
+# if address@hidden@
+#  ifndef ss_family
+#   define ss_family __ss_family
+#  endif
+# endif
+#else
 # include <alignof.h>
 /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
    2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 94dd7e3..fcf7c43 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -88,6 +88,13 @@
 # include <io.h>
 #endif
 
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if @GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__) \
+    && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
      || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
@@ -551,13 +558,21 @@ _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
    Null terminate it if the name is shorter than LEN.
    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
-# if address@hidden@
+# if @REPLACE_GETDOMAINNAME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getdomainname
+#   define getdomainname rpl_getdomainname
+#  endif
+_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
+                                      _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
                                       _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
 # endif
-/* Need to cast, because on MacOS X 10.5 systems, the second parameter is
-                                                        int len.  */
-_GL_CXXALIAS_SYS_CAST (getdomainname, int, (char *name, size_t len));
 _GL_CXXALIASWARN (getdomainname);
 #elif defined GNULIB_POSIXCHECK
 # undef getdomainname
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 7200a09..1e9cd43 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -279,7 +279,7 @@ decimal_point_char (void)
      multithread-safe on glibc systems and MacOS X systems, but is not required
      to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
      localeconv() is rarely multithread-safe.  */
-#  if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined 
__MACH__))
+#  if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined 
__APPLE__ && defined __MACH__))
   point = nl_langinfo (RADIXCHAR);
 #  elif 1
   char pointbuf[5];
@@ -4754,7 +4754,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   *fbp++ = ' ';
                 if (flags & FLAG_ALT)
                   *fbp++ = '#';
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
                 if (flags & FLAG_LOCALIZED)
                   *fbp++ = 'I';
 #endif
@@ -4841,14 +4841,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined 
_WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && 
!defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined 
__CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';
 # else
                 /* On glibc2 systems from glibc >= 2.3 - probably also older
-                   ones - we know that snprintf's returns value conforms to
-                   ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
+                   ones - we know that snprintf's return value conforms to
+                   ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
+                   gl_SNPRINTF_TRUNCATION_C99 pass.
                    Therefore we can avoid using %n in this situation.
                    On glibc2 systems from 2004-10-18 or newer, the use of %n
                    in format strings in writable memory may crash the program
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index c0ff224..c22dc06 100644
--- a/gl/wchar.in.h
+++ b/gl/wchar.in.h
@@ -53,6 +53,10 @@
 
 #define _GL_ALREADY_INCLUDING_WCHAR_H
 
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
diff --git a/gl/xmalloc.c b/gl/xmalloc.c
index f06d44f..e9761c3 100644
--- a/gl/xmalloc.c
+++ b/gl/xmalloc.c
@@ -31,7 +31,7 @@
 /* 1 if calloc is known to be compatible with GNU calloc.  This
    matters if we are not also using the calloc module, which defines
    HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms.  */
-#if defined HAVE_CALLOC_GNU || defined __GLIBC__
+#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
 enum { HAVE_GNU_CALLOC = 1 };
 #else
 enum { HAVE_GNU_CALLOC = 0 };
diff --git a/gltests/fcntl.in.h b/gltests/fcntl.in.h
index 13f5dde..6d1888d 100644
--- a/gltests/fcntl.in.h
+++ b/gltests/fcntl.in.h
@@ -32,7 +32,7 @@
    extern "C" { ... } block, which leads to errors in C++ mode with the
    overridden <sys/stat.h> from gnulib.  These errors are known to be gone
    with g++ version >= 4.3.  */
-#if !defined __GLIBC__ || (defined __cplusplus && defined GNULIB_NAMESPACE && 
!(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && 
defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ 
>= 3)))
 # include <sys/stat.h>
 #endif
 address@hidden@ @NEXT_FCNTL_H@
diff --git a/gltests/test-getopt.h b/gltests/test-getopt.h
index 12859ac..e4e6fac 100644
--- a/gltests/test-getopt.h
+++ b/gltests/test-getopt.h
@@ -21,7 +21,7 @@
 /* The glibc/gnulib implementation of getopt supports setting optind =
    0, but not all other implementations do.  This matters for getopt.
    But for getopt_long, we require GNU compatibility.  */
-#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2)
+#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2 && !defined __UCLIBC__)
 # define OPTIND_MIN 0
 #elif HAVE_DECL_OPTRESET
 # define OPTIND_MIN (optreset = 1)
diff --git a/gltests/test-iconv-h.c b/gltests/test-iconv-h.c
index 10a8e3d..c27c9ba 100644
--- a/gltests/test-iconv-h.c
+++ b/gltests/test-iconv-h.c
@@ -18,10 +18,6 @@
 
 #if HAVE_ICONV
 # include <iconv.h>
-
-# ifndef ICONV_CONST
-#  define ICONV_CONST /* empty */
-# endif
 #endif
 
 int
diff --git a/lib/build-aux/gendocs.sh b/lib/build-aux/gendocs.sh
old mode 100644
new mode 100755
index 3c5ca76..3180841
--- a/lib/build-aux/gendocs.sh
+++ b/lib/build-aux/gendocs.sh
@@ -2,10 +2,9 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2010-09-17.07
+scriptversion=2010-11-27.07
 
-# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright 2003-2010 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +21,13 @@ scriptversion=2010-09-17.07
 #
 # Original author: Mohit Agarwal.
 # Send bug reports and any other correspondence to address@hidden
+#
+# The latest version of this script, and the companion template, is
+# available from Texinfo CVS:
+# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh
+# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template
+#
+# An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib).
 
 prog=`basename "$0"`
 srcdir=`pwd`
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index b436a39..14faeef 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -813,7 +813,6 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-             -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
@@ -834,6 +833,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' 
\
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
              -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
              -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
@@ -845,6 +845,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
@@ -944,6 +945,7 @@ wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
              -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
diff --git a/lib/gl/gettext.h b/lib/gl/gettext.h
index 5c7e22d..d743a2b 100644
--- a/lib/gl/gettext.h
+++ b/lib/gl/gettext.h
@@ -54,7 +54,7 @@
    it now, to make later inclusions of <libintl.h> a NOP.  */
 #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
 # include <cstdlib>
-# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
 #  include <libintl.h>
 # endif
 #endif
diff --git a/lib/gl/m4/alloca.m4 b/lib/gl/m4/alloca.m4
index f3ee343..80d67aa 100644
--- a/lib/gl/m4/alloca.m4
+++ b/lib/gl/m4/alloca.m4
@@ -1,4 +1,4 @@
-# alloca.m4 serial 9
+# alloca.m4 serial 10
 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -7,10 +7,6 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_FUNC_ALLOCA],
 [
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   AC_REQUIRE([AC_FUNC_ALLOCA])
   if test $ac_cv_func_alloca_works = no; then
     gl_PREREQ_ALLOCA
diff --git a/lib/gl/m4/fcntl-o.m4 b/lib/gl/m4/fcntl-o.m4
index 1adacc8..46fad47 100644
--- a/lib/gl/m4/fcntl-o.m4
+++ b/lib/gl/m4/fcntl-o.m4
@@ -1,4 +1,4 @@
-# fcntl-o.m4 serial 2
+# fcntl-o.m4 serial 3
 dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,34 +37,61 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
             };
           ]],
           [[
-            int status = !constants;
+            int result = !constants;
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0
-                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
-                status |= 32;
+              if (symlink (".", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
               unlink (sym);
             }
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);
-              char c;
-              struct stat st0, st1;
-              if (fd < 0
-                  || fstat (fd, &st0) != 0
-                  || sleep (1) != 0
-                  || read (fd, &c, 1) != 1
-                  || close (fd) != 0
-                  || stat (file, &st1) != 0
-                  || st0.st_atime != st1.st_atime)
-                status |= 64;
+              if (fd < 0)
+                result |= 8;
+              else
+                {
+                  struct stat st0;
+                  if (fstat (fd, &st0) != 0)
+                    result |= 16;
+                  else
+                    {
+                      char c;
+                      sleep (1);
+                      if (read (fd, &c, 1) != 1)
+                        result |= 24;
+                      else
+                        {
+                          if (close (fd) != 0)
+                            result |= 32;
+                          else
+                            {
+                              struct stat st1;
+                              if (stat (file, &st1) != 0)
+                                result |= 40;
+                              else
+                                if (st0.st_atime != st1.st_atime)
+                                  result |= 64;
+                            }
+                        }
+                    }
+                }
             }
-            return status;]])],
+            return result;]])],
        [gl_cv_header_working_fcntl_h=yes],
        [case $? in #(
-        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
         64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
          *) gl_cv_header_working_fcntl_h='no';;
         esac],
        [gl_cv_header_working_fcntl_h=cross-compiling])])
diff --git a/lib/gl/m4/getdelim.m4 b/lib/gl/m4/getdelim.m4
index 4beb150..49c1444 100644
--- a/lib/gl/m4/getdelim.m4
+++ b/lib/gl/m4/getdelim.m4
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 6
+# getdelim.m4 serial 8
 
 dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 dnl
@@ -38,7 +38,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
         size_t siz = 0;
         int len = getdelim (&line, &siz, '\n', in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getdelim (&line, &siz, '\n', in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -57,7 +57,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
          [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
diff --git a/lib/gl/m4/getline.m4 b/lib/gl/m4/getline.m4
index 8300560..8f6c585 100644
--- a/lib/gl/m4/getline.m4
+++ b/lib/gl/m4/getline.m4
@@ -1,4 +1,4 @@
-# getline.m4 serial 21
+# getline.m4 serial 23
 
 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
@@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
         size_t siz = 0;
         int len = getline (&line, &siz, in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -54,7 +54,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getline (&line, &siz, in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -65,7 +65,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
          [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
diff --git a/lib/gl/m4/glibc2.m4 b/lib/gl/m4/glibc2.m4
index f148c12..b92208a 100644
--- a/lib/gl/m4/glibc2.m4
+++ b/lib/gl/m4/glibc2.m4
@@ -1,5 +1,5 @@
-# glibc2.m4 serial 2
-dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
+# glibc2.m4 serial 3
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010 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.
@@ -15,7 +15,7 @@ AC_DEFUN([gt_GLIBC2],
         [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
diff --git a/lib/gl/m4/glibc21.m4 b/lib/gl/m4/glibc21.m4
index 68ada9d..bd08b38 100644
--- a/lib/gl/m4/glibc21.m4
+++ b/lib/gl/m4/glibc21.m4
@@ -1,17 +1,17 @@
-# glibc21.m4 serial 4
-dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
+# glibc21.m4 serial 5
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010 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.
 
-# Test for the GNU C Library, version 2.1 or newer.
+# Test for the GNU C Library, version 2.1 or newer, or uClibc.
 # From Bruno Haible.
 
 AC_DEFUN([gl_GLIBC21],
   [
-    AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
+    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
       [ac_cv_gnu_library_2_1],
-      [AC_EGREP_CPP([Lucky GNU user],
+      [AC_EGREP_CPP([Lucky],
         [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
@@ -19,6 +19,9 @@ AC_DEFUN([gl_GLIBC21],
   Lucky GNU user
  #endif
 #endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
         ],
         [ac_cv_gnu_library_2_1=yes],
         [ac_cv_gnu_library_2_1=no])
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index 4c7ac30..d0c8b66 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 20
+# gnulib-common.m4 serial 21
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -102,6 +102,19 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
     [Define to 1 when the gnulib module $1 should be tested.])
 ])
 
+# Test whether <features.h> exists.
+# Set HAVE_FEATURES_H.
+AC_DEFUN([gl_FEATURES_H],
+[
+  AC_CHECK_HEADERS_ONCE([features.h])
+  if test $ac_cv_header_features_h = yes; then
+    HAVE_FEATURES_H=1
+  else
+    HAVE_FEATURES_H=0
+  fi
+  AC_SUBST([HAVE_FEATURES_H])
+])
+
 # m4_foreach_w
 # is a backport of autoconf-2.59c's m4_foreach_w.
 # Remove this macro when we can assume autoconf >= 2.60.
diff --git a/lib/gl/m4/iconv.m4 b/lib/gl/m4/iconv.m4
index 425145c..006c907 100644
--- a/lib/gl/m4/iconv.m4
+++ b/lib/gl/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 15 (gettext-0.18.2)
+# iconv.m4 serial 17 (gettext-0.18.2)
 dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -78,6 +78,7 @@ AC_DEFUN([AM_ICONV_LINK],
 #include <string.h>
 int main ()
 {
+  int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
@@ -94,7 +95,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
       }
   }
   /* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -113,7 +115,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
       }
   }
   /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
@@ -131,7 +134,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
-          return 1;
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -150,7 +154,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
@@ -164,8 +169,8 @@ int main ()
       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
       /* Try HP-UX names.  */
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
-  return 0;
+    result |= 16;
+  return result;
 }]])],
         [am_cv_func_iconv_works=yes],
         [am_cv_func_iconv_works=no],
@@ -252,5 +257,12 @@ size_t iconv();
          $am_cv_proto_iconv])
     AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
       [Define as const if the declaration of iconv() needs const.])
+    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+    m4_ifdef([gl_ICONV_H_DEFAULTS],
+      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+       if test -n "$am_cv_proto_iconv_arg1"; then
+         ICONV_CONST="const"
+       fi
+      ])
   fi
 ])
diff --git a/lib/gl/m4/intdiv0.m4 b/lib/gl/m4/intdiv0.m4
index 9b27ff1..562882d 100644
--- a/lib/gl/m4/intdiv0.m4
+++ b/lib/gl/m4/intdiv0.m4
@@ -1,4 +1,4 @@
-# intdiv0.m4 serial 4 (gettext-0.18.2)
+# intdiv0.m4 serial 5 (gettext-0.18.2)
 dnl Copyright (C) 2002, 2007-2008, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -60,7 +60,7 @@ int main ()
 
   z = x / y;
   nan = y / y;
-  exit (1);
+  exit (2);
 }
 ]])],
           [gt_cv_int_divbyzero_sigfpe=yes],
diff --git a/lib/gl/m4/memchr.m4 b/lib/gl/m4/memchr.m4
index b05a79a..46db9fb 100644
--- a/lib/gl/m4/memchr.m4
+++ b/lib/gl/m4/memchr.m4
@@ -1,4 +1,4 @@
-# memchr.m4 serial 9
+# memchr.m4 serial 10
 dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
 # endif
 #endif
 ]], [[
+  int result = 0;
   char *fence = NULL;
 #if HAVE_SYS_MMAN_H && HAVE_MPROTECT
 # if HAVE_MAP_ANONYMOUS
@@ -58,14 +59,14 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
   if (fence)
     {
       if (memchr (fence, 0, 0))
-        return 1;
+        result |= 1;
       strcpy (fence - 9, "12345678");
       if (memchr (fence - 9, 0, 79) != fence - 1)
-        return 2;
+        result |= 2;
       if (memchr (fence - 1, 0, 3) != fence - 1)
-        return 3;
+        result |= 4;
     }
-  return 0;
+  return result;
 ]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
       [dnl Be pessimistic for now.
        gl_cv_func_memchr_works="guessing no"])])
diff --git a/lib/gl/m4/memmem.m4 b/lib/gl/m4/memmem.m4
index fbaa7fb..7df132e 100644
--- a/lib/gl/m4/memmem.m4
+++ b/lib/gl/m4/memmem.m4
@@ -1,4 +1,4 @@
-# memmem.m4 serial 17
+# memmem.m4 serial 20
 dnl Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009, 2010 Free Software
 dnl Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -35,7 +35,8 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
            [
 #ifdef __GNU_LIBRARY__
  #include <features.h>
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #elif defined __CYGWIN__
@@ -63,7 +64,7 @@ dnl Additionally, check that memmem is efficient and handles 
empty needles.
 AC_DEFUN([gl_FUNC_MEMMEM],
 [
   AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE])
-  if test $HAVE_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
+  if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
     AC_CACHE_CHECK([whether memmem works in linear time],
       [gl_cv_func_memmem_works_fast],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
@@ -72,10 +73,11 @@ AC_DEFUN([gl_FUNC_MEMMEM],
 #include <stdlib.h> /* for malloc */
 #include <unistd.h> /* for alarm */
 static void quit (int sig) { exit (sig + 128); }
-]], [[size_t m = 1000000;
+]], [[
+    int result = 0;
+    size_t m = 1000000;
     char *haystack = (char *) malloc (2 * m + 1);
     char *needle = (char *) malloc (m + 1);
-    void *result = 0;
     /* Failure to compile this test due to missing alarm is okay,
        since all such platforms (mingw) also lack memmem.  */
     signal (SIGALRM, quit);
@@ -87,10 +89,14 @@ static void quit (int sig) { exit (sig + 128); }
         haystack[2 * m] = 'B';
         memset (needle, 'A', m);
         needle[m] = 'B';
-        result = memmem (haystack, 2 * m + 1, needle, m + 1);
+        if (!memmem (haystack, 2 * m + 1, needle, m + 1))
+          result |= 1;
       }
     /* Check for empty needle behavior.  */
-    return !result || !memmem ("a", 1, 0, 0);]])],
+    if (!memmem ("a", 1, 0, 0))
+      result |= 2;
+    return result;
+    ]])],
         [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no],
         [dnl Only glibc > 2.12 and cygwin > 1.7.7 are known to have a
          dnl bug-free memmem that works in linear time.
@@ -98,7 +104,8 @@ static void quit (int sig) { exit (sig + 128); }
            [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
   Lucky user
  #endif
 #endif
diff --git a/lib/gl/m4/mmap-anon.m4 b/lib/gl/m4/mmap-anon.m4
index a6b7b9a..e20fc3c 100644
--- a/lib/gl/m4/mmap-anon.m4
+++ b/lib/gl/m4/mmap-anon.m4
@@ -1,4 +1,4 @@
-# mmap-anon.m4 serial 8
+# mmap-anon.m4 serial 9
 dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,10 +15,6 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_FUNC_MMAP_ANON],
 [
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
diff --git a/lib/gl/m4/printf.m4 b/lib/gl/m4/printf.m4
index e850862..6d1cbfe 100644
--- a/lib/gl/m4/printf.m4
+++ b/lib/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 35
+# printf.m4 serial 40
 dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -32,25 +32,26 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
 static char buf[100];
 int main ()
 {
+  int result = 0;
 #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
   buf[0] = '\0';
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
-    return 1;
+    result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
       || strcmp (buf, "12345672 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
       || strcmp (buf, "12345673 33") != 0)
-    return 1;
+    result |= 4;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
       || strcmp (buf, "1.5 33") != 0)
-    return 1;
-  return 0;
+    result |= 8;
+  return result;
 }]])],
         [gl_cv_func_printf_sizes_c99=yes],
         [gl_cv_func_printf_sizes_c99=no],
@@ -102,19 +103,20 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
 static char buf[10000];
 int main ()
 {
+  int result = 0;
   buf[0] = '\0';
   if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000 33") != 0)
-    return 1;
+    result |= 1;
   buf[0] = '\0';
   if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000e+00 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.75 33") != 0)
-    return 1;
-  return 0;
+    result |= 4;
+  return result;
 }]])],
         [gl_cv_func_printf_long_double=yes],
         [gl_cv_func_printf_long_double=no],
@@ -175,39 +177,40 @@ static char buf[10000];
 static double zero = 0.0;
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%f", 1.0 / 0.0) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%f", -1.0 / 0.0) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%f", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 2;
   if (sprintf (buf, "%e", 1.0 / 0.0) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 4;
   if (sprintf (buf, "%e", -1.0 / 0.0) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 4;
   if (sprintf (buf, "%e", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 8;
   if (sprintf (buf, "%g", 1.0 / 0.0) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 16;
   if (sprintf (buf, "%g", -1.0 / 0.0) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 16;
   if (sprintf (buf, "%g", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 32;
   /* This test fails on HP-UX 10.20.  */
   if (have_minus_zero ())
     if (sprintf (buf, "%g", - zero) < 0
         || strcmp (buf, "-0") != 0)
-    return 1;
-  return 0;
+    result |= 64;
+  return result;
 }]])],
         [gl_cv_func_printf_infinite=yes],
         [gl_cv_func_printf_infinite=no],
@@ -289,34 +292,35 @@ static char buf[10000];
 static long double zeroL = 0.0L;
 int main ()
 {
+  int result = 0;
   nocrash_init();
   if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 1;
 #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined 
__x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || 
defined _I386 || defined _M_IX86 || defined _X86_))
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
@@ -335,13 +339,13 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   {
     /* Signalling NaN.  */
@@ -349,81 +353,81 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   { /* Pseudo-NaN.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
   }
   { /* Pseudo-Infinity.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
   }
   { /* Pseudo-Zero.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
   }
   { /* Unnormalized number.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
   }
   { /* Pseudo-Denormal.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
   }
 #endif
-  return 0;
+  return result;
 }]])],
             [gl_cv_func_printf_infinite_long_double=yes],
             [gl_cv_func_printf_infinite_long_double=no],
@@ -439,16 +443,9 @@ changequote(,)dnl
                                          # Guess yes on FreeBSD >= 6.
                    freebsd[1-5]*)        
gl_cv_func_printf_infinite_long_double="guessing no";;
                    freebsd* | kfreebsd*) 
gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # Guess yes on MacOS X >= 10.3.
-                   darwin[1-6].*)        
gl_cv_func_printf_infinite_long_double="guessing no";;
-                   darwin*)              
gl_cv_func_printf_infinite_long_double="guessing yes";;
                                          # Guess yes on HP-UX >= 11.
                    hpux[7-9]* | hpux10*) 
gl_cv_func_printf_infinite_long_double="guessing no";;
                    hpux*)                
gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # Guess yes on NetBSD >= 3.
-                   netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | 
netbsdcoff[1-2]*)
-                                         
gl_cv_func_printf_infinite_long_double="guessing no";;
-                   netbsd*)              
gl_cv_func_printf_infinite_long_double="guessing yes";;
                                          # If we don't know, assume the worst.
                    *)                    
gl_cv_func_printf_infinite_long_double="guessing no";;
                  esac
@@ -483,37 +480,38 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
 static char buf[100];
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.922p+1 33") != 0
           && strcmp (buf, "0x3.244p+0 33") != 0
           && strcmp (buf, "0x6.488p-1 33") != 0
           && strcmp (buf, "0xc.91p-2 33") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "-0X1.922P+1 33") != 0
           && strcmp (buf, "-0X3.244P+0 33") != 0
           && strcmp (buf, "-0X6.488P-1 33") != 0
           && strcmp (buf, "-0XC.91P-2 33") != 0))
-    return 1;
+    result |= 2;
   /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
   if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.83p+0 33") != 0
           && strcmp (buf, "0x3.05p-1 33") != 0
           && strcmp (buf, "0x6.0ap-2 33") != 0
           && strcmp (buf, "0xc.14p-3 33") != 0))
-    return 1;
+    result |= 4;
   /* This catches a FreeBSD 6.1 bug.  See
      <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
   if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
       || buf[0] == '0')
-    return 1;
+    result |= 8;
   /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
   if (sprintf (buf, "%.1a", 1.999) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
+    result |= 16;
   /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
      glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
   if (sprintf (buf, "%.1La", 1.999L) < 0
@@ -521,8 +519,8 @@ int main ()
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
-  return 0;
+    result |= 32;
+  return result;
 }]])],
         [gl_cv_func_printf_directive_a=yes],
         [gl_cv_func_printf_directive_a=no],
@@ -533,7 +531,7 @@ int main ()
              AC_EGREP_CPP([BZ2908], [
                #include <features.h>
                #ifdef __GNU_LIBRARY__
-                #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
+                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 
2)) && !defined __UCLIBC__
                  BZ2908
                 #endif
                #endif
@@ -566,17 +564,18 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
 static char buf[100];
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
       || strcmp (buf, "1234567.000000 33") != 0)
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%F", 1.0 / 0.0) < 0
       || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
-    return 1;
+    result |= 2;
   /* This catches a Cygwin 1.5.x bug.  */
   if (sprintf (buf, "%.F", 1234.0) < 0
       || strcmp (buf, "1234") != 0)
-    return 1;
-  return 0;
+    result |= 4;
+  return result;
 }]])],
         [gl_cv_func_printf_directive_f=yes],
         [gl_cv_func_printf_directive_f=no],
@@ -671,6 +670,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
 #include <string.h>
 int main ()
 {
+  int result = 0;
   char buf[100];
   /* Test whether %ls works at all.
      This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
@@ -680,7 +680,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "abc") != 0)
-      return 1;
+      result |= 1;
   }
   /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
      assertion failure inside libc), but not on OpenBSD 4.0.  */
@@ -689,7 +689,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "a") != 0)
-      return 1;
+      result |= 2;
   }
   /* Test whether precisions in %ls are supported as specified in ISO C 99
      section 7.19.6.1:
@@ -704,9 +704,9 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%.2ls", wstring) < 0
         || strcmp (buf, "ab") != 0)
-      return 1;
+      result |= 8;
   }
-  return 0;
+  return result;
 }]])],
         [gl_cv_func_printf_directive_ls=yes],
         [gl_cv_func_printf_directive_ls=no],
@@ -889,8 +889,9 @@ changequote([,])dnl
 
 dnl Test whether the *printf family of functions supports large precisions.
 dnl On mingw, precisions larger than 512 are treated like 512, in integer,
-dnl floating-point or pointer output. On BeOS, precisions larger than 1044
-dnl crash the program.
+dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
+dnl than 510 in floating-point output crash the program. On BeOS, precisions
+dnl larger than 1044 crash the program.
 dnl Result is gl_cv_func_printf_precision.
 
 AC_DEFUN([gl_PRINTF_PRECISION],
@@ -907,20 +908,24 @@ AC_DEFUN([gl_PRINTF_PRECISION],
 static char buf[5000];
 int main ()
 {
+  int result = 0;
 #ifdef __BEOS__
   /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
   return 1;
 #endif
   if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
-    return 1;
-  return 0;
+    result |= 1;
+  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+    result |= 2;
+  return result;
 }]])],
         [gl_cv_func_printf_precision=yes],
         [gl_cv_func_printf_precision=no],
         [
 changequote(,)dnl
          case "$host_os" in
-           # Guess no only on native Win32 and BeOS systems.
+           # Guess no only on Solaris, native Win32, and BeOS systems.
+           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
            mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
            beos*)        gl_cv_func_printf_precision="guessing no" ;;
            *)            gl_cv_func_printf_precision="guessing yes" ;;
@@ -1439,12 +1444,14 @@ dnl                                  1  2  3  4  5  6  
7  8  9 10 11 12 13 14 15
 dnl   glibc 2.5                      .  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .
 dnl   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
+dnl   MacOS X 10.5.8                 .  .  .  #  #  .  .  .  .  .  .  #  .  .  
.  .  .  .  .  .
 dnl   MacOS X 10.3.9                 .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
 dnl   OpenBSD 3.9, 4.0               .  .  #  #  #  #  .  #  .  #  .  #  .  #  
.  .  .  .  .  .
 dnl   Cygwin 1.7.0 (2009)            .  .  .  #  .  .  .  ?  .  .  .  .  .  ?  
.  .  .  .  .  .
 dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  
.  .  .  .  .  .
 dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  
.  .  .  .  .  .
-dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  .  .  
.  .  .  .  .  .
+dnl   Solaris 11 2010-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  
.  .  .  .  .  .
+dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  
.  .  .  .  .  .
 dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  .  .  
.  .  .  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  
#  #  #  #  #  #
 dnl   AIX 5.2, 7.1                   .  .  #  #  #  .  .  .  .  .  .  #  .  .  
.  .  .  .  .  .
@@ -1455,6 +1462,7 @@ dnl   HP-UX 10.20                    #  .  #  .  #  #  .  
?  .  .  #  #  .  .  .
 dnl   IRIX 6.5                       #  .  #  #  #  #  .  #  .  .  .  #  .  .  
.  .  #  .  .  .
 dnl   OSF/1 5.1                      #  .  #  #  #  #  .  .  .  .  .  #  .  .  
.  .  #  .  .  #
 dnl   OSF/1 4.0d                     #  .  #  #  #  #  .  .  .  .  .  #  .  .  
#  #  #  #  #  #
+dnl   NetBSD 5.0                     .  .  .  #  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
 dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  
.  .  .  ?  ?  ?
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  
.  .  .  .  .  .
 dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  
.  .  .  .  .  .
diff --git a/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4
index c5e813a..7fe2836 100644
--- a/lib/gl/m4/stdint.m4
+++ b/lib/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 35
+# stdint.m4 serial 36
 dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -259,7 +259,7 @@ static const char *macro_values[] =
           || strncmp (value, "((int)"/*)*/, 6) == 0
           || strncmp (value, "((signed short)"/*)*/, 15) == 0
           || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return 1;
+        return mv - macro_values + 1;
     }
   return 0;
 ]])],
diff --git a/lib/gl/m4/unistd_h.m4 b/lib/gl/m4/unistd_h.m4
index 48d06c7..e2f7f2b 100644
--- a/lib/gl/m4/unistd_h.m4
+++ b/lib/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 46
+# unistd_h.m4 serial 48
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_UNISTD_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
 /* Some systems declare various items in the wrong headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <fcntl.h>
 # include <stdio.h>
 # include <stdlib.h>
@@ -104,7 +104,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
-  HAVE_GETDOMAINNAME=1;   AC_SUBST([HAVE_GETDOMAINNAME])
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
   HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
@@ -125,6 +124,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
   HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
+  HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
   HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
   HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
@@ -136,6 +136,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
+  REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
diff --git a/lib/gl/m4/vasnprintf.m4 b/lib/gl/m4/vasnprintf.m4
index ebe3c52..9c04520 100644
--- a/lib/gl/m4/vasnprintf.m4
+++ b/lib/gl/m4/vasnprintf.m4
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 31
+# vasnprintf.m4 serial 32
 dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,6 +40,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 # Prequisites of lib/printf-parse.h, lib/printf-parse.c.
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
+  AC_REQUIRE([gl_FEATURES_H])
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
diff --git a/lib/gl/m4/wchar_h.m4 b/lib/gl/m4/wchar_h.m4
index 8cae82d..8c8fad9 100644
--- a/lib/gl/m4/wchar_h.m4
+++ b/lib/gl/m4/wchar_h.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 33
+# wchar_h.m4 serial 35
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -26,6 +26,8 @@ AC_DEFUN([gl_WCHAR_H],
   fi
   AC_SUBST([HAVE_WCHAR_H])
 
+  AC_REQUIRE([gl_FEATURES_H])
+
   AC_REQUIRE([gt_TYPE_WINT_T])
   if test $gt_cv_c_wint_t = yes; then
     HAVE_WINT_T=1
@@ -38,7 +40,7 @@ AC_DEFUN([gl_WCHAR_H],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 /* Some systems require additional headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 # include <stdio.h>
 # include <time.h>
diff --git a/lib/gl/printf-parse.c b/lib/gl/printf-parse.c
index 4559199..2b8cc7b 100644
--- a/lib/gl/printf-parse.c
+++ b/lib/gl/printf-parse.c
@@ -206,7 +206,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, 
arguments *a)
                   dp->flags |= FLAG_ZERO;
                   cp++;
                 }
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
               else if (*cp == 'I')
                 {
                   dp->flags |= FLAG_LOCALIZED;
diff --git a/lib/gl/printf-parse.h b/lib/gl/printf-parse.h
index 840159f..853cc47 100644
--- a/lib/gl/printf-parse.h
+++ b/lib/gl/printf-parse.h
@@ -23,6 +23,10 @@
      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
      STATIC             Set to 'static' to declare the function static.  */
 
+#if HAVE_FEATURES_H
+# include <features.h> /* for __GLIBC__, __UCLIBC__ */
+#endif
+
 #include "printf-args.h"
 
 
@@ -33,7 +37,7 @@
 #define FLAG_SPACE       8      /* space flag */
 #define FLAG_ALT        16      /* # flag */
 #define FLAG_ZERO       32
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
 # define FLAG_LOCALIZED 64      /* I flag, uses localized digits */
 #endif
 
diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h
index 1f611f4..6fafca4 100644
--- a/lib/gl/stdint.in.h
+++ b/lib/gl/stdint.in.h
@@ -134,40 +134,53 @@ typedef unsigned int gl_uint32_t;
 #define int32_t gl_int32_t
 #define uint32_t gl_uint32_t
 
+/* If the system defines INT64_MAX, assume int64_t works.  That way,
+   if the underlying platform defines int64_t to be a 64-bit long long
+   int, the code below won't mistakenly define it to be a 64-bit long
+   int, which would mess up C++ name mangling.  */
+
+#if INT64_MAX
+# define GL_INT64_T
+#else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
-#if LONG_MAX >> 31 >> 31 == 1
-# undef int64_t
+# if LONG_MAX >> 31 >> 31 == 1
+#  undef int64_t
 typedef long int gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
-#elif defined _MSC_VER
-# undef int64_t
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# elif defined _MSC_VER
+#  undef int64_t
 typedef __int64 gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
-#elif @HAVE_LONG_LONG_INT@
-# undef int64_t
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# elif @HAVE_LONG_LONG_INT@
+#  undef int64_t
 typedef long long int gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# endif
 #endif
 
-#if ULONG_MAX >> 31 >> 31 >> 1 == 1
-# undef uint64_t
-typedef unsigned long int gl_uint64_t;
-# define uint64_t gl_uint64_t
+#if UINT64_MAX
 # define GL_UINT64_T
-#elif defined _MSC_VER
-# undef uint64_t
+#else
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#  undef uint64_t
+typedef unsigned long int gl_uint64_t;
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# elif defined _MSC_VER
+#  undef uint64_t
 typedef unsigned __int64 gl_uint64_t;
-# define uint64_t gl_uint64_t
-# define GL_UINT64_T
-#elif @HAVE_UNSIGNED_LONG_LONG_INT@
-# undef uint64_t
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  undef uint64_t
 typedef unsigned long long int gl_uint64_t;
-# define uint64_t gl_uint64_t
-# define GL_UINT64_T
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# endif
 #endif
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
@@ -312,17 +325,14 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 #define INT32_MAX  2147483647
 #define UINT32_MAX  4294967295U
 
-#undef INT64_MIN
-#undef INT64_MAX
-#ifdef GL_INT64_T
+#if defined GL_INT64_T && ! defined INT64_MAX
 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
    evaluates the latter incorrectly in preprocessor expressions.  */
 # define INT64_MIN  (- INTMAX_C (1) << 63)
 # define INT64_MAX  INTMAX_C (9223372036854775807)
 #endif
 
-#undef UINT64_MAX
-#ifdef GL_UINT64_T
+#if defined GL_UINT64_T && ! defined UINT64_MAX
 # define UINT64_MAX  UINTMAX_C (18446744073709551615)
 #endif
 
diff --git a/lib/gl/string.in.h b/lib/gl/string.in.h
index 73c573c..b5711c0 100644
--- a/lib/gl/string.in.h
+++ b/lib/gl/string.in.h
@@ -87,7 +87,7 @@ _GL_CXXALIAS_SYS_CAST2 (memchr,
                         void *, (void const *__s, int __c, size_t __n),
                         void const *, (void const *__s, int __c, size_t __n));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
 _GL_CXXALIASWARN1 (memchr, void const *,
@@ -172,7 +172,7 @@ _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, 
size_t)
 _GL_CXXALIAS_SYS_CAST2 (memrchr,
                         void *, (void const *, int, size_t),
                         void const *, (void const *, int, size_t));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
@@ -202,7 +202,7 @@ _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int 
__c_in)
 _GL_CXXALIAS_SYS_CAST2 (rawmemchr,
                         void *, (void const *__s, int __c_in),
                         void const *, (void const *__s, int __c_in));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
 _GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
@@ -293,7 +293,7 @@ _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int 
__c_in)
 _GL_CXXALIAS_SYS_CAST2 (strchrnul,
                         char *, (char const *__s, int __c_in),
                         char const *, (char const *__s, int __c_in));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
 _GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
@@ -439,7 +439,7 @@ _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char 
const *__accept)
 _GL_CXXALIAS_SYS_CAST2 (strpbrk,
                         char *, (char const *__s, char const *__accept),
                         const char *, (char const *__s, char const *__accept));
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
 _GL_CXXALIASWARN1 (strpbrk, char const *,
@@ -541,7 +541,7 @@ _GL_CXXALIAS_SYS_CAST2 (strstr,
                         char *, (const char *haystack, const char *needle),
                         const char *, (const char *haystack, const char 
*needle));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strstr, const char *,
@@ -590,7 +590,7 @@ _GL_CXXALIAS_SYS_CAST2 (strcasestr,
                         char *, (const char *haystack, const char *needle),
                         const char *, (const char *haystack, const char 
*needle));
 # endif
-# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strcasestr, const char *,
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index 3d49d19..255869a 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -88,6 +88,13 @@
 # include <io.h>
 #endif
 
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if @GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__) \
+    && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
      || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
@@ -551,13 +558,21 @@ _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
    Null terminate it if the name is shorter than LEN.
    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
-# if address@hidden@
+# if @REPLACE_GETDOMAINNAME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getdomainname
+#   define getdomainname rpl_getdomainname
+#  endif
+_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
+                                      _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
                                       _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
 # endif
-/* Need to cast, because on MacOS X 10.5 systems, the second parameter is
-                                                        int len.  */
-_GL_CXXALIAS_SYS_CAST (getdomainname, int, (char *name, size_t len));
 _GL_CXXALIASWARN (getdomainname);
 #elif defined GNULIB_POSIXCHECK
 # undef getdomainname
diff --git a/lib/gl/vasnprintf.c b/lib/gl/vasnprintf.c
index 99edec7..8585e84 100644
--- a/lib/gl/vasnprintf.c
+++ b/lib/gl/vasnprintf.c
@@ -279,7 +279,7 @@ decimal_point_char (void)
      multithread-safe on glibc systems and MacOS X systems, but is not required
      to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
      localeconv() is rarely multithread-safe.  */
-#  if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined 
__MACH__))
+#  if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined 
__APPLE__ && defined __MACH__))
   point = nl_langinfo (RADIXCHAR);
 #  elif 1
   char pointbuf[5];
@@ -4754,7 +4754,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   *fbp++ = ' ';
                 if (flags & FLAG_ALT)
                   *fbp++ = '#';
-#if __GLIBC__ >= 2
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
                 if (flags & FLAG_LOCALIZED)
                   *fbp++ = 'I';
 #endif
@@ -4841,14 +4841,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined 
_WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && 
!defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined 
__CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';
 # else
                 /* On glibc2 systems from glibc >= 2.3 - probably also older
-                   ones - we know that snprintf's returns value conforms to
-                   ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
+                   ones - we know that snprintf's return value conforms to
+                   ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
+                   gl_SNPRINTF_TRUNCATION_C99 pass.
                    Therefore we can avoid using %n in this situation.
                    On glibc2 systems from 2004-10-18 or newer, the use of %n
                    in format strings in writable memory may crash the program
diff --git a/lib/gl/wchar.in.h b/lib/gl/wchar.in.h
index 568ef32..edae751 100644
--- a/lib/gl/wchar.in.h
+++ b/lib/gl/wchar.in.h
@@ -53,6 +53,10 @@
 
 #define _GL_ALREADY_INCLUDING_WCHAR_H
 
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
index 46f4d47..0c27875 100644
--- a/lib/gltests/intprops.h
+++ b/lib/gltests/intprops.h
@@ -68,13 +68,17 @@
 #  define signed_type_or_expr__(t) 1
 # endif
 
+/* Bound on length of the string representing an unsigned integer
+   value representable in B bits.  log10 (2.0) < 146/485.  The
+   smallest value of B where this bound is not tight is 2621.  */
+# define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
+
 /* Bound on length of the string representing an integer type or expression T.
-   Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485;
-   add 1 for integer division truncation; add 1 more for a minus sign
-   if needed.  */
+   Subtract 1 for the sign bit if T is signed, and then add 1 more for
+   a minus sign if needed.  */
 # define INT_STRLEN_BOUND(t) \
-  ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \
-   + signed_type_or_expr__ (t) + 1)
+  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) \
+   + signed_type_or_expr__ (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
    including the terminating null.  */
diff --git a/lib/maint.mk b/lib/maint.mk
index 2c1be85..315b223 100644
--- a/lib/maint.mk
+++ b/lib/maint.mk
@@ -741,7 +741,8 @@ sc_GFDL_version:
        halt='GFDL vN, N!=3'                                            \
          $(_sc_search_regexp)
 
-# Don't use Texinfo @acronym{} as it is not a good idea.
+# Don't use Texinfo's @acronym{}.
+# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
 texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
 sc_texinfo_acronym:
        @prohibit='@acronym\{'                                          \
@@ -1097,7 +1098,6 @@ emit_upload_commands:
        @echo =====================================
        @echo =====================================
 
-noteworthy = * Noteworthy changes in release ?.? (????-??-??) [?]
 define emit-commit-log
   printf '%s\n' 'post-release administrivia' '' \
     '* NEWS: Add header line for next release.' \
@@ -1135,6 +1135,7 @@ alpha beta stable: $(local-check) writable-files 
no-submodule-changes
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep
 
+gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
 .PHONY: release-prep
 release-prep:
        case $$RELEASE_TYPE in alpha|beta|stable) ;; \
@@ -1146,7 +1147,7 @@ release-prep:
        fi
        echo $(VERSION) > $(prev_version_file)
        $(MAKE) update-NEWS-hash
-       perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
+       perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' NEWS
        $(emit-commit-log) > .ci-msg
        $(VC) commit -F .ci-msg -a
        rm .ci-msg
diff --git a/maint.mk b/maint.mk
index 2c1be85..315b223 100644
--- a/maint.mk
+++ b/maint.mk
@@ -741,7 +741,8 @@ sc_GFDL_version:
        halt='GFDL vN, N!=3'                                            \
          $(_sc_search_regexp)
 
-# Don't use Texinfo @acronym{} as it is not a good idea.
+# Don't use Texinfo's @acronym{}.
+# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
 texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
 sc_texinfo_acronym:
        @prohibit='@acronym\{'                                          \
@@ -1097,7 +1098,6 @@ emit_upload_commands:
        @echo =====================================
        @echo =====================================
 
-noteworthy = * Noteworthy changes in release ?.? (????-??-??) [?]
 define emit-commit-log
   printf '%s\n' 'post-release administrivia' '' \
     '* NEWS: Add header line for next release.' \
@@ -1135,6 +1135,7 @@ alpha beta stable: $(local-check) writable-files 
no-submodule-changes
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep
 
+gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
 .PHONY: release-prep
 release-prep:
        case $$RELEASE_TYPE in alpha|beta|stable) ;; \
@@ -1146,7 +1147,7 @@ release-prep:
        fi
        echo $(VERSION) > $(prev_version_file)
        $(MAKE) update-NEWS-hash
-       perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
+       perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' NEWS
        $(emit-commit-log) > .ci-msg
        $(VC) commit -F .ci-msg -a
        rm .ci-msg


hooks/post-receive
-- 
GNU gsasl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]