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-1-15-ge1b9b4a


From: Simon Josefsson
Subject: [SCM] GNU gsasl branch, master, updated. gsasl-1-5-1-15-ge1b9b4a
Date: Thu, 20 May 2010 06:48:46 +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=e1b9b4a135337b68cee6208664b3749bcb53aea3

The branch, master has been updated
       via  e1b9b4a135337b68cee6208664b3749bcb53aea3 (commit)
       via  47bca010c17d3eb2423cbd186baa52d6c026fa67 (commit)
      from  f1094f4eabfa698c7269b3a31ef7ba121029857a (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 e1b9b4a135337b68cee6208664b3749bcb53aea3
Author: Simon Josefsson <address@hidden>
Date:   Thu May 20 08:44:54 2010 +0200

    Update gnulib files, use new valgrind-tests module.

commit 47bca010c17d3eb2423cbd186baa52d6c026fa67
Author: Simon Josefsson <address@hidden>
Date:   Mon May 17 14:48:51 2010 +0200

    Update gnulib files.

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

Summary of changes:
 configure.ac                              |    2 -
 doc/gendocs_template                      |    2 +-
 gl/Makefile.am                            |    6 ++-
 gl/config.charset                         |   42 ++++++------
 gl/error.c                                |   32 +++++++++-
 gl/localcharset.c                         |    7 +-
 gl/m4/asm-underscore.m4                   |   48 ++++++++++++++
 gl/m4/gettext.m4                          |    6 +-
 gl/m4/gnulib-cache.m4                     |    3 +-
 gl/m4/gnulib-comp.m4                      |   11 +++-
 gl/m4/iconv.m4                            |    7 ++-
 gl/m4/intl.m4                             |   93 +++++++++++++++-------------
 gl/m4/po.m4                               |    2 +-
 gl/m4/stdio_h.m4                          |    3 +-
 gl/m4/unistd_h.m4                         |    8 ++-
 m4/valgrind.m4 => gl/m4/valgrind-tests.m4 |    8 +-
 gl/m4/wctob.m4                            |   31 ++++++++-
 gl/stdio-write.c                          |    2 -
 gl/stdio.in.h                             |   22 ++++++-
 gl/unistd.in.h                            |   36 +++++++++++-
 gl/vasnprintf.c                           |    4 +-
 gl/verify.h                               |   41 ++++++++++---
 gl/wchar.in.h                             |    2 +-
 gltests/Makefile.am                       |    9 +++
 gltests/init.sh                           |   61 +++++++++++++-----
 gltests/test-lseek.sh                     |    4 +-
 gltests/test-verify.c                     |   68 ++++++++++++++++++++
 gltests/test-verify.sh                    |   24 +++++++
 gltests/test-xalloc-die.sh                |    2 +-
 gltests/wctob.c                           |   11 ++--
 lib/build-aux/c++defs.h                   |   36 ++++++++---
 lib/build-aux/gendocs.sh                  |   12 +++-
 lib/gl/Makefile.am                        |    4 +
 lib/gl/m4/asm-underscore.m4               |   48 ++++++++++++++
 {gl => lib/gl}/m4/fcntl-o.m4              |    0
 lib/gl/m4/gettext.m4                      |    6 +-
 lib/gl/m4/gnulib-comp.m4                  |    8 ++-
 lib/gl/m4/iconv.m4                        |    7 ++-
 lib/gl/m4/intl.m4                         |   93 +++++++++++++++-------------
 lib/gl/m4/po.m4                           |    2 +-
 lib/gl/m4/stdio_h.m4                      |    3 +-
 lib/gl/m4/unistd_h.m4                     |    8 ++-
 lib/gl/stdio-write.c                      |    2 -
 lib/gl/stdio.in.h                         |   22 ++++++-
 lib/gl/unistd.in.h                        |   36 +++++++++++-
 lib/gl/vasnprintf.c                       |    4 +-
 lib/gl/wchar.in.h                         |    2 +-
 lib/gltests/Makefile.am                   |    9 +++
 {gltests => lib/gltests}/init.sh          |   61 +++++++++++++-----
 lib/gltests/test-verify.c                 |   68 ++++++++++++++++++++
 lib/gltests/test-verify.sh                |   24 +++++++
 lib/gltests/verify.h                      |   41 ++++++++++---
 lib/maint.mk                              |   96 ++++++++++++++++++++++-------
 maint.mk                                  |   96 ++++++++++++++++++++++-------
 54 files changed, 1011 insertions(+), 274 deletions(-)
 create mode 100644 gl/m4/asm-underscore.m4
 rename m4/valgrind.m4 => gl/m4/valgrind-tests.m4 (90%)
 create mode 100644 gltests/test-verify.c
 create mode 100755 gltests/test-verify.sh
 create mode 100644 lib/gl/m4/asm-underscore.m4
 copy {gl => lib/gl}/m4/fcntl-o.m4 (100%)
 copy {gltests => lib/gltests}/init.sh (83%)
 create mode 100644 lib/gltests/test-verify.c
 create mode 100755 lib/gltests/test-verify.sh

diff --git a/configure.ac b/configure.ac
index f948a54..368aec9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,8 +81,6 @@ GTK_DOC_CHECK(1.1)
 # For gnulib stuff in gl/.
 gl_INIT
 
-sj_VALGRIND
-
 AC_ARG_ENABLE([gcc-warnings],
   [AS_HELP_STRING([--enable-gcc-warnings],
                  [turn on lots of GCC warnings (for developers)])],
diff --git a/doc/gendocs_template b/doc/gendocs_template
index d5c195a..4cdf0c4 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -97,7 +97,7 @@ Please send broken links and other corrections or suggestions 
to
 <a href="mailto:%%EMAIL%%";>&lt;%%EMAIL%%&gt;</a>.
 </p>
 
-<p>Copyright &copy; 2009 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2010 Free Software Foundation, Inc.</p>
 
 <p>Verbatim copying and distribution of this entire article is
 permitted in any medium, provided this notice is preserved.</p>
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 7741b52..37c1653 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=lib/build-aux --with-tests 
--avoid=fcntl-h-c++-tests --avoid=iconv-h-c++-tests --avoid=stdio-c++-tests 
--avoid=stdlib-c++-tests --avoid=string-c++-tests --avoid=sys_ioctl-c++-tests 
--avoid=sys_select-c++-tests --avoid=sys_socket-c++-tests 
--avoid=sys_stat-c++-tests --avoid=sys_time-c++-tests --avoid=time-c++-tests 
--avoid=unistd-c++-tests --avoid=wchar-c++-tests --avoid=wctype-c++-tests 
--libtool --macro-prefix=gl --no-vc-files autobuild close connect error exit 
fdl-1.3 gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 
maintainer-makefile manywarnings netdb netinet_in pmccabe2html poll progname 
quote readline recv shutdown socket striconv strtok_r sys_time unistd 
version-etc warnings xalloc
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override 
--lib=libgl --source-base=gl --m4-base=gl/m4 --doc-base=doc 
--tests-base=gltests --aux-dir=lib/build-aux --with-tests 
--avoid=fcntl-h-c++-tests --avoid=iconv-h-c++-tests --avoid=stdio-c++-tests 
--avoid=stdlib-c++-tests --avoid=string-c++-tests --avoid=sys_ioctl-c++-tests 
--avoid=sys_select-c++-tests --avoid=sys_socket-c++-tests 
--avoid=sys_stat-c++-tests --avoid=sys_time-c++-tests --avoid=time-c++-tests 
--avoid=unistd-c++-tests --avoid=wchar-c++-tests --avoid=wctype-c++-tests 
--libtool --macro-prefix=gl --no-vc-files autobuild close connect error exit 
fdl-1.3 gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 
maintainer-makefile manywarnings netdb netinet_in pmccabe2html poll progname 
quote readline recv shutdown socket striconv strtok_r sys_time unistd 
valgrind-tests version-etc warnings xalloc
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -1010,6 +1010,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
              -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -1383,6 +1384,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
              -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
              -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+             -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
              -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
              -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
@@ -1417,6 +1419,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
              -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
              -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
@@ -1444,6 +1447,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
diff --git a/gl/config.charset b/gl/config.charset
index 2959df8..aa7d00d 100644
--- a/gl/config.charset
+++ b/gl/config.charset
@@ -30,21 +30,21 @@
 # The current list of GNU canonical charset names is as follows.
 #
 #       name              MIME?             used by which systems
-#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin
-#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd 
openbsd darwin
-#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd 
openbsd darwin
-#   ISO-8859-3              Y   glibc solaris
+#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin cygwin
+#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd 
openbsd darwin cygwin
+#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd 
openbsd darwin cygwin
+#   ISO-8859-3              Y   glibc solaris cygwin
 #   ISO-8859-4              Y   osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd 
openbsd darwin
-#   ISO-8859-6              Y   glibc aix hpux solaris
-#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd 
darwin
-#   ISO-8859-8              Y   glibc aix hpux osf solaris
-#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin
-#   ISO-8859-13                 glibc netbsd openbsd darwin
-#   ISO-8859-14                 glibc
-#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd 
darwin
+#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd 
openbsd darwin cygwin
+#   ISO-8859-6              Y   glibc aix hpux solaris cygwin
+#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd 
darwin cygwin
+#   ISO-8859-8              Y   glibc aix hpux osf solaris cygwin
+#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin cygwin
+#   ISO-8859-13                 glibc netbsd openbsd darwin cygwin
+#   ISO-8859-14                 glibc cygwin
+#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd 
darwin cygwin
 #   KOI8-R                  Y   glibc solaris freebsd netbsd openbsd darwin
-#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin
+#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin cygwin
 #   KOI8-T                      glibc
 #   CP437                       dos
 #   CP775                       dos
@@ -61,7 +61,7 @@
 #   CP869                       dos
 #   CP874                       woe32 dos
 #   CP922                       aix
-#   CP932                       aix woe32 dos
+#   CP932                       aix cygwin woe32 dos
 #   CP943                       aix
 #   CP949                       osf darwin woe32 dos
 #   CP950                       woe32 dos
@@ -71,7 +71,7 @@
 #   CP1129                      aix
 #   CP1131                      darwin
 #   CP1250                      woe32
-#   CP1251                      glibc solaris netbsd openbsd darwin woe32
+#   CP1251                      glibc solaris netbsd openbsd darwin cygwin 
woe32
 #   CP1252                      aix woe32
 #   CP1253                      woe32
 #   CP1254                      woe32
@@ -80,19 +80,19 @@
 #   CP1257                      woe32
 #   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd 
darwin
 #   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd 
darwin
-#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd 
darwin
+#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd 
darwin cygwin
 #   EUC-TW                      glibc aix hpux irix osf solaris netbsd
-#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd 
darwin
+#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd 
darwin cygwin
 #   BIG5-HKSCS                  glibc solaris darwin
-#   GBK                         glibc aix osf solaris darwin woe32 dos
+#   GBK                         glibc aix osf solaris darwin cygwin woe32 dos
 #   GB18030                     glibc solaris netbsd darwin
 #   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
 #   JOHAB                       glibc solaris woe32
-#   TIS-620                     glibc aix hpux osf solaris
+#   TIS-620                     glibc aix hpux osf solaris cygwin
 #   VISCII                  Y   glibc
 #   TCVN5712-1                  glibc
 #   ARMSCII-8                   glibc darwin
-#   GEORGIAN-PS                 glibc
+#   GEORGIAN-PS                 glibc cygwin
 #   PT154                       glibc
 #   HP-ROMAN8                   hpux
 #   HP-ARABIC8                  hpux
@@ -102,7 +102,7 @@
 #   HP-KANA8                    hpux
 #   DEC-KANJI                   osf
 #   DEC-HANYU                   osf
-#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin
+#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin cygwin
 #
 # Note: Names which are not marked as being a MIME name should not be used in
 # Internet protocols for information interchange (mail, news, etc.).
diff --git a/gl/error.c b/gl/error.c
index c79e8d4..ed9dba0 100644
--- a/gl/error.c
+++ b/gl/error.c
@@ -88,6 +88,15 @@ extern void __error_at_line (int status, int errnum, const 
char *file_name,
 # include <fcntl.h>
 # include <unistd.h>
 
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the Win32 API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+# endif
+
+/* The gnulib override of fcntl is not needed in this file.  */
+# undef fcntl
+
 # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
 #  ifndef HAVE_DECL_STRERROR_R
 "this configure-time declaration test was not run"
@@ -104,10 +113,29 @@ extern char *program_name;
 # endif /* HAVE_STRERROR_R || defined strerror_r */
 #endif  /* not _LIBC */
 
+#if !_LIBC
+/* Return non-zero if FD is open.  */
+static inline int
+is_open (int fd)
+{
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  /* On Win32: The initial state of unassigned standard file descriptors is
+     that they are open but point to an INVALID_HANDLE_VALUE.  There is no
+     fcntl, and the gnulib replacement fcntl does not support F_GETFL.  */
+  return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+#  ifndef F_GETFL
+#   error Please port fcntl to your platform
+#  endif
+  return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
 static inline void
 flush_stdout (void)
 {
-#if !_LIBC && defined F_GETFL
+#if !_LIBC
   int stdout_fd;
 
 # if GNULIB_FREOPEN_SAFER
@@ -124,7 +152,7 @@ flush_stdout (void)
   /* POSIX states that fflush (stdout) after fclose is unspecified; it
      is safe in glibc, but not on all other platforms.  fflush (NULL)
      is always defined, but too draconian.  */
-  if (0 <= stdout_fd && 0 <= fcntl (stdout_fd, F_GETFL))
+  if (0 <= stdout_fd && is_open (stdout_fd))
 #endif
     fflush (stdout);
 }
diff --git a/gl/localcharset.c b/gl/localcharset.c
index a04dc44..fa2207f 100644
--- a/gl/localcharset.c
+++ b/gl/localcharset.c
@@ -369,10 +369,9 @@ locale_charset (void)
   codeset = nl_langinfo (CODESET);
 
 #  ifdef __CYGWIN__
-  /* Cygwin 1.5.x does not have locales.  nl_langinfo (CODESET) always
-     returns "US-ASCII".  As long as this is not fixed, return the suffix
-     of the locale name from the environment variables (if present) or
-     the codepage as a number.  */
+  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
+     returns "US-ASCII".  Return the suffix of the locale name from the
+     environment variables (if present) or the codepage as a number.  */
   if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
     {
       const char *locale;
diff --git a/gl/m4/asm-underscore.m4 b/gl/m4/asm-underscore.m4
new file mode 100644
index 0000000..1736cc4
--- /dev/null
+++ b/gl/m4/asm-underscore.m4
@@ -0,0 +1,48 @@
+# asm-underscore.m4 serial 1
+dnl Copyright (C) 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.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+  dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+  dnl 1. It works only for GCC.
+  dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+  AC_CACHE_CHECK(
+    [whether C symbols are prefixed with underscore at the linker level],
+    [gl_cv_prog_as_underscore],
+    [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
+     if grep _foo conftest.s >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+    ])
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+  AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+    [Define to the prefix of C symbols at the assembler and linker level,
+     either an underscore or empty.])
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+  AC_SUBST([ASM_SYMBOL_PREFIX])
+])
diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4
index d6dc3fe..f84e6a5 100644
--- a/gl/m4/gettext.m4
+++ b/gl/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 62 (gettext-0.18)
+# gettext.m4 serial 63 (gettext-0.18)
 dnl Copyright (C) 1995-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,7 +15,7 @@ dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <address@hidden>, 1995-2000.
-dnl   Bruno Haible <address@hidden>, 2000-2006.
+dnl   Bruno Haible <address@hidden>, 2000-2006, 2008-2010.
 
 dnl Macro to add for using GNU gettext.
 
@@ -60,6 +60,8 @@ AC_DEFUN([AM_GNU_GETTEXT],
   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , 
[ifelse([$1], [use-libtool], ,
     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
 ])])])])])
+  ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+    [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] 
argument is deprecated.])])
   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], 
[need-formatstring-macros], ,
     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 ])])])])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index f793dbf..b8736b7 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests 
--aux-dir=lib/build-aux --with-tests --avoid=fcntl-h-c++-tests 
--avoid=iconv-h-c++-tests --avoid=stdio-c++-tests --avoid=stdlib-c++-tests 
--avoid=string-c++-tests --avoid=sys_ioctl-c++-tests 
--avoid=sys_select-c++-tests --avoid=sys_socket-c++-tests 
--avoid=sys_stat-c++-tests --avoid=sys_time-c++-tests --avoid=time-c++-tests 
--avoid=unistd-c++-tests --avoid=wchar-c++-tests --avoid=wctype-c++-tests 
--libtool --macro-prefix=gl --no-vc-files autobuild close connect error exit 
fdl-1.3 gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 
maintainer-makefile manywarnings netdb netinet_in pmccabe2html poll progname 
quote readline recv shutdown socket striconv strtok_r sys_time unistd 
version-etc warnings xalloc
+#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgl 
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests 
--aux-dir=lib/build-aux --with-tests --avoid=fcntl-h-c++-tests 
--avoid=iconv-h-c++-tests --avoid=stdio-c++-tests --avoid=stdlib-c++-tests 
--avoid=string-c++-tests --avoid=sys_ioctl-c++-tests 
--avoid=sys_select-c++-tests --avoid=sys_socket-c++-tests 
--avoid=sys_stat-c++-tests --avoid=sys_time-c++-tests --avoid=time-c++-tests 
--avoid=unistd-c++-tests --avoid=wchar-c++-tests --avoid=wctype-c++-tests 
--libtool --macro-prefix=gl --no-vc-files autobuild close connect error exit 
fdl-1.3 gendocs getaddrinfo getopt-gnu getpass gpl-3.0 lgpl-2.1 
maintainer-makefile manywarnings netdb netinet_in pmccabe2html poll progname 
quote readline recv shutdown socket striconv strtok_r sys_time unistd 
valgrind-tests version-etc warnings xalloc
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -48,6 +48,7 @@ gl_MODULES([
   strtok_r
   sys_time
   unistd
+  valgrind-tests
   version-etc
   warnings
   xalloc
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index ab97ce7..ccf2e15 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -201,11 +201,13 @@ AC_DEFUN([gl_EARLY],
   # Code from module unsetenv:
   # Code from module unsetenv-tests:
   # Code from module useless-if-before-free:
+  # Code from module valgrind-tests:
   # Code from module vasnprintf:
   # Code from module vasnprintf-tests:
   # Code from module vc-list-files:
   # Code from module vc-list-files-tests:
   # Code from module verify:
+  # Code from module verify-tests:
   # Code from module version-etc:
   # Code from module version-etc-fsf:
   # Code from module version-etc-tests:
@@ -460,6 +462,8 @@ AC_SUBST([LTALLOCA])
   # Code from module unistd:
   gl_UNISTD_H
   # Code from module useless-if-before-free:
+  # Code from module valgrind-tests:
+  gl_VALGRIND_TESTS
   # Code from module vasnprintf:
   gl_FUNC_VASNPRINTF
   # Code from module vc-list-files:
@@ -543,7 +547,7 @@ changequote([, ])dnl
   gl_FCNTL_H
   gl_FUNC_UNGETC_WORKS
   dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
-  AM_GNU_GETTEXT_VERSION([0.17])
+  AM_GNU_GETTEXT_VERSION([0.18])
   gl_FUNC_GETTIMEOFDAY
   gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
   AC_REQUIRE([AC_C_INLINE])
@@ -598,6 +602,7 @@ changequote([, ])dnl
   gl_HEADER_TIME_H
   gl_FUNC_UNSETENV
   gl_STDLIB_MODULE_INDICATOR([unsetenv])
+  gl_VALGRIND_TESTS
   abs_aux_dir=`cd "$ac_aux_dir"; pwd`
   AC_SUBST([abs_aux_dir])
   gl_FUNC_WCTOB
@@ -820,6 +825,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/00gnulib.m4
   m4/alloca.m4
   m4/arpa_inet_h.m4
+  m4/asm-underscore.m4
   m4/autobuild.m4
   m4/close.m4
   m4/codeset.m4
@@ -932,6 +938,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/uintmax_t.m4
   m4/ungetc.m4
   m4/unistd_h.m4
+  m4/valgrind-tests.m4
   m4/vasnprintf.m4
   m4/version-etc.m4
   m4/visibility.m4
@@ -1029,6 +1036,8 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-vasnprintf.c
   tests/test-vc-list-files-cvs.sh
   tests/test-vc-list-files-git.sh
+  tests/test-verify.c
+  tests/test-verify.sh
   tests/test-version-etc.c
   tests/test-version-etc.sh
   tests/test-wchar.c
diff --git a/gl/m4/iconv.m4 b/gl/m4/iconv.m4
index f46ff14..4c68472 100644
--- a/gl/m4/iconv.m4
+++ b/gl/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 9 (gettext-0.18)
+# iconv.m4 serial 10 (gettext-0.18.1)
 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,
@@ -170,7 +170,10 @@ int main ()
   AC_SUBST([LTLIBICONV])
 ])
 
-AC_DEFUN([AM_ICONV],
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+m4_version_prereq([2.64],[AC_DEFUN_ONCE],[AC_DEFUN])([AM_ICONV],
 [
   AM_ICONV_LINK
   if test "$am_cv_func_iconv" = yes; then
diff --git a/gl/m4/intl.m4 b/gl/m4/intl.m4
index 5e17fea..335b23c 100644
--- a/gl/m4/intl.m4
+++ b/gl/m4/intl.m4
@@ -1,5 +1,5 @@
-# intl.m4 serial 8 (gettext-0.17)
-dnl Copyright (C) 1995-2007, 2009-2010 Free Software Foundation, Inc.
+# intl.m4 serial 17 (gettext-0.18)
+dnl Copyright (C) 1995-2009 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,9 +15,9 @@ dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <address@hidden>, 1995-2000.
-dnl   Bruno Haible <address@hidden>, 2000-2006.
+dnl   Bruno Haible <address@hidden>, 2000-2009.
 
-AC_PREREQ(2.52)
+AC_PREREQ([2.52])
 
 dnl Checks for all prerequisites of the intl subdirectory,
 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@@ -40,14 +40,24 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_REQUIRE([gt_PRINTF_POSIX])
   AC_REQUIRE([gl_GLIBC21])dnl
   AC_REQUIRE([gl_XSIZE])dnl
+  AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
   AC_REQUIRE([gt_INTL_MACOSX])dnl
 
+  dnl Support for automake's --enable-silent-rules.
+  case "$enable_silent_rules" in
+    yes) INTL_DEFAULT_VERBOSITY=0;;
+    no)  INTL_DEFAULT_VERBOSITY=1;;
+    *)   INTL_DEFAULT_VERBOSITY=1;;
+  esac
+  AC_SUBST([INTL_DEFAULT_VERBOSITY])
+
   AC_CHECK_TYPE([ptrdiff_t], ,
     [AC_DEFINE([ptrdiff_t], [long],
        [Define as the type of the result of subtracting two pointers, if the 
system doesn't define it.])
     ])
   AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
-  AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
+  AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
+    snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
 
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
@@ -78,6 +88,12 @@ AC_DEFUN([AM_INTL_SUBDIR],
     HAVE_SNPRINTF=0
   fi
   AC_SUBST([HAVE_SNPRINTF])
+  if test "$ac_cv_func_newlocale" = yes; then
+    HAVE_NEWLOCALE=1
+  else
+    HAVE_NEWLOCALE=0
+  fi
+  AC_SUBST([HAVE_NEWLOCALE])
   if test "$ac_cv_func_wprintf" = yes; then
     HAVE_WPRINTF=1
   else
@@ -146,22 +162,31 @@ AC_DEFUN([AM_INTL_SUBDIR],
 #define __libc_lock_lock_recursive                gl_recursive_lock_lock
 #define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
 #define glthread_in_use  libintl_thread_in_use
-#define glthread_lock_init     libintl_lock_init
-#define glthread_lock_lock     libintl_lock_lock
-#define glthread_lock_unlock   libintl_lock_unlock
-#define glthread_lock_destroy  libintl_lock_destroy
-#define glthread_rwlock_init     libintl_rwlock_init
-#define glthread_rwlock_rdlock   libintl_rwlock_rdlock
-#define glthread_rwlock_wrlock   libintl_rwlock_wrlock
-#define glthread_rwlock_unlock   libintl_rwlock_unlock
-#define glthread_rwlock_destroy  libintl_rwlock_destroy
-#define glthread_recursive_lock_init     libintl_recursive_lock_init
-#define glthread_recursive_lock_lock     libintl_recursive_lock_lock
-#define glthread_recursive_lock_unlock   libintl_recursive_lock_unlock
-#define glthread_recursive_lock_destroy  libintl_recursive_lock_destroy
-#define glthread_once                 libintl_once
-#define glthread_once_call            libintl_once_call
+#define glthread_lock_init_func     libintl_lock_init_func
+#define glthread_lock_lock_func     libintl_lock_lock_func
+#define glthread_lock_unlock_func   libintl_lock_unlock_func
+#define glthread_lock_destroy_func  libintl_lock_destroy_func
+#define glthread_rwlock_init_multithreaded     
libintl_rwlock_init_multithreaded
+#define glthread_rwlock_init_func              libintl_rwlock_init_func
+#define glthread_rwlock_rdlock_multithreaded   
libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_rdlock_func            libintl_rwlock_rdlock_func
+#define glthread_rwlock_wrlock_multithreaded   
libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_wrlock_func            libintl_rwlock_wrlock_func
+#define glthread_rwlock_unlock_multithreaded   
libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_unlock_func            libintl_rwlock_unlock_func
+#define glthread_rwlock_destroy_multithreaded  
libintl_rwlock_destroy_multithreaded
+#define glthread_rwlock_destroy_func           libintl_rwlock_destroy_func
+#define glthread_recursive_lock_init_multithreaded     
libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_init_func              
libintl_recursive_lock_init_func
+#define glthread_recursive_lock_lock_multithreaded     
libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_lock_func              
libintl_recursive_lock_lock_func
+#define glthread_recursive_lock_unlock_multithreaded   
libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_unlock_func            
libintl_recursive_lock_unlock_func
+#define glthread_recursive_lock_destroy_multithreaded  
libintl_recursive_lock_destroy_multithreaded
+#define glthread_recursive_lock_destroy_func           
libintl_recursive_lock_destroy_func
+#define glthread_once_func            libintl_once_func
 #define glthread_once_singlethreaded  libintl_once_singlethreaded
+#define glthread_once_multithreaded   libintl_once_multithreaded
 ])
 ])
 
@@ -198,40 +223,24 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
   AC_TRY_LINK(
     [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; 
}],
     [],
-    [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
+    [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
        [Define to 1 if the compiler understands __builtin_expect.])])
 
   AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
   AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
-    stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
-    argz_next __fsetlocking])
+    stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
+    argz_stringify argz_next __fsetlocking])
 
   dnl Use the *_unlocked functions only if they are declared.
   dnl (because some of them were defined without being declared in Solaris
   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
   dnl on Solaris 2.5.1 to run on Solaris 2.6).
   dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
-  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
-  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
+  gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
 
   AM_ICONV
 
-  dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
-  dnl and a _NL_LOCALE_NAME macro always.
-  AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
-    [AC_TRY_LINK([#include <langinfo.h>
-#include <locale.h>],
-      [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
-       return !cs;
-      ],
-      gt_cv_nl_locale_name=yes,
-      gt_cv_nl_locale_name=no)
-    ])
-  if test $gt_cv_nl_locale_name = yes; then
-    AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
-      [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro 
if _GNU_SOURCE is defined.])
-  fi
-
   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
   dnl because plural.y uses bison specific features. It requires at least
   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
@@ -269,7 +278,7 @@ dnl gt_CHECK_DECL(FUNC, INCLUDES)
 dnl Check whether a function is declared.
 AC_DEFUN([gt_CHECK_DECL],
 [
-  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+  AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
     [AC_TRY_COMPILE([$2], [
 #ifndef $1
   char *p = (char *) $1;
diff --git a/gl/m4/po.m4 b/gl/m4/po.m4
index 960efe1..47f36a4 100644
--- a/gl/m4/po.m4
+++ b/gl/m4/po.m4
@@ -29,7 +29,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
 
   dnl Release version of the gettext macros. This is used to ensure that
   dnl the gettext macros and po/Makefile.in.in are in sync.
-  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
 
   dnl Perform the following tests also if --disable-nls has been given,
   dnl because they are needed for "make dist" to work.
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 1d1d95e..f5650cd 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 30
+# stdio_h.m4 serial 31
 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,
@@ -8,6 +8,7 @@ AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
   gl_CHECK_NEXT_HEADERS([stdio.h])
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index b26d0a9..48d06c7 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -38,8 +38,9 @@ AC_DEFUN([gl_UNISTD_H],
     ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
     fsync ftruncate getcwd getdomainname getdtablesize getgroups
     gethostname getlogin getlogin_r getpagesize getusershell setusershell
-    endusershell lchown link linkat lseek pipe2 pread readlink readlinkat
-    rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep])
+    endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+    readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+    usleep])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -79,6 +80,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
   GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
   GNULIB_PREAD=0;            AC_SUBST([GNULIB_PREAD])
+  GNULIB_PWRITE=0;           AC_SUBST([GNULIB_PWRITE])
   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
   GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
   GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
@@ -113,6 +115,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
   HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
   HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
+  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
   HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
@@ -140,6 +143,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
   REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
+  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
diff --git a/m4/valgrind.m4 b/gl/m4/valgrind-tests.m4
similarity index 90%
rename from m4/valgrind.m4
rename to gl/m4/valgrind-tests.m4
index c460c34..e2434c6 100644
--- a/m4/valgrind.m4
+++ b/gl/m4/valgrind-tests.m4
@@ -1,4 +1,4 @@
-# valgrind.m4 serial 3
+# valgrind-tests.m4 serial 1
 dnl Copyright (C) 2008, 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,
@@ -6,10 +6,10 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl From Simon Josefsson
 
-# sj_VALGRIND()
-# -------------
+# gl_VALGRIND_TESTS()
+# -------------------
 # Check if valgrind is available, and set VALGRIND to it if available.
-AC_DEFUN([sj_VALGRIND],
+AC_DEFUN([gl_VALGRIND_TESTS],
 [
   AC_ARG_ENABLE(valgrind-tests,
     AS_HELP_STRING([--enable-valgrind-tests],
diff --git a/gl/m4/wctob.m4 b/gl/m4/wctob.m4
index 3362ec6..3af3cc7 100644
--- a/gl/m4/wctob.m4
+++ b/gl/m4/wctob.m4
@@ -1,4 +1,4 @@
-# wctob.m4 serial 4
+# wctob.m4 serial 5
 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,
@@ -17,6 +17,8 @@ AC_DEFUN([gl_FUNC_WCTOB],
   else
 
     dnl Solaris 9 has the wctob() function but it does not work.
+    dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned
+    dnl registers, see <http://cygwin.com/ml/cygwin/2010-05/msg00015.html>.
     AC_REQUIRE([AC_PROG_CC])
     AC_REQUIRE([gt_LOCALE_FR])
     AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -27,14 +29,35 @@ AC_DEFUN([gl_FUNC_WCTOB],
         dnl is present.
 changequote(,)dnl
         case "$host_os" in
-            # Guess no on Solaris <= 9.
-          solaris2.[1-9] | solaris2.[1-9].*)
+            # Guess no on Solaris <= 9 and Cygwin.
+          solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
             gl_cv_func_wctob_works="guessing no" ;;
             # Guess yes otherwise.
           *) gl_cv_func_wctob_works="guessing yes" ;;
         esac
 changequote([,])dnl
-        if test $LOCALE_FR != none; then
+        case "$host_os" in
+          cygwin*)
+            AC_TRY_RUN([
+#include <locale.h>
+#include <wchar.h>
+
+register long global __asm__ ("%ebx");
+
+int main ()
+{
+  setlocale (LC_ALL, "en_US.UTF-8");
+
+  global = 0x12345678;
+  if (wctob (0x00FC) != -1)
+    return 1;
+  if (global != 0x12345678)
+    return 2;
+  return 0;
+}], [:], [gl_cv_func_wctob_works=no], [:])
+            ;;
+        esac
+        if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; 
then
           AC_TRY_RUN([
 #include <locale.h>
 #include <string.h>
diff --git a/gl/stdio-write.c b/gl/stdio-write.c
index f7da9e4..a6a0eb1 100644
--- a/gl/stdio-write.c
+++ b/gl/stdio-write.c
@@ -63,7 +63,6 @@
     }
 
 #  if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
-#   if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
 int
 printf (const char *format, ...)
 {
@@ -76,7 +75,6 @@ printf (const char *format, ...)
 
   return retval;
 }
-#   endif
 #  endif
 
 #  if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
index dcb8ee5..c43848e 100644
--- a/gl/stdio.in.h
+++ b/gl/stdio.in.h
@@ -63,6 +63,10 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Macros for stringification.  */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
 
 #if @GNULIB_DPRINTF@
 # if @REPLACE_DPRINTF@
@@ -640,16 +644,26 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms 
- "
 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
@GNULIB_STDIO_H_SIGPIPE@)
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  if defined __GNUC__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 /* Don't break __attribute__((format(printf,M,N))).  */
-#   define printf __printf__
-#  endif
-#  define GNULIB_overrides_printf 1
+#    define printf __printf__
+#   endif
 _GL_FUNCDECL_RPL_1 (__printf__, int,
                     (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                     __attribute__ ((__format__ (__printf__, 1, 2)))
                     _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+#  else
+_GL_FUNCDECL_RPL (printf, int,
+                  (const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 1, 2)))
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, printf, int, (const char *format, ...));
+#  endif
+#  define GNULIB_overrides_printf 1
 # else
 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 # endif
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 6a347cd..7914f22 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -86,7 +86,7 @@
 #endif
 
 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
-     || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
+     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 #endif
@@ -1016,6 +1016,40 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
 #endif
 
 
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+   Return the number of bytes written if successful, otherwise
+   set errno and return -1.  0 indicates nothing written.  See the
+   POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
+# if @REPLACE_PWRITE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pwrite rpl_pwrite
+#  endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+#  if address@hidden@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+                 "use gnulib module pwrite for portability");
+# endif
+#endif
+
+
 #if @GNULIB_READLINK@
 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
    bytes of it into BUF.  Return the number of bytes placed into BUF if
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 723e05d..e618901 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -2889,8 +2889,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       length += n;
                     }
                 }
-              }
 # endif
+              }
 #endif
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) 
&& !defined IN_LIBINTL
             else if ((dp->conversion == 'a' || dp->conversion == 'A')
@@ -5498,6 +5498,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     length += count;
                     break;
                   }
+#undef pad_ourselves
+#undef prec_ourselves
               }
           }
       }
diff --git a/gl/verify.h b/gl/verify.h
index bcd3f5a..4ad780c 100644
--- a/gl/verify.h
+++ b/gl/verify.h
@@ -69,13 +69,14 @@
      if the entity names are not disambiguated.  A workaround is to
      attach the current line number to the entity name:
 
-       #define GL_CONCAT0(x, y) x##y
-       #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
-       extern struct {...} * GL_CONCAT(dummy,__LINE__);
+       #define _GL_CONCAT0(x, y) x##y
+       #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+       extern struct {...} * _GL_CONCAT (dummy, __LINE__);
 
      But this has the problem that two invocations of verify from
      within the same macro would collide, since the __LINE__ value
-     would be the same for both invocations.
+     would be the same for both invocations.  (The GCC __COUNTER__
+     macro solves this problem, but is not portable.)
 
      A solution is to use the sizeof operator.  It yields a number,
      getting rid of the identity of the type.  Declarations like
@@ -103,20 +104,41 @@
 
        extern int (*dummy (void)) [sizeof (struct {...})];
 
+   * GCC warns about duplicate declarations of the dummy function if
+     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     __COUNTER__ macro that can let us generate unique identifiers for
+     each dummy function, to suppress this warning.
+
    * This implementation exploits the fact that GCC does not warn about
      the last declaration mentioned above.  If a future version of GCC
      introduces a warning for this, the problem could be worked around
-     by using code specialized to GCC, e.g.,:
+     by using code specialized to GCC, just as __COUNTER__ is already
+     being used if available.
 
        #if 4 <= __GNUC__
-       # define verify(R) \
-           extern int (* verify_function__ (void)) \
-                      [__builtin_constant_p (R) && (R) ? 1 : -1]
+       # define verify(R) [another version to keep GCC happy]
        #endif
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
+/* Concatenate two preprocessor tokens.  */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+   use it.  Use __COUNTER__ if it works, falling back on __LINE__
+   otherwise.  __LINE__ isn't perfect, but it's better than a
+   constant.  */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+#  define _GL_COUNTER __COUNTER__
+# else
+#  define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+   possible.  */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
 
 /* Verify requirement R at compile-time, as an integer constant expression.
    Return 1.  */
@@ -135,6 +157,7 @@ template <int w>
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# define verify(R) \
+    extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
 
 #endif
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index dd41d35..88d47db 100644
--- a/gl/wchar.in.h
+++ b/gl/wchar.in.h
@@ -407,7 +407,7 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
-#  if !defined wcwidth && address@hidden@
+#  if address@hidden@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
 #  endif
diff --git a/gltests/Makefile.am b/gltests/Makefile.am
index 6e70be3..b324b79 100644
--- a/gltests/Makefile.am
+++ b/gltests/Makefile.am
@@ -933,6 +933,15 @@ EXTRA_DIST += test-vc-list-files-git.sh 
test-vc-list-files-cvs.sh init.sh
 
 ## end   gnulib module vc-list-files-tests
 
+## begin gnulib module verify-tests
+
+TESTS_ENVIRONMENT += MAKE='$(MAKE)'
+TESTS += test-verify test-verify.sh
+check_PROGRAMS += test-verify
+EXTRA_DIST += test-verify.c test-verify.sh init.sh
+
+## end   gnulib module verify-tests
+
 ## begin gnulib module version-etc-fsf
 
 libtests_a_SOURCES += version-etc-fsf.c
diff --git a/gltests/init.sh b/gltests/init.sh
index 512e876..e23aa54 100644
--- a/gltests/init.sh
+++ b/gltests/init.sh
@@ -21,11 +21,16 @@
 # The typical skeleton of a test looks like this:
 #
 #   #!/bin/sh
-#   : ${srcdir=.}
-#   . "$srcdir/init.sh"; path_prepend_ .
+#   . "${srcdir=.}/init.sh"; path_prepend_ .
 #   Execute some commands.
 #   Note that these commands are executed in a subdirectory, therefore you
 #   need to prepend "../" to relative filenames in the build directory.
+#   Note that the "path_prepend_ ." is useful only if the body of your
+#   test invokes programs residing in the initial directory.
+#   For example, if the programs you want to test are in src/, and this test
+#   script is named tests/test-1, then you would use "path_prepend_ ../src",
+#   or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
+#   to all tests via automake's TESTS_ENVIRONMENT.
 #   Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
 #   Use the skip_ and fail_ functions to print a diagnostic and then exit
 #   with the corresponding exit code.
@@ -58,37 +63,61 @@
 # - hyphen-containing alias names
 # - we prefer to use ${var#...} substitution, rather than having
 #   to work around lack of support for that feature.
-# The following code attempts to find a shell with support for these features
-# and re-exec's it.  If not, it skips the current test.
+# The following code attempts to find a shell with support for these features.
+# If the current shell passes the test, we're done.  Otherwise, test other
+# shells until we find one that passes.  If one is found, re-exec it.
+# If no acceptable shell is found, skip the current test.
+#
+# Use "9" to indicate success (rather than 0), in case some shell acts
+# like Solaris 10's /bin/sh but exits successfully instead of with status 2.
 
 gl_shell_test_script_='
 test $(echo y) = y || exit 1
-test -z "$EXEEXT" && exit 0
+test -z "$EXEEXT" && exit 9
 shopt -s expand_aliases
 alias a-b="echo zoo"
 v=abx
      test ${v%x} = ab \
   && test ${v#a} = bx \
-  && test $(a-b) = zoo
+  && test $(a-b) = zoo \
+  && exit 9
 '
 
 if test "x$1" = "x--no-reexec"; then
   shift
 else
-  for re_shell_ in "${CONFIG_SHELL:-no_shell}" /bin/sh bash dash zsh pdksh fail
-  do
-    test "$re_shell_" = no_shell && continue
-    test "$re_shell_" = fail && skip_ failed to find an adequate shell
-    if "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null; then
-      exec "$re_shell_" "$0" --no-reexec "$@"
-      echo "$ME_: exec failed" 1>&2
-      exit 127
-    fi
-  done
+  # 'eval'ing the above code makes Solaris 10's /bin/sh exit with $? set to 2.
+  # It does not evaluate any of the code after the "unexpected" `('.  Thus,
+  # we must run it in a subshell.
+  ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
+  if test $? = 9; then
+    : # The current shell is adequate.  No re-exec required.
+  else
+    # Search for a shell that meets our requirements.
+    for re_shell_ in "${CONFIG_SHELL:-no_shell}" /bin/sh bash dash zsh pdksh 
fail
+    do
+      test "$re_shell_" = no_shell && continue
+      test "$re_shell_" = fail && skip_ failed to find an adequate shell
+      "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
+      if test $? = 9; then
+        # Found an acceptable shell.
+        exec "$re_shell_" "$0" --no-reexec "$@"
+        echo "$ME_: exec failed" 1>&2
+        exit 127
+      fi
+    done
+  fi
 fi
 
 test -n "$EXEEXT" && shopt -s expand_aliases
 
+# Enable glibc's malloc-perturbing option.
+# This is cheap and useful for exposing code that depends on the fact that
+# malloc-related functions often return memory that is mostly zeroed.
+# If you have the time and cycles, use valgrind to do an even better job.
+: ${MALLOC_PERTURB_=87}
+export MALLOC_PERTURB_
+
 # We use a trap below for cleanup.  This requires us to go through
 # hoops to get the right exit status transported through the handler.
 # So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
diff --git a/gltests/test-lseek.sh b/gltests/test-lseek.sh
index 576008c..47237b5 100755
--- a/gltests/test-lseek.sh
+++ b/gltests/test-lseek.sh
@@ -8,8 +8,8 @@ tmpfiles=t-lseek.tmp
 ./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1
 
 # pipes
-: | { ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; } | :
-test "x`cat t-lseek.tmp`" = x0 || exit 1
+echo hi | { ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; cat > /dev/null; } 
| cat
+test "`cat t-lseek.tmp`" = "0" || exit 1
 
 # closed descriptors
 ./test-lseek${EXEEXT} 2 <&- >&- || exit 1
diff --git a/gltests/test-verify.c b/gltests/test-verify.c
new file mode 100644
index 0000000..47eae2b
--- /dev/null
+++ b/gltests/test-verify.c
@@ -0,0 +1,68 @@
+/* Test the "verify" module.
+
+   Copyright (C) 2005, 2009, 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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible.  */
+
+#include <config.h>
+
+#include "verify.h"
+
+#ifndef EXP_FAIL
+# define EXP_FAIL 0
+#endif
+
+int x;
+enum { a, b, c };
+
+#if EXP_FAIL == 1
+verify (x >= 0);                  /* should give ERROR: non-constant 
expression */
+#endif
+verify (c == 2);                  /* should be ok */
+#if EXP_FAIL == 2
+verify (1 + 1 == 3);              /* should give ERROR */
+#endif
+verify (1 == 1); verify (1 == 1); /* should be ok */
+
+enum
+{
+  item = verify_true (1 == 1) * 0 + 17 /* should be ok */
+};
+
+int function (int n)
+{
+#if EXP_FAIL == 3
+  verify (n >= 0);                  /* should give ERROR: non-constant 
expression */
+#endif
+  verify (c == 2);                  /* should be ok */
+#if EXP_FAIL == 4
+  verify (1 + 1 == 3);              /* should give ERROR */
+#endif
+  verify (1 == 1); verify (1 == 1); /* should be ok */
+
+  if (n)
+    return ((void) verify_true (1 == 1), verify_true (1 == 1) + 7); /* should 
be ok */
+#if EXP_FAIL == 5
+  return (verify_true (1 == 2), 5); /* should give ERROR */
+#endif
+  return 0;
+}
+
+int
+main (void)
+{
+  return !(function (0) == 0 && function (1) == 8);
+}
diff --git a/gltests/test-verify.sh b/gltests/test-verify.sh
new file mode 100755
index 0000000..3e76761
--- /dev/null
+++ b/gltests/test-verify.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+. "${srcdir=.}/init.sh"
+
+# We are not interested in triggering bugs in the compilers and tools
+# (such as gcc 4.3.1 on openSUSE 11.0).
+unset MALLOC_PERTURB_
+
+# Rather than figure out how to invoke the compiler with the right
+# include path ourselves, we let make do it:
+(cd "$initial_cwd_" && rm -f test-verify.o \
+    && $MAKE test-verify.o >/dev/null 2>&1) \
+  || skip_ "cannot compile error-free"
+
+# Now, prove that we encounter all expected compilation failures:
+: >out
+: >err
+for i in 1 2 3 4 5; do
+  (cd "$initial_cwd_"
+   rm -f test-verify.o
+   $MAKE CFLAGS=-DEXP_FAIL=$i test-verify.o) >>out 2>>err \
+  && { warn_ "compiler didn't detect verification failure $i"; fail=1; }
+done
+
+Exit $fail
diff --git a/gltests/test-xalloc-die.sh b/gltests/test-xalloc-die.sh
index 80d6208..375cd14 100755
--- a/gltests/test-xalloc-die.sh
+++ b/gltests/test-xalloc-die.sh
@@ -18,7 +18,7 @@
 
 . "${srcdir=.}/init.sh"; path_prepend_ .
 
-test-xalloc-die${EXEEXT} 2> err > out
+test-xalloc-die${EXEEXT} > out 2> err
 case $? in
   1) ;;
   *) Exit 1;;
diff --git a/gltests/wctob.c b/gltests/wctob.c
index 1d1cc7b..8a66ec9 100644
--- a/gltests/wctob.c
+++ b/gltests/wctob.c
@@ -1,5 +1,5 @@
 /* Convert wide character to unibyte character.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -30,8 +30,9 @@ wctob (wint_t wc)
 
   if (!(MB_CUR_MAX <= sizeof (buf)))
     abort ();
-  if (wctomb (buf, wc) == 1)
-    return (unsigned char) buf[0];
-  else
-    return EOF;
+  /* Handle the case where WEOF is a value that does not fit in a wchar_t.  */
+  if (wc == (wchar_t)wc)
+    if (wctomb (buf, (wchar_t)wc) == 1)
+      return (unsigned char) buf[0];
+  return EOF;
 }
diff --git a/lib/build-aux/c++defs.h b/lib/build-aux/c++defs.h
index 7d71089..0c2fad7 100644
--- a/lib/build-aux/c++defs.h
+++ b/lib/build-aux/c++defs.h
@@ -221,10 +221,20 @@
    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
 # define _GL_CXXALIASWARN_1(func,namespace) \
    _GL_CXXALIASWARN_2 (func, namespace)
-# define _GL_CXXALIASWARN_2(func,namespace) \
-   _GL_WARN_ON_USE (func, \
-                    "The symbol ::" #func " refers to the system function. " \
-                    "Use " #namespace "::" #func " instead.")
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+    _GL_WARN_ON_USE (func, \
+                     "The symbol ::" #func " refers to the system function. " \
+                     "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
 #else
 # define _GL_CXXALIASWARN(func) \
     _GL_EXTERN_C int _gl_cxxalias_dummy
@@ -239,10 +249,20 @@
                         GNULIB_NAMESPACE)
 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) 
\
    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) 
\
-   _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
-                        "The symbol ::" #func " refers to the system function. 
" \
-                        "Use " #namespace "::" #func " instead.")
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define 
_GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+                         "The symbol ::" #func " refers to the system 
function. " \
+                         "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define 
_GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define 
_GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
 #else
 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
     _GL_EXTERN_C int _gl_cxxalias_dummy
diff --git a/lib/build-aux/gendocs.sh b/lib/build-aux/gendocs.sh
index 67d5b52..8cab8f6 100755
--- a/lib/build-aux/gendocs.sh
+++ b/lib/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
 # 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-02-13.20
+scriptversion=2010-05-04.09
 
 # Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 # Free Software Foundation, Inc.
@@ -149,8 +149,16 @@ while test $# -gt 0; do
   shift
 done
 
+# For most of the following, the base name is just $PACKAGE
+base=$PACKAGE
+
 if test -n "$srcfile"; then
-  :
+  # but here, we use the basename of $srcfile
+  base=`basename "$srcfile"`
+  case $base in
+    *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;;
+  esac
+  PACKAGE=$base
 elif test -s "$srcdir/$PACKAGE.texinfo"; then
   srcfile=$srcdir/$PACKAGE.texinfo
 elif test -s "$srcdir/$PACKAGE.texi"; then
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index 9b25db6..1217b5f 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -522,6 +522,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
              -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -763,6 +764,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
              -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
              -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+             -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
              -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
              -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
@@ -797,6 +799,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
              -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
              -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
@@ -824,6 +827,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
diff --git a/lib/gl/m4/asm-underscore.m4 b/lib/gl/m4/asm-underscore.m4
new file mode 100644
index 0000000..1736cc4
--- /dev/null
+++ b/lib/gl/m4/asm-underscore.m4
@@ -0,0 +1,48 @@
+# asm-underscore.m4 serial 1
+dnl Copyright (C) 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.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+  dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+  dnl 1. It works only for GCC.
+  dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+  AC_CACHE_CHECK(
+    [whether C symbols are prefixed with underscore at the linker level],
+    [gl_cv_prog_as_underscore],
+    [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
+     if grep _foo conftest.s >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+    ])
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+  AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+    [Define to the prefix of C symbols at the assembler and linker level,
+     either an underscore or empty.])
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+  AC_SUBST([ASM_SYMBOL_PREFIX])
+])
diff --git a/gl/m4/fcntl-o.m4 b/lib/gl/m4/fcntl-o.m4
similarity index 100%
copy from gl/m4/fcntl-o.m4
copy to lib/gl/m4/fcntl-o.m4
diff --git a/lib/gl/m4/gettext.m4 b/lib/gl/m4/gettext.m4
index d6dc3fe..f84e6a5 100644
--- a/lib/gl/m4/gettext.m4
+++ b/lib/gl/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 62 (gettext-0.18)
+# gettext.m4 serial 63 (gettext-0.18)
 dnl Copyright (C) 1995-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,7 +15,7 @@ dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <address@hidden>, 1995-2000.
-dnl   Bruno Haible <address@hidden>, 2000-2006.
+dnl   Bruno Haible <address@hidden>, 2000-2006, 2008-2010.
 
 dnl Macro to add for using GNU gettext.
 
@@ -60,6 +60,8 @@ AC_DEFUN([AM_GNU_GETTEXT],
   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , 
[ifelse([$1], [use-libtool], ,
     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
 ])])])])])
+  ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+    [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] 
argument is deprecated.])])
   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], 
[need-formatstring-macros], ,
     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 ])])])])
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 27dc56d..136d6d0 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -100,6 +100,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module vasprintf-tests:
   # Code from module vc-list-files:
   # Code from module verify:
+  # Code from module verify-tests:
   # Code from module warn-on-use:
   # Code from module wchar:
   # Code from module wchar-tests:
@@ -163,7 +164,7 @@ AC_DEFUN([gl_INIT],
   gl_STDIO_MODULE_INDICATOR([getline])
   # Code from module gettext:
   dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
-  AM_GNU_GETTEXT_VERSION([0.17])
+  AM_GNU_GETTEXT_VERSION([0.18])
   # Code from module gettext-h:
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
@@ -449,10 +450,12 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/xsize.h
   m4/00gnulib.m4
   m4/alloca.m4
+  m4/asm-underscore.m4
   m4/base64.m4
   m4/codeset.m4
   m4/errno_h.m4
   m4/extensions.m4
+  m4/fcntl-o.m4
   m4/float_h.m4
   m4/gc-hmac-md5.m4
   m4/gc-hmac-sha1.m4
@@ -524,6 +527,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/wchar_t.m4
   m4/wint_t.m4
   m4/xsize.m4
+  tests/init.sh
   tests/macros.h
   tests/signature.h
   tests/test-alloca-opt.c
@@ -550,6 +554,8 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-unistd.c
   tests/test-vasnprintf.c
   tests/test-vasprintf.c
+  tests/test-verify.c
+  tests/test-verify.sh
   tests/test-wchar.c
   tests/zerosize-ptr.h
   tests=lib/dummy.c
diff --git a/lib/gl/m4/iconv.m4 b/lib/gl/m4/iconv.m4
index f46ff14..4c68472 100644
--- a/lib/gl/m4/iconv.m4
+++ b/lib/gl/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 9 (gettext-0.18)
+# iconv.m4 serial 10 (gettext-0.18.1)
 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,
@@ -170,7 +170,10 @@ int main ()
   AC_SUBST([LTLIBICONV])
 ])
 
-AC_DEFUN([AM_ICONV],
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+m4_version_prereq([2.64],[AC_DEFUN_ONCE],[AC_DEFUN])([AM_ICONV],
 [
   AM_ICONV_LINK
   if test "$am_cv_func_iconv" = yes; then
diff --git a/lib/gl/m4/intl.m4 b/lib/gl/m4/intl.m4
index 5e17fea..335b23c 100644
--- a/lib/gl/m4/intl.m4
+++ b/lib/gl/m4/intl.m4
@@ -1,5 +1,5 @@
-# intl.m4 serial 8 (gettext-0.17)
-dnl Copyright (C) 1995-2007, 2009-2010 Free Software Foundation, Inc.
+# intl.m4 serial 17 (gettext-0.18)
+dnl Copyright (C) 1995-2009 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,9 +15,9 @@ dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <address@hidden>, 1995-2000.
-dnl   Bruno Haible <address@hidden>, 2000-2006.
+dnl   Bruno Haible <address@hidden>, 2000-2009.
 
-AC_PREREQ(2.52)
+AC_PREREQ([2.52])
 
 dnl Checks for all prerequisites of the intl subdirectory,
 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@@ -40,14 +40,24 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_REQUIRE([gt_PRINTF_POSIX])
   AC_REQUIRE([gl_GLIBC21])dnl
   AC_REQUIRE([gl_XSIZE])dnl
+  AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
   AC_REQUIRE([gt_INTL_MACOSX])dnl
 
+  dnl Support for automake's --enable-silent-rules.
+  case "$enable_silent_rules" in
+    yes) INTL_DEFAULT_VERBOSITY=0;;
+    no)  INTL_DEFAULT_VERBOSITY=1;;
+    *)   INTL_DEFAULT_VERBOSITY=1;;
+  esac
+  AC_SUBST([INTL_DEFAULT_VERBOSITY])
+
   AC_CHECK_TYPE([ptrdiff_t], ,
     [AC_DEFINE([ptrdiff_t], [long],
        [Define as the type of the result of subtracting two pointers, if the 
system doesn't define it.])
     ])
   AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
-  AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
+  AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
+    snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
 
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
@@ -78,6 +88,12 @@ AC_DEFUN([AM_INTL_SUBDIR],
     HAVE_SNPRINTF=0
   fi
   AC_SUBST([HAVE_SNPRINTF])
+  if test "$ac_cv_func_newlocale" = yes; then
+    HAVE_NEWLOCALE=1
+  else
+    HAVE_NEWLOCALE=0
+  fi
+  AC_SUBST([HAVE_NEWLOCALE])
   if test "$ac_cv_func_wprintf" = yes; then
     HAVE_WPRINTF=1
   else
@@ -146,22 +162,31 @@ AC_DEFUN([AM_INTL_SUBDIR],
 #define __libc_lock_lock_recursive                gl_recursive_lock_lock
 #define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
 #define glthread_in_use  libintl_thread_in_use
-#define glthread_lock_init     libintl_lock_init
-#define glthread_lock_lock     libintl_lock_lock
-#define glthread_lock_unlock   libintl_lock_unlock
-#define glthread_lock_destroy  libintl_lock_destroy
-#define glthread_rwlock_init     libintl_rwlock_init
-#define glthread_rwlock_rdlock   libintl_rwlock_rdlock
-#define glthread_rwlock_wrlock   libintl_rwlock_wrlock
-#define glthread_rwlock_unlock   libintl_rwlock_unlock
-#define glthread_rwlock_destroy  libintl_rwlock_destroy
-#define glthread_recursive_lock_init     libintl_recursive_lock_init
-#define glthread_recursive_lock_lock     libintl_recursive_lock_lock
-#define glthread_recursive_lock_unlock   libintl_recursive_lock_unlock
-#define glthread_recursive_lock_destroy  libintl_recursive_lock_destroy
-#define glthread_once                 libintl_once
-#define glthread_once_call            libintl_once_call
+#define glthread_lock_init_func     libintl_lock_init_func
+#define glthread_lock_lock_func     libintl_lock_lock_func
+#define glthread_lock_unlock_func   libintl_lock_unlock_func
+#define glthread_lock_destroy_func  libintl_lock_destroy_func
+#define glthread_rwlock_init_multithreaded     
libintl_rwlock_init_multithreaded
+#define glthread_rwlock_init_func              libintl_rwlock_init_func
+#define glthread_rwlock_rdlock_multithreaded   
libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_rdlock_func            libintl_rwlock_rdlock_func
+#define glthread_rwlock_wrlock_multithreaded   
libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_wrlock_func            libintl_rwlock_wrlock_func
+#define glthread_rwlock_unlock_multithreaded   
libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_unlock_func            libintl_rwlock_unlock_func
+#define glthread_rwlock_destroy_multithreaded  
libintl_rwlock_destroy_multithreaded
+#define glthread_rwlock_destroy_func           libintl_rwlock_destroy_func
+#define glthread_recursive_lock_init_multithreaded     
libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_init_func              
libintl_recursive_lock_init_func
+#define glthread_recursive_lock_lock_multithreaded     
libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_lock_func              
libintl_recursive_lock_lock_func
+#define glthread_recursive_lock_unlock_multithreaded   
libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_unlock_func            
libintl_recursive_lock_unlock_func
+#define glthread_recursive_lock_destroy_multithreaded  
libintl_recursive_lock_destroy_multithreaded
+#define glthread_recursive_lock_destroy_func           
libintl_recursive_lock_destroy_func
+#define glthread_once_func            libintl_once_func
 #define glthread_once_singlethreaded  libintl_once_singlethreaded
+#define glthread_once_multithreaded   libintl_once_multithreaded
 ])
 ])
 
@@ -198,40 +223,24 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
   AC_TRY_LINK(
     [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; 
}],
     [],
-    [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
+    [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
        [Define to 1 if the compiler understands __builtin_expect.])])
 
   AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
   AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
-    stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
-    argz_next __fsetlocking])
+    stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
+    argz_stringify argz_next __fsetlocking])
 
   dnl Use the *_unlocked functions only if they are declared.
   dnl (because some of them were defined without being declared in Solaris
   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
   dnl on Solaris 2.5.1 to run on Solaris 2.6).
   dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
-  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
-  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
+  gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
 
   AM_ICONV
 
-  dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
-  dnl and a _NL_LOCALE_NAME macro always.
-  AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
-    [AC_TRY_LINK([#include <langinfo.h>
-#include <locale.h>],
-      [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
-       return !cs;
-      ],
-      gt_cv_nl_locale_name=yes,
-      gt_cv_nl_locale_name=no)
-    ])
-  if test $gt_cv_nl_locale_name = yes; then
-    AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
-      [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro 
if _GNU_SOURCE is defined.])
-  fi
-
   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
   dnl because plural.y uses bison specific features. It requires at least
   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
@@ -269,7 +278,7 @@ dnl gt_CHECK_DECL(FUNC, INCLUDES)
 dnl Check whether a function is declared.
 AC_DEFUN([gt_CHECK_DECL],
 [
-  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+  AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
     [AC_TRY_COMPILE([$2], [
 #ifndef $1
   char *p = (char *) $1;
diff --git a/lib/gl/m4/po.m4 b/lib/gl/m4/po.m4
index 960efe1..47f36a4 100644
--- a/lib/gl/m4/po.m4
+++ b/lib/gl/m4/po.m4
@@ -29,7 +29,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
 
   dnl Release version of the gettext macros. This is used to ensure that
   dnl the gettext macros and po/Makefile.in.in are in sync.
-  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
 
   dnl Perform the following tests also if --disable-nls has been given,
   dnl because they are needed for "make dist" to work.
diff --git a/lib/gl/m4/stdio_h.m4 b/lib/gl/m4/stdio_h.m4
index 1d1d95e..f5650cd 100644
--- a/lib/gl/m4/stdio_h.m4
+++ b/lib/gl/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 30
+# stdio_h.m4 serial 31
 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,
@@ -8,6 +8,7 @@ AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
   gl_CHECK_NEXT_HEADERS([stdio.h])
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
diff --git a/lib/gl/m4/unistd_h.m4 b/lib/gl/m4/unistd_h.m4
index b26d0a9..48d06c7 100644
--- a/lib/gl/m4/unistd_h.m4
+++ b/lib/gl/m4/unistd_h.m4
@@ -38,8 +38,9 @@ AC_DEFUN([gl_UNISTD_H],
     ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
     fsync ftruncate getcwd getdomainname getdtablesize getgroups
     gethostname getlogin getlogin_r getpagesize getusershell setusershell
-    endusershell lchown link linkat lseek pipe2 pread readlink readlinkat
-    rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep])
+    endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+    readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+    usleep])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -79,6 +80,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
   GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
   GNULIB_PREAD=0;            AC_SUBST([GNULIB_PREAD])
+  GNULIB_PWRITE=0;           AC_SUBST([GNULIB_PWRITE])
   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
   GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
   GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
@@ -113,6 +115,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
   HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
   HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
+  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
   HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
@@ -140,6 +143,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
   REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
+  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
diff --git a/lib/gl/stdio-write.c b/lib/gl/stdio-write.c
index 866047c..2db98c3 100644
--- a/lib/gl/stdio-write.c
+++ b/lib/gl/stdio-write.c
@@ -63,7 +63,6 @@
     }
 
 #  if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
-#   if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
 int
 printf (const char *format, ...)
 {
@@ -76,7 +75,6 @@ printf (const char *format, ...)
 
   return retval;
 }
-#   endif
 #  endif
 
 #  if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
diff --git a/lib/gl/stdio.in.h b/lib/gl/stdio.in.h
index 9cef601..fcca1b3 100644
--- a/lib/gl/stdio.in.h
+++ b/lib/gl/stdio.in.h
@@ -63,6 +63,10 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Macros for stringification.  */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
 
 #if @GNULIB_DPRINTF@
 # if @REPLACE_DPRINTF@
@@ -640,16 +644,26 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms 
- "
 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
@GNULIB_STDIO_H_SIGPIPE@)
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  if defined __GNUC__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 /* Don't break __attribute__((format(printf,M,N))).  */
-#   define printf __printf__
-#  endif
-#  define GNULIB_overrides_printf 1
+#    define printf __printf__
+#   endif
 _GL_FUNCDECL_RPL_1 (__printf__, int,
                     (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                     __attribute__ ((__format__ (__printf__, 1, 2)))
                     _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+#  else
+_GL_FUNCDECL_RPL (printf, int,
+                  (const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 1, 2)))
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, printf, int, (const char *format, ...));
+#  endif
+#  define GNULIB_overrides_printf 1
 # else
 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 # endif
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index da6f086..29f7fba 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -86,7 +86,7 @@
 #endif
 
 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
-     || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
+     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 #endif
@@ -1016,6 +1016,40 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
 #endif
 
 
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+   Return the number of bytes written if successful, otherwise
+   set errno and return -1.  0 indicates nothing written.  See the
+   POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
+# if @REPLACE_PWRITE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pwrite rpl_pwrite
+#  endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+#  if address@hidden@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+                 "use gnulib module pwrite for portability");
+# endif
+#endif
+
+
 #if @GNULIB_READLINK@
 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
    bytes of it into BUF.  Return the number of bytes placed into BUF if
diff --git a/lib/gl/vasnprintf.c b/lib/gl/vasnprintf.c
index 41967fd..54cda0e 100644
--- a/lib/gl/vasnprintf.c
+++ b/lib/gl/vasnprintf.c
@@ -2889,8 +2889,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       length += n;
                     }
                 }
-              }
 # endif
+              }
 #endif
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) 
&& !defined IN_LIBINTL
             else if ((dp->conversion == 'a' || dp->conversion == 'A')
@@ -5498,6 +5498,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     length += count;
                     break;
                   }
+#undef pad_ourselves
+#undef prec_ourselves
               }
           }
       }
diff --git a/lib/gl/wchar.in.h b/lib/gl/wchar.in.h
index 3369efa..ed582e5 100644
--- a/lib/gl/wchar.in.h
+++ b/lib/gl/wchar.in.h
@@ -407,7 +407,7 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
-#  if !defined wcwidth && address@hidden@
+#  if address@hidden@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
 #  endif
diff --git a/lib/gltests/Makefile.am b/lib/gltests/Makefile.am
index e24f9ae..d78a18b 100644
--- a/lib/gltests/Makefile.am
+++ b/lib/gltests/Makefile.am
@@ -316,6 +316,15 @@ libtests_a_SOURCES += verify.h
 
 ## end   gnulib module verify
 
+## begin gnulib module verify-tests
+
+TESTS_ENVIRONMENT += MAKE='$(MAKE)'
+TESTS += test-verify test-verify.sh
+check_PROGRAMS += test-verify
+EXTRA_DIST += test-verify.c test-verify.sh init.sh
+
+## end   gnulib module verify-tests
+
 ## begin gnulib module warn-on-use
 
 BUILT_SOURCES += warn-on-use.h
diff --git a/gltests/init.sh b/lib/gltests/init.sh
similarity index 83%
copy from gltests/init.sh
copy to lib/gltests/init.sh
index 512e876..e23aa54 100644
--- a/gltests/init.sh
+++ b/lib/gltests/init.sh
@@ -21,11 +21,16 @@
 # The typical skeleton of a test looks like this:
 #
 #   #!/bin/sh
-#   : ${srcdir=.}
-#   . "$srcdir/init.sh"; path_prepend_ .
+#   . "${srcdir=.}/init.sh"; path_prepend_ .
 #   Execute some commands.
 #   Note that these commands are executed in a subdirectory, therefore you
 #   need to prepend "../" to relative filenames in the build directory.
+#   Note that the "path_prepend_ ." is useful only if the body of your
+#   test invokes programs residing in the initial directory.
+#   For example, if the programs you want to test are in src/, and this test
+#   script is named tests/test-1, then you would use "path_prepend_ ../src",
+#   or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
+#   to all tests via automake's TESTS_ENVIRONMENT.
 #   Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
 #   Use the skip_ and fail_ functions to print a diagnostic and then exit
 #   with the corresponding exit code.
@@ -58,37 +63,61 @@
 # - hyphen-containing alias names
 # - we prefer to use ${var#...} substitution, rather than having
 #   to work around lack of support for that feature.
-# The following code attempts to find a shell with support for these features
-# and re-exec's it.  If not, it skips the current test.
+# The following code attempts to find a shell with support for these features.
+# If the current shell passes the test, we're done.  Otherwise, test other
+# shells until we find one that passes.  If one is found, re-exec it.
+# If no acceptable shell is found, skip the current test.
+#
+# Use "9" to indicate success (rather than 0), in case some shell acts
+# like Solaris 10's /bin/sh but exits successfully instead of with status 2.
 
 gl_shell_test_script_='
 test $(echo y) = y || exit 1
-test -z "$EXEEXT" && exit 0
+test -z "$EXEEXT" && exit 9
 shopt -s expand_aliases
 alias a-b="echo zoo"
 v=abx
      test ${v%x} = ab \
   && test ${v#a} = bx \
-  && test $(a-b) = zoo
+  && test $(a-b) = zoo \
+  && exit 9
 '
 
 if test "x$1" = "x--no-reexec"; then
   shift
 else
-  for re_shell_ in "${CONFIG_SHELL:-no_shell}" /bin/sh bash dash zsh pdksh fail
-  do
-    test "$re_shell_" = no_shell && continue
-    test "$re_shell_" = fail && skip_ failed to find an adequate shell
-    if "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null; then
-      exec "$re_shell_" "$0" --no-reexec "$@"
-      echo "$ME_: exec failed" 1>&2
-      exit 127
-    fi
-  done
+  # 'eval'ing the above code makes Solaris 10's /bin/sh exit with $? set to 2.
+  # It does not evaluate any of the code after the "unexpected" `('.  Thus,
+  # we must run it in a subshell.
+  ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
+  if test $? = 9; then
+    : # The current shell is adequate.  No re-exec required.
+  else
+    # Search for a shell that meets our requirements.
+    for re_shell_ in "${CONFIG_SHELL:-no_shell}" /bin/sh bash dash zsh pdksh 
fail
+    do
+      test "$re_shell_" = no_shell && continue
+      test "$re_shell_" = fail && skip_ failed to find an adequate shell
+      "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
+      if test $? = 9; then
+        # Found an acceptable shell.
+        exec "$re_shell_" "$0" --no-reexec "$@"
+        echo "$ME_: exec failed" 1>&2
+        exit 127
+      fi
+    done
+  fi
 fi
 
 test -n "$EXEEXT" && shopt -s expand_aliases
 
+# Enable glibc's malloc-perturbing option.
+# This is cheap and useful for exposing code that depends on the fact that
+# malloc-related functions often return memory that is mostly zeroed.
+# If you have the time and cycles, use valgrind to do an even better job.
+: ${MALLOC_PERTURB_=87}
+export MALLOC_PERTURB_
+
 # We use a trap below for cleanup.  This requires us to go through
 # hoops to get the right exit status transported through the handler.
 # So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
diff --git a/lib/gltests/test-verify.c b/lib/gltests/test-verify.c
new file mode 100644
index 0000000..47eae2b
--- /dev/null
+++ b/lib/gltests/test-verify.c
@@ -0,0 +1,68 @@
+/* Test the "verify" module.
+
+   Copyright (C) 2005, 2009, 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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible.  */
+
+#include <config.h>
+
+#include "verify.h"
+
+#ifndef EXP_FAIL
+# define EXP_FAIL 0
+#endif
+
+int x;
+enum { a, b, c };
+
+#if EXP_FAIL == 1
+verify (x >= 0);                  /* should give ERROR: non-constant 
expression */
+#endif
+verify (c == 2);                  /* should be ok */
+#if EXP_FAIL == 2
+verify (1 + 1 == 3);              /* should give ERROR */
+#endif
+verify (1 == 1); verify (1 == 1); /* should be ok */
+
+enum
+{
+  item = verify_true (1 == 1) * 0 + 17 /* should be ok */
+};
+
+int function (int n)
+{
+#if EXP_FAIL == 3
+  verify (n >= 0);                  /* should give ERROR: non-constant 
expression */
+#endif
+  verify (c == 2);                  /* should be ok */
+#if EXP_FAIL == 4
+  verify (1 + 1 == 3);              /* should give ERROR */
+#endif
+  verify (1 == 1); verify (1 == 1); /* should be ok */
+
+  if (n)
+    return ((void) verify_true (1 == 1), verify_true (1 == 1) + 7); /* should 
be ok */
+#if EXP_FAIL == 5
+  return (verify_true (1 == 2), 5); /* should give ERROR */
+#endif
+  return 0;
+}
+
+int
+main (void)
+{
+  return !(function (0) == 0 && function (1) == 8);
+}
diff --git a/lib/gltests/test-verify.sh b/lib/gltests/test-verify.sh
new file mode 100755
index 0000000..3e76761
--- /dev/null
+++ b/lib/gltests/test-verify.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+. "${srcdir=.}/init.sh"
+
+# We are not interested in triggering bugs in the compilers and tools
+# (such as gcc 4.3.1 on openSUSE 11.0).
+unset MALLOC_PERTURB_
+
+# Rather than figure out how to invoke the compiler with the right
+# include path ourselves, we let make do it:
+(cd "$initial_cwd_" && rm -f test-verify.o \
+    && $MAKE test-verify.o >/dev/null 2>&1) \
+  || skip_ "cannot compile error-free"
+
+# Now, prove that we encounter all expected compilation failures:
+: >out
+: >err
+for i in 1 2 3 4 5; do
+  (cd "$initial_cwd_"
+   rm -f test-verify.o
+   $MAKE CFLAGS=-DEXP_FAIL=$i test-verify.o) >>out 2>>err \
+  && { warn_ "compiler didn't detect verification failure $i"; fail=1; }
+done
+
+Exit $fail
diff --git a/lib/gltests/verify.h b/lib/gltests/verify.h
index bcd3f5a..4ad780c 100644
--- a/lib/gltests/verify.h
+++ b/lib/gltests/verify.h
@@ -69,13 +69,14 @@
      if the entity names are not disambiguated.  A workaround is to
      attach the current line number to the entity name:
 
-       #define GL_CONCAT0(x, y) x##y
-       #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
-       extern struct {...} * GL_CONCAT(dummy,__LINE__);
+       #define _GL_CONCAT0(x, y) x##y
+       #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+       extern struct {...} * _GL_CONCAT (dummy, __LINE__);
 
      But this has the problem that two invocations of verify from
      within the same macro would collide, since the __LINE__ value
-     would be the same for both invocations.
+     would be the same for both invocations.  (The GCC __COUNTER__
+     macro solves this problem, but is not portable.)
 
      A solution is to use the sizeof operator.  It yields a number,
      getting rid of the identity of the type.  Declarations like
@@ -103,20 +104,41 @@
 
        extern int (*dummy (void)) [sizeof (struct {...})];
 
+   * GCC warns about duplicate declarations of the dummy function if
+     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     __COUNTER__ macro that can let us generate unique identifiers for
+     each dummy function, to suppress this warning.
+
    * This implementation exploits the fact that GCC does not warn about
      the last declaration mentioned above.  If a future version of GCC
      introduces a warning for this, the problem could be worked around
-     by using code specialized to GCC, e.g.,:
+     by using code specialized to GCC, just as __COUNTER__ is already
+     being used if available.
 
        #if 4 <= __GNUC__
-       # define verify(R) \
-           extern int (* verify_function__ (void)) \
-                      [__builtin_constant_p (R) && (R) ? 1 : -1]
+       # define verify(R) [another version to keep GCC happy]
        #endif
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
+/* Concatenate two preprocessor tokens.  */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+   use it.  Use __COUNTER__ if it works, falling back on __LINE__
+   otherwise.  __LINE__ isn't perfect, but it's better than a
+   constant.  */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+#  define _GL_COUNTER __COUNTER__
+# else
+#  define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+   possible.  */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
 
 /* Verify requirement R at compile-time, as an integer constant expression.
    Return 1.  */
@@ -135,6 +157,7 @@ template <int w>
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# define verify(R) \
+    extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
 
 #endif
diff --git a/lib/maint.mk b/lib/maint.mk
index 6389c38..3bcab0c 100644
--- a/lib/maint.mk
+++ b/lib/maint.mk
@@ -148,16 +148,6 @@ local-check :=                                             
                \
     $(filter-out $(local-checks-to-skip), $(local-checks-available)))
 
 syntax-check: $(local-check)
-#      @grep -nE '#  *include <(limits|std(def|arg|bool))\.h>'         \
-#          $$(find -type f -name '*.[chly]') &&                        \
-#        { echo '$(ME): found conditional include' 1>&2;               \
-#          exit 1; } || :
-
-#      grep -nE '^#  *include <(string|stdlib)\.h>'                    \
-#          $(srcdir)/{lib,src}/*.[chy] &&                              \
-#        { echo '$(ME): FIXME' 1>&2;                                   \
-#          exit 1; } || :
-# FIXME: don't allow `#include .strings\.h' anywhere
 
 # _sc_search_regexp
 #
@@ -554,6 +544,13 @@ sc_prohibit_signal_without_use:
        re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>'          \
          $(_sc_header_without_use)
 
+# Prohibit the inclusion of strings.h without a sensible use.
+# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
+sc_prohibit_strings_without_use:
+       @h='<strings.h>'                                                \
+       re='\<(strn?casecmp|ffs(ll)?)\>'                                \
+         $(_sc_header_without_use)
+
 # Get the list of symbol names with this:
 # perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
 _intprops_names =                                                      \
@@ -668,6 +665,44 @@ sc_prohibit_always_true_header_tests:
 '  with the corresponding gnulib module, they are always true'         \
          $(_sc_search_regexp)
 
+# ==================================================================
+gl_other_headers_ ?= \
+  intprops.h   \
+  openat.h     \
+  stat-macros.h
+
+# Perl -lne code to extract "significant" cpp-defined symbols from a
+# gnulib header file, eliminating a few common false-positives.
+gl_extract_significant_defines_ = \
+  /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\
+    && $$2 !~ /(?:rpl_|_used_without_)/\
+    && $$1 !~ /^(?:NSIG|ATTRIBUTE_NORETURN)$$/\
+    and print $$1
+
+# Create a list of regular expressions matching the names
+# of macros that are guaranteed to be defined by parts of gnulib.
+define def_sym_regex
+       gen_h=$(gl_generated_headers_);                                 \
+       (cd $(gnulib_dir)/lib;                                          \
+         for f in *.in.h $(gl_other_headers_); do                      \
+           perl -lne '$(gl_extract_significant_defines_)' $$f;         \
+         done;                                                         \
+       ) | sort -u                                                     \
+         | sed 's/^/^ *# *define /;s/$$/\\>/'
+endef
+
+# Don't define macros that we already get from gnulib header files.
+sc_prohibit_always-defined_macros:
+       @if test -d $(gnulib_dir); then                                 \
+         case $$(echo all: | grep -l -f - Makefile) in Makefile);; *)  \
+           echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
+         esac;                                                         \
+         $(def_sym_regex) | grep -f - $$($(VC_LIST_EXCEPT))            \
+           && { echo '$(ME): define the above via some gnulib .h file' \
+                 1>&2;  exit 1; } || :;                                \
+       fi
+# ==================================================================
+
 # Prohibit checked in backup files.
 sc_prohibit_backup_files:
        @$(VC_LIST) | grep '~$$' &&                             \
@@ -938,20 +973,22 @@ sc_copyright_check:
 # sets PATH correctly.  This is an inexpensive way to ensure that
 # the other init.sh-using tests also get it right.
 _hv_file ?= $(srcdir)/tests/help-version
-_hv_regex ?= ^ *\. [^ ]*/init\.sh
+_hv_regex_weak ?= ^ *\. .*/init\.sh"
+_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
 sc_cross_check_PATH_usage_in_tests:
        @if test -f $(_hv_file); then                                   \
-         if grep -l 'VERSION mismatch' $(_hv_file) >/dev/null          \
-             && grep -lE '$(_hv_regex)' $(_hv_file) >/dev/null; then   \
-           good=$$(grep -E '$(_hv_regex)' < $(_hv_file));              \
-           grep -LFx "$$good"                                          \
-                 $$(grep -lE '$(_hv_regex)' $$($(VC_LIST_EXCEPT)))     \
-               | grep . &&                                             \
-             { echo "$(ME): the above files use path_prepend_ inconsistently" \
-                 1>&2; exit 1; } || :;                                 \
-         fi;                                                           \
-       else                                                            \
-         echo "$@: skipped: no such file: $(_hv_file)";                \
+         grep -l 'VERSION mismatch' $(_hv_file) >/dev/null             \
+           || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2;    \
+                exit 0; };                                             \
+         grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null         \
+           || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
+                exit 1; };                                             \
+         good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file));           \
+         grep -LFx "$$good"                                            \
+               $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT)))  \
+             | grep . &&                                               \
+           { echo "$(ME): the above files use path_prepend_ inconsistently" \
+               1>&2; exit 1; } || :;                                   \
        fi
 
 # #if HAVE_... will evaluate to false for any non numeric string.
@@ -995,8 +1032,16 @@ gpg_key_ID ?= \
      && gpgv .ann-sig - < /dev/null 2>&1 \
          | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
 
+translation_project_ ?= address@hidden
+announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
+announcement_mail_headers_ ?=                                          \
+To: address@hidden                                                     \
+Cc: $(announcement_Cc_)                                                        
\
+Mail-Followup-To: $(PACKAGE_BUGREPORT)
+
 announcement: NEWS ChangeLog $(rel-files)
        @$(build_aux)/announce-gen                                      \
+           --mail-headers='$(announcement_mail_headers_)'              \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
@@ -1080,12 +1125,17 @@ release-prep:
        $(VC) commit -F .ci-msg -a
        rm .ci-msg
 
+# Override this with e.g., -s $(srcdir)/some_other_name.texi
+# if the default $(PACKAGE)-derived name doesn't apply.
+gendocs_options_ ?=
+
 .PHONY: web-manual
 web-manual:
        @test -z "$(manual_title)" \
          && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
        @cd '$(srcdir)/doc'; \
-         $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
+         $(SHELL) ../build-aux/gendocs.sh $(gendocs_options_) \
+            -o '$(abs_builddir)/doc/manual' \
             --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
            "$(PACKAGE_NAME) - $(manual_title)"
        @echo " *** Upload the doc/manual directory to web-cvs."
diff --git a/maint.mk b/maint.mk
index 6389c38..3bcab0c 100644
--- a/maint.mk
+++ b/maint.mk
@@ -148,16 +148,6 @@ local-check :=                                             
                \
     $(filter-out $(local-checks-to-skip), $(local-checks-available)))
 
 syntax-check: $(local-check)
-#      @grep -nE '#  *include <(limits|std(def|arg|bool))\.h>'         \
-#          $$(find -type f -name '*.[chly]') &&                        \
-#        { echo '$(ME): found conditional include' 1>&2;               \
-#          exit 1; } || :
-
-#      grep -nE '^#  *include <(string|stdlib)\.h>'                    \
-#          $(srcdir)/{lib,src}/*.[chy] &&                              \
-#        { echo '$(ME): FIXME' 1>&2;                                   \
-#          exit 1; } || :
-# FIXME: don't allow `#include .strings\.h' anywhere
 
 # _sc_search_regexp
 #
@@ -554,6 +544,13 @@ sc_prohibit_signal_without_use:
        re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>'          \
          $(_sc_header_without_use)
 
+# Prohibit the inclusion of strings.h without a sensible use.
+# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
+sc_prohibit_strings_without_use:
+       @h='<strings.h>'                                                \
+       re='\<(strn?casecmp|ffs(ll)?)\>'                                \
+         $(_sc_header_without_use)
+
 # Get the list of symbol names with this:
 # perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
 _intprops_names =                                                      \
@@ -668,6 +665,44 @@ sc_prohibit_always_true_header_tests:
 '  with the corresponding gnulib module, they are always true'         \
          $(_sc_search_regexp)
 
+# ==================================================================
+gl_other_headers_ ?= \
+  intprops.h   \
+  openat.h     \
+  stat-macros.h
+
+# Perl -lne code to extract "significant" cpp-defined symbols from a
+# gnulib header file, eliminating a few common false-positives.
+gl_extract_significant_defines_ = \
+  /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\
+    && $$2 !~ /(?:rpl_|_used_without_)/\
+    && $$1 !~ /^(?:NSIG|ATTRIBUTE_NORETURN)$$/\
+    and print $$1
+
+# Create a list of regular expressions matching the names
+# of macros that are guaranteed to be defined by parts of gnulib.
+define def_sym_regex
+       gen_h=$(gl_generated_headers_);                                 \
+       (cd $(gnulib_dir)/lib;                                          \
+         for f in *.in.h $(gl_other_headers_); do                      \
+           perl -lne '$(gl_extract_significant_defines_)' $$f;         \
+         done;                                                         \
+       ) | sort -u                                                     \
+         | sed 's/^/^ *# *define /;s/$$/\\>/'
+endef
+
+# Don't define macros that we already get from gnulib header files.
+sc_prohibit_always-defined_macros:
+       @if test -d $(gnulib_dir); then                                 \
+         case $$(echo all: | grep -l -f - Makefile) in Makefile);; *)  \
+           echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
+         esac;                                                         \
+         $(def_sym_regex) | grep -f - $$($(VC_LIST_EXCEPT))            \
+           && { echo '$(ME): define the above via some gnulib .h file' \
+                 1>&2;  exit 1; } || :;                                \
+       fi
+# ==================================================================
+
 # Prohibit checked in backup files.
 sc_prohibit_backup_files:
        @$(VC_LIST) | grep '~$$' &&                             \
@@ -938,20 +973,22 @@ sc_copyright_check:
 # sets PATH correctly.  This is an inexpensive way to ensure that
 # the other init.sh-using tests also get it right.
 _hv_file ?= $(srcdir)/tests/help-version
-_hv_regex ?= ^ *\. [^ ]*/init\.sh
+_hv_regex_weak ?= ^ *\. .*/init\.sh"
+_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
 sc_cross_check_PATH_usage_in_tests:
        @if test -f $(_hv_file); then                                   \
-         if grep -l 'VERSION mismatch' $(_hv_file) >/dev/null          \
-             && grep -lE '$(_hv_regex)' $(_hv_file) >/dev/null; then   \
-           good=$$(grep -E '$(_hv_regex)' < $(_hv_file));              \
-           grep -LFx "$$good"                                          \
-                 $$(grep -lE '$(_hv_regex)' $$($(VC_LIST_EXCEPT)))     \
-               | grep . &&                                             \
-             { echo "$(ME): the above files use path_prepend_ inconsistently" \
-                 1>&2; exit 1; } || :;                                 \
-         fi;                                                           \
-       else                                                            \
-         echo "$@: skipped: no such file: $(_hv_file)";                \
+         grep -l 'VERSION mismatch' $(_hv_file) >/dev/null             \
+           || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2;    \
+                exit 0; };                                             \
+         grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null         \
+           || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
+                exit 1; };                                             \
+         good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file));           \
+         grep -LFx "$$good"                                            \
+               $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT)))  \
+             | grep . &&                                               \
+           { echo "$(ME): the above files use path_prepend_ inconsistently" \
+               1>&2; exit 1; } || :;                                   \
        fi
 
 # #if HAVE_... will evaluate to false for any non numeric string.
@@ -995,8 +1032,16 @@ gpg_key_ID ?= \
      && gpgv .ann-sig - < /dev/null 2>&1 \
          | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
 
+translation_project_ ?= address@hidden
+announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
+announcement_mail_headers_ ?=                                          \
+To: address@hidden                                                     \
+Cc: $(announcement_Cc_)                                                        
\
+Mail-Followup-To: $(PACKAGE_BUGREPORT)
+
 announcement: NEWS ChangeLog $(rel-files)
        @$(build_aux)/announce-gen                                      \
+           --mail-headers='$(announcement_mail_headers_)'              \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
@@ -1080,12 +1125,17 @@ release-prep:
        $(VC) commit -F .ci-msg -a
        rm .ci-msg
 
+# Override this with e.g., -s $(srcdir)/some_other_name.texi
+# if the default $(PACKAGE)-derived name doesn't apply.
+gendocs_options_ ?=
+
 .PHONY: web-manual
 web-manual:
        @test -z "$(manual_title)" \
          && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
        @cd '$(srcdir)/doc'; \
-         $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
+         $(SHELL) ../build-aux/gendocs.sh $(gendocs_options_) \
+            -o '$(abs_builddir)/doc/manual' \
             --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
            "$(PACKAGE_NAME) - $(manual_title)"
        @echo " *** Upload the doc/manual directory to web-cvs."


hooks/post-receive
-- 
GNU gsasl



reply via email to

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