gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_21-50-g8e5417a


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_21-50-g8e5417a
Date: Tue, 17 Jul 2012 16:20:45 +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 gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=8e5417ad28fd3821e830446f2c74ccc22adde70e

The branch, master has been updated
       via  8e5417ad28fd3821e830446f2c74ccc22adde70e (commit)
       via  fd27a1bfa9b26ae706265322fa6eb20bbd6a1721 (commit)
       via  0287f236d45ae6f0a77e2ac96362242dad22c3b9 (commit)
      from  4c3db964f976389c0545abb32f1e64ab2f61b037 (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 8e5417ad28fd3821e830446f2c74ccc22adde70e
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Tue Jul 17 18:07:48 2012 +0200

    Updated gnulib.

commit fd27a1bfa9b26ae706265322fa6eb20bbd6a1721
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Tue Jul 17 18:05:14 2012 +0200

    print average time per transaction and sample variance.

commit 0287f236d45ae6f0a77e2ac96362242dad22c3b9
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Tue Jul 17 17:51:52 2012 +0200

    Client credentials initialization moved outside benchmark

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

Summary of changes:
 build-aux/snippet/_Noreturn.h         |    2 +-
 gl/Makefile.am                        |    5 +-
 gl/alloca.in.h                        |    7 +
 gl/argp-ba.c                          |    2 +-
 gl/argp-help.c                        |    1 +
 gl/argp-parse.c                       |    4 +-
 gl/argp-pv.c                          |    2 +-
 gl/fseeko.c                           |    6 +-
 gl/fseterr.c                          |    2 +-
 gl/fseterr.h                          |   22 ++-
 gl/fstat.c                            |    2 +
 gl/gettext.h                          |    9 +-
 gl/m4/argp.m4                         |   22 +--
 gl/m4/extensions.m4                   |    4 +-
 gl/m4/fdopen.m4                       |    6 +-
 gl/m4/frexp.m4                        |    4 +-
 gl/m4/frexpl.m4                       |   14 +-
 gl/m4/{msvc-nothrow.m4 => fseterr.m4} |    8 +-
 gl/m4/getopt.m4                       |  291 ++++++++++++++++++---------------
 gl/m4/gettext.m4                      |    4 +-
 gl/m4/gnulib-common.m4                |    4 +-
 gl/m4/gnulib-comp.m4                  |    5 +
 gl/m4/intdiv0.m4                      |    4 +-
 gl/m4/intlmacosx.m4                   |   12 +-
 gl/m4/largefile.m4                    |    2 +-
 gl/m4/ldexpl.m4                       |    6 +-
 gl/m4/lock.m4                         |    4 +-
 gl/m4/mmap-anon.m4                    |    4 +-
 gl/m4/multiarch.m4                    |    4 +-
 gl/m4/nocrash.m4                      |    4 +-
 gl/m4/printf-frexpl.m4                |    6 +-
 gl/m4/printf.m4                       |   29 ++--
 gl/m4/signbit.m4                      |    4 +-
 gl/m4/stdio_h.m4                      |    4 +-
 gl/m4/strerror_r.m4                   |    4 +-
 gl/m4/strndup.m4                      |    4 +-
 gl/m4/sys_time_h.m4                   |    8 +-
 gl/m4/threadlib.m4                    |   54 +++---
 gl/m4/time_h.m4                       |    4 +-
 gl/m4/time_r.m4                       |    2 +-
 gl/m4/visibility.m4                   |    4 +-
 gl/printf-parse.c                     |    2 +-
 gl/signal.in.h                        |   12 +-
 gl/stdint.in.h                        |    2 +-
 gl/stdio-impl.h                       |    4 +-
 gl/stdlib.in.h                        |    4 +-
 gl/sys_select.in.h                    |    2 +-
 gl/tests/init.sh                      |    5 +-
 gl/tests/minus-zero.h                 |    6 +-
 gl/tests/stat.c                       |    1 +
 gl/tests/test-alloca-opt.c            |    2 +-
 gl/tests/test-malloca.c               |    2 +-
 gl/tests/test-select.h                |    2 +-
 gl/tests/test-time.c                  |    2 +-
 gl/timespec.h                         |    9 +-
 gl/unistd.in.h                        |    2 +-
 gl/vasnprintf.c                       |    2 +-
 maint.mk                              |   35 +++-
 src/benchmark-cipher.c                |    6 +-
 src/benchmark-tls.c                   |   68 +++++++-
 src/benchmark.c                       |    4 +-
 src/benchmark.h                       |    6 +
 62 files changed, 450 insertions(+), 317 deletions(-)
 copy gl/m4/{msvc-nothrow.m4 => fseterr.m4} (58%)

diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h
index 1a7b4da..c44ad89 100644
--- a/build-aux/snippet/_Noreturn.h
+++ b/build-aux/snippet/_Noreturn.h
@@ -1,4 +1,4 @@
-#ifndef _Noreturn
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))
diff --git a/gl/Makefile.am b/gl/Makefile.am
index a492e6a..eb6b6bd 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -428,9 +428,10 @@ EXTRA_libgnu_la_SOURCES += fseeko.c
 
 ## begin gnulib module fseterr
 
-libgnu_la_SOURCES += fseterr.c
 
-EXTRA_DIST += fseterr.h stdio-impl.h
+EXTRA_DIST += fseterr.c fseterr.h stdio-impl.h
+
+EXTRA_libgnu_la_SOURCES += fseterr.c
 
 ## end   gnulib module fseterr
 
diff --git a/gl/alloca.in.h b/gl/alloca.in.h
index e94eb68..d20f4b8 100644
--- a/gl/alloca.in.h
+++ b/gl/alloca.in.h
@@ -44,6 +44,13 @@
 #  define alloca _alloca
 # elif defined __DECC && defined __VMS
 #  define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+#  ifdef  __cplusplus
+extern "C"
+#  endif
+void *_alloca (unsigned short);
+#  pragma intrinsic (_alloca)
+#  define alloca _alloca
 # else
 #  include <stddef.h>
 #  ifdef  __cplusplus
diff --git a/gl/argp-ba.c b/gl/argp-ba.c
index 0b3d0bd..1477677 100644
--- a/gl/argp-ba.c
+++ b/gl/argp-ba.c
@@ -23,7 +23,7 @@
    ADDR."  */
 const char *argp_program_bug_address
 /* This variable should be zero-initialized.  On most systems, putting it into
-   BSS is sufficient.  Not so on MacOS X 10.3 and 10.4, see
+   BSS is sufficient.  Not so on Mac OS X 10.3 and 10.4, see
    <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
    <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>.  */
 #if defined __ELF__
diff --git a/gl/argp-help.c b/gl/argp-help.c
index a126acb..c46703c 100644
--- a/gl/argp-help.c
+++ b/gl/argp-help.c
@@ -29,6 +29,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <assert.h>
 #include <stdarg.h>
 #include <ctype.h>
diff --git a/gl/argp-parse.c b/gl/argp-parse.c
index 3b411d4..6bbb145 100644
--- a/gl/argp-parse.c
+++ b/gl/argp-parse.c
@@ -880,11 +880,11 @@ __argp_parse (const struct argp *argp, int argc, char 
**argv, unsigned flags,
 #ifndef _LIBC
   if (!(flags & ARGP_PARSE_ARGV0))
     {
-#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+#if HAVE_DECL_PROGRAM_INVOCATION_NAME
       if (!program_invocation_name)
         program_invocation_name = argv[0];
 #endif
-#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
       if (!program_invocation_short_name)
         program_invocation_short_name = __argp_base_name (argv[0]);
 #endif
diff --git a/gl/argp-pv.c b/gl/argp-pv.c
index 1d5a010..a615e7a 100644
--- a/gl/argp-pv.c
+++ b/gl/argp-pv.c
@@ -23,7 +23,7 @@
    ARGP_NO_EXIT flag is used).  Overridden by ARGP_PROGRAM_VERSION_HOOK.  */
 const char *argp_program_version
 /* This variable should be zero-initialized.  On most systems, putting it into
-   BSS is sufficient.  Not so on MacOS X 10.3 and 10.4, see
+   BSS is sufficient.  Not so on Mac OS X 10.3 and 10.4, see
    <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
    <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>.  */
 #if defined __ELF__
diff --git a/gl/fseeko.c b/gl/fseeko.c
index c372a5c..7364f7f 100644
--- a/gl/fseeko.c
+++ b/gl/fseeko.c
@@ -51,7 +51,7 @@ fseeko (FILE *fp, off_t offset, int whence)
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, Mac OS X, Cygwin */
 # if defined __SL64 && defined __SCLE /* Cygwin */
   if ((fp->_flags & __SL64) == 0)
     {
@@ -109,7 +109,7 @@ fseeko (FILE *fp, off_t offset, int whence)
       off_t pos = lseek (fileno (fp), offset, whence);
       if (pos == -1)
         {
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
+#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, Mac OS X, Cygwin */
           fp_->_flags &= ~__SOFF;
 #endif
           return -1;
@@ -118,7 +118,7 @@ fseeko (FILE *fp, off_t offset, int whence)
 #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
       fp->_flags &= ~_IO_EOF_SEEN;
       fp->_offset = pos;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, Mac OS X, Cygwin */
 # if defined __CYGWIN__
       /* fp_->_offset is typed as an integer.  */
       fp_->_offset = pos;
diff --git a/gl/fseterr.c b/gl/fseterr.c
index 78791af..4273a46 100644
--- a/gl/fseterr.c
+++ b/gl/fseterr.c
@@ -31,7 +31,7 @@ fseterr (FILE *fp)
      fast macros.  */
 #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, 
Linux libc5 */
   fp->_flags |= _IO_ERR_SEEN;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, Mac OS X, Cygwin */
   fp_->_flags |= __SERR;
 #elif defined __EMX__               /* emx+gcc */
   fp->_flags |= _IOERR;
diff --git a/gl/fseterr.h b/gl/fseterr.h
index b3930c5..16a1afe 100644
--- a/gl/fseterr.h
+++ b/gl/fseterr.h
@@ -19,19 +19,27 @@
 
 #include <stdio.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
 /* Set the error indicator of the stream FP.
    The "error indicator" is set when an I/O operation on the stream fails, and
    is cleared (together with the "end-of-file" indicator) by clearerr (FP).  */
-extern void fseterr (FILE *fp);
 
+#if HAVE___FSETERR /* musl libc */
+
+# include <stdio_ext.h>
+# define fseterr(fp) __fseterr (fp)
 
-#ifdef __cplusplus
+#else
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+extern void fseterr (FILE *fp);
+
+# ifdef __cplusplus
 }
+# endif
+
 #endif
 
 #endif /* _FSETERR_H */
diff --git a/gl/fstat.c b/gl/fstat.c
index ac2b1ef..6d5f5c2 100644
--- a/gl/fstat.c
+++ b/gl/fstat.c
@@ -24,7 +24,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
 # define stat _stati64
+# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
 # define fstat _fstati64
 #endif
 #undef __need_system_sys_stat_h
diff --git a/gl/gettext.h b/gl/gettext.h
index 75875cd..65ca1e6 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -183,9 +183,12 @@ npgettext_aux (const char *domain,
 
 #include <string.h>
 
-#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-   /* || __STDC_VERSION__ >= 199901L */ )
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+     /* || __STDC_VERSION__ >= 199901L */ )
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
 
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 #include <stdlib.h>
diff --git a/gl/m4/argp.m4 b/gl/m4/argp.m4
index 87c7da6..0d1de3a 100644
--- a/gl/m4/argp.m4
+++ b/gl/m4/argp.m4
@@ -1,4 +1,4 @@
-# argp.m4 serial 13
+# argp.m4 serial 14
 dnl Copyright (C) 2003-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,18 +10,14 @@ AC_DEFUN([gl_ARGP],
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_DECL([program_invocation_name],
-                [AC_DEFINE([HAVE_DECL_PROGRAM_INVOCATION_NAME], [1],
-                           [Define if program_invocation_name is declared])],
-                [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_NAME], [1],
-                           [Define to 1 to add extern declaration of 
program_invocation_name to argp.h])],
-                [[#include <errno.h>]])
-  AC_CHECK_DECL([program_invocation_short_name],
-                [AC_DEFINE([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME], [1],
-                           [Define if program_invocation_short_name is 
declared])],
-                [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_SHORT_NAME], [1],
-                           [Define to 1 to add extern declaration of 
program_invocation_short_name to argp.h])],
-                [[#include <errno.h>]])
+  AC_CHECK_DECLS([program_invocation_name], [],
+                 [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_NAME], [1],
+                            [Define to 1 to add extern declaration of 
program_invocation_name to argp.h])],
+                 [[#include <errno.h>]])
+  AC_CHECK_DECLS([program_invocation_short_name], [],
+                 [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_SHORT_NAME], [1],
+                            [Define to 1 to add extern declaration of 
program_invocation_short_name to argp.h])],
+                 [[#include <errno.h>]])
 
   # Check if program_invocation_name and program_invocation_short_name
   # are defined elsewhere. It is improbable that only one of them will
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 0bfaef6..6d17d8a 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 11  -*- Autoconf -*-
+# serial 12  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
@@ -67,7 +67,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on MacOS X.  */
+/* Enable general extensions on Mac OS X.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
diff --git a/gl/m4/fdopen.m4 b/gl/m4/fdopen.m4
index 9ca9d2a..14f1554 100644
--- a/gl/m4/fdopen.m4
+++ b/gl/m4/fdopen.m4
@@ -1,4 +1,4 @@
-# fdopen.m4 serial 2
+# fdopen.m4 serial 3
 dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,10 +25,8 @@ main (void)
   FILE *fp;
   errno = 0;
   fp = fdopen (-1, "r");
-  if (fp != NULL)
+  if (fp == NULL && errno == 0)
     return 1;
-  if (errno == 0)
-    return 2;
   return 0;
 }]])],
           [gl_cv_func_fdopen_works=yes],
diff --git a/gl/m4/frexp.m4 b/gl/m4/frexp.m4
index 4162195..fb8db70 100644
--- a/gl/m4/frexp.m4
+++ b/gl/m4/frexp.m4
@@ -1,4 +1,4 @@
-# frexp.m4 serial 13
+# frexp.m4 serial 14
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -107,7 +107,7 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS],
 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
    ICC 10.0 has a bug when optimizing the expression -zero.
    The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
-   to PowerPC on MacOS X 10.5.  */
+   to PowerPC on Mac OS X 10.5.  */
 #if defined __hpux || defined __sgi || defined __ICC
 static double
 compute_minus_zero (void)
diff --git a/gl/m4/frexpl.m4 b/gl/m4/frexpl.m4
index 9df87ab..774d540 100644
--- a/gl/m4/frexpl.m4
+++ b/gl/m4/frexpl.m4
@@ -1,4 +1,4 @@
-# frexpl.m4 serial 19
+# frexpl.m4 serial 20
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_FREXPL],
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   dnl Check whether it's declared.
-  dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+  dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
   AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
 
   FREXPL_LIBM=
@@ -73,7 +73,7 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
   dnl Check whether it's declared.
-  dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+  dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
   AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
   if test $HAVE_DECL_FREXPL = 1; then
     gl_CHECK_FREXPL_NO_LIBM
@@ -113,8 +113,8 @@ AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM],
 ])
 
 dnl Test whether frexpl() works on finite numbers (this fails on
-dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
-dnl (this fails on MacOS X 10.5/i386), and also on infinite numbers (this
+dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
+dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this
 dnl fails e.g. on IRIX 6.5 and mingw).
 AC_DEFUN([gl_FUNC_FREXPL_WORKS],
 [
@@ -162,7 +162,7 @@ int main()
     if (exp != 5)
       result |= 1;
   }
-  /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
+  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
      function returns an invalid (incorrectly normalized) value: it returns
                y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
      but the correct result is
@@ -201,7 +201,7 @@ int main()
         int exp;
         long double y = frexpl (x, &exp);
         /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
-           exp = -16382, y = 0.5.  On MacOS X 10.5: exp = -16384, y = 0.5.  */
+           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
         if (exp != LDBL_MIN_EXP - 1)
           result |= 8;
       }
diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/fseterr.m4
similarity index 58%
copy from gl/m4/msvc-nothrow.m4
copy to gl/m4/fseterr.m4
index 0125050..3eb3197 100644
--- a/gl/m4/msvc-nothrow.m4
+++ b/gl/m4/fseterr.m4
@@ -1,10 +1,10 @@
-# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# fseterr.m4 serial 1
+dnl Copyright (C) 2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_MSVC_NOTHROW],
+AC_DEFUN([gl_FUNC_FSETERR],
 [
-  AC_REQUIRE([gl_MSVC_INVAL])
+  AC_CHECK_FUNCS_ONCE([__fseterr])
 ])
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index 2aea895..f6902b5 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 39
+# getopt.m4 serial 44
 dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,18 +9,17 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
 [
   m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
   dnl Other modules can request the gnulib implementation of the getopt
   dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
   dnl argp.m4 does this.
   m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
-    gl_GETOPT_IFELSE([], [])
     REPLACE_GETOPT=1
   ], [
     REPLACE_GETOPT=0
-    gl_GETOPT_IFELSE([
+    if test -n "$gl_replace_getopt"; then
       REPLACE_GETOPT=1
-    ],
-    [])
+    fi
   ])
   if test $REPLACE_GETOPT = 1; then
     dnl Arrange for getopt.h to be created.
@@ -38,13 +37,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
   AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
 ])
 
-# emacs' configure.in uses this.
-AC_DEFUN([gl_GETOPT_IFELSE],
-[
-  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
-  AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
-])
-
 # Determine whether to replace the entire getopt facility.
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
@@ -74,11 +66,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
   fi
 
-  dnl mingw's getopt (in libmingwex.a) does weird things when the options
-  dnl strings starts with '+' and it's not the first call.  Some internal state
-  dnl is left over from earlier calls, and neither setting optind = 0 nor
-  dnl setting optreset = 1 get rid of this internal state.
-  dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
   dnl POSIX 2008 does not specify leading '+' behavior, but see
   dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
   dnl the next version of POSIX.  For now, we only guarantee leading '+'
@@ -87,30 +74,16 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CACHE_CHECK([whether getopt is POSIX compatible],
       [gl_cv_func_getopt_posix],
       [
-        dnl BSD getopt_long uses an incompatible method to reset option
-        dnl processing.  Existence of the optreset variable, in and of
-        dnl itself, is not a reason to replace getopt, but knowledge
-        dnl of the variable is needed to determine how to reset and
-        dnl whether a reset reparses the environment.  Solaris
-        dnl supports neither optreset nor optind=0, but keeps no state
-        dnl that needs a reset beyond setting optind=1; detect Solaris
-        dnl by getopt_clip.
-        AC_LINK_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[#include <unistd.h>]],
-             [[int *p = &optreset; return optreset;]])],
-          [gl_optind_min=1],
-          [AC_COMPILE_IFELSE(
-             [AC_LANG_PROGRAM(
-                [[#include <getopt.h>]],
-                [[return !getopt_clip;]])],
-             [gl_optind_min=1],
-             [gl_optind_min=0])])
-
-        dnl This test fails on mingw and succeeds on many other platforms.
-        gl_save_CPPFLAGS=$CPPFLAGS
-        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+        dnl Merging these three different test programs into a single one
+        dnl would require a reset mechanism. On BSD systems, it can be done
+        dnl through 'optreset'; on some others (glibc), it can be done by
+        dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+        dnl Solaris 9, musl libc), there is no such mechanism.
+        if test $cross_compiling = no; then
+          dnl Sanity check. Succeeds everywhere (except on MSVC,
+          dnl which lacks <unistd.h> and getopt() entirely).
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -118,89 +91,107 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 int
 main ()
 {
-  {
-    static char program[] = "program";
-    static char a[] = "-a";
-    static char foo[] = "foo";
-    static char bar[] = "bar";
-    char *argv[] = { program, a, foo, bar, NULL };
-    int c;
+  static char program[] = "program";
+  static char a[] = "-a";
+  static char foo[] = "foo";
+  static char bar[] = "bar";
+  char *argv[] = { program, a, foo, bar, NULL };
+  int c;
 
-    optind = OPTIND_MIN;
-    opterr = 0;
-
-    c = getopt (4, argv, "ab");
-    if (!(c == 'a'))
-      return 1;
-    c = getopt (4, argv, "ab");
-    if (!(c == -1))
-      return 2;
-    if (!(optind == 2))
-      return 3;
-  }
-  /* Some internal state exists at this point.  */
-  {
-    static char program[] = "program";
-    static char donald[] = "donald";
-    static char p[] = "-p";
-    static char billy[] = "billy";
-    static char duck[] = "duck";
-    static char a[] = "-a";
-    static char bar[] = "bar";
-    char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
-    int c;
+  c = getopt (4, argv, "ab");
+  if (!(c == 'a'))
+    return 1;
+  c = getopt (4, argv, "ab");
+  if (!(c == -1))
+    return 2;
+  if (!(optind == 2))
+    return 3;
+  return 0;
+}
+]])],
+            [gl_cv_func_getopt_posix=maybe],
+            [gl_cv_func_getopt_posix=no])
+          if test $gl_cv_func_getopt_posix = maybe; then
+            dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+            dnl which lacks <unistd.h> and getopt() entirely).
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
-    optind = OPTIND_MIN;
-    opterr = 0;
+int
+main ()
+{
+  static char program[] = "program";
+  static char donald[] = "donald";
+  static char p[] = "-p";
+  static char billy[] = "billy";
+  static char duck[] = "duck";
+  static char a[] = "-a";
+  static char bar[] = "bar";
+  char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+  int c;
 
-    c = getopt (7, argv, "+abp:q:");
-    if (!(c == -1))
-      return 4;
-    if (!(strcmp (argv[0], "program") == 0))
-      return 5;
-    if (!(strcmp (argv[1], "donald") == 0))
-      return 6;
-    if (!(strcmp (argv[2], "-p") == 0))
-      return 7;
-    if (!(strcmp (argv[3], "billy") == 0))
-      return 8;
-    if (!(strcmp (argv[4], "duck") == 0))
-      return 9;
-    if (!(strcmp (argv[5], "-a") == 0))
-      return 10;
-    if (!(strcmp (argv[6], "bar") == 0))
-      return 11;
-    if (!(optind == 1))
-      return 12;
-  }
-  /* Detect MacOS 10.5, AIX 7.1 bug.  */
-  {
-    static char program[] = "program";
-    static char ab[] = "-ab";
-    char *argv[3] = { program, ab, NULL };
-    optind = OPTIND_MIN;
-    opterr = 0;
-    if (getopt (2, argv, "ab:") != 'a')
-      return 13;
-    if (getopt (2, argv, "ab:") != '?')
-      return 14;
-    if (optopt != 'b')
-      return 15;
-    if (optind != 2)
-      return 16;
-  }
+  c = getopt (7, argv, "+abp:q:");
+  if (!(c == -1))
+    return 4;
+  if (!(strcmp (argv[0], "program") == 0))
+    return 5;
+  if (!(strcmp (argv[1], "donald") == 0))
+    return 6;
+  if (!(strcmp (argv[2], "-p") == 0))
+    return 7;
+  if (!(strcmp (argv[3], "billy") == 0))
+    return 8;
+  if (!(strcmp (argv[4], "duck") == 0))
+    return 9;
+  if (!(strcmp (argv[5], "-a") == 0))
+    return 10;
+  if (!(strcmp (argv[6], "bar") == 0))
+    return 11;
+  if (!(optind == 1))
+    return 12;
+  return 0;
+}
+]])],
+              [gl_cv_func_getopt_posix=maybe],
+              [gl_cv_func_getopt_posix=no])
+          fi
+          if test $gl_cv_func_getopt_posix = maybe; then
+            dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
+int
+main ()
+{
+  static char program[] = "program";
+  static char ab[] = "-ab";
+  char *argv[3] = { program, ab, NULL };
+  if (getopt (2, argv, "ab:") != 'a')
+    return 13;
+  if (getopt (2, argv, "ab:") != '?')
+    return 14;
+  if (optopt != 'b')
+    return 15;
+  if (optind != 2)
+    return 16;
   return 0;
 }
 ]])],
-          [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
-          [case "$host_os" in
-             mingw*)         gl_cv_func_getopt_posix="guessing no";;
-             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
-             *)              gl_cv_func_getopt_posix="guessing yes";;
-           esac
-          ])
-        CPPFLAGS=$gl_save_CPPFLAGS
+              [gl_cv_func_getopt_posix=yes],
+              [gl_cv_func_getopt_posix=no])
+          fi
+        else
+          case "$host_os" in
+            darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+            *)                       gl_cv_func_getopt_posix="guessing yes";;
+          esac
+        fi
       ])
     case "$gl_cv_func_getopt_posix" in
       *no) gl_replace_getopt=yes ;;
@@ -236,7 +227,7 @@ dnl is ambiguous with environment values that contain 
newlines.
              nocrash_init();
 
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
-                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
              {
                static char conftest[] = "conftest";
@@ -247,7 +238,7 @@ dnl is ambiguous with environment values that contain 
newlines.
                  result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
-                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
                 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
              {
                static char program[] = "program";
@@ -276,7 +267,7 @@ dnl is ambiguous with environment values that contain 
newlines.
                if (getopt (3, argv, "-p") != 1)
                  result |= 16;
                else if (getopt (3, argv, "-p") != 'p')
-                 result |= 32;
+                 result |= 16;
              }
              /* This code fails on glibc 2.11.  */
              {
@@ -286,9 +277,9 @@ dnl is ambiguous with environment values that contain 
newlines.
                char *argv[] = { program, b, a, NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 result |= 64;
+                 result |= 32;
                else if (getopt (3, argv, "+:a:b") != ':')
-                 result |= 64;
+                 result |= 32;
              }
              /* This code dumps core on glibc 2.14.  */
              {
@@ -298,18 +289,14 @@ dnl is ambiguous with environment values that contain 
newlines.
                char *argv[] = { program, w, dummy, NULL };
                optind = opterr = 1;
                if (getopt (3, argv, "W;") != 'W')
-                 result |= 128;
+                 result |= 64;
              }
              return result;
            ]])],
         [gl_cv_func_getopt_gnu=yes],
         [gl_cv_func_getopt_gnu=no],
-        [dnl Cross compiling. Guess based on host and declarations.
-         case $host_os:$ac_cv_have_decl_optreset in
-           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
-           *:yes)               gl_cv_func_getopt_gnu=no;;
-           *)                   gl_cv_func_getopt_gnu=yes;;
-         esac
+        [dnl Cross compiling. Assume the worst, even on glibc platforms.
+         gl_cv_func_getopt_gnu="guessing no"
         ])
        case $gl_had_POSIXLY_CORRECT in
          exported) ;;
@@ -317,13 +304,54 @@ dnl is ambiguous with environment values that contain 
newlines.
          *) AS_UNSET([POSIXLY_CORRECT]) ;;
        esac
       ])
-    if test "$gl_cv_func_getopt_gnu" = "no"; then
+    if test "$gl_cv_func_getopt_gnu" != yes; then
       gl_replace_getopt=yes
+    else
+      AC_CACHE_CHECK([for working GNU getopt_long function],
+        [gl_cv_func_getopt_long_gnu],
+        [AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <getopt.h>
+                #include <stddef.h>
+                #include <string.h>
+              ]],
+              [[static const struct option long_options[] =
+                  {
+                    { "xtremely-",no_argument,       NULL, 1003 },
+                    { "xtra",     no_argument,       NULL, 1001 },
+                    { "xtreme",   no_argument,       NULL, 1002 },
+                    { "xtremely", no_argument,       NULL, 1003 },
+                    { NULL,       0,                 NULL, 0 }
+                  };
+                /* This code fails on OpenBSD 5.0.  */
+                {
+                  static char program[] = "program";
+                  static char xtremel[] = "--xtremel";
+                  char *argv[] = { program, xtremel, NULL };
+                  int option_index;
+                  optind = 1; opterr = 0;
+                  if (getopt_long (2, argv, "", long_options, &option_index) 
!= 1003)
+                    return 1;
+                }
+                return 0;
+              ]])],
+           [gl_cv_func_getopt_long_gnu=yes],
+           [gl_cv_func_getopt_long_gnu=no],
+           [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+            case "$host_os" in
+              openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+              *)        gl_cv_func_getopt_long_gnu="guessing yes";;
+            esac
+           ])
+        ])
+      case "$gl_cv_func_getopt_long_gnu" in
+        *yes) ;;
+        *) gl_replace_getopt=yes ;;
+      esac
     fi
   fi
 ])
 
-# emacs' configure.in uses this.
 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
   GETOPT_H=getopt.h
@@ -334,7 +362,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 ])
 
 # Prerequisites of lib/getopt*.
-# emacs' configure.in uses this.
 AC_DEFUN([gl_PREREQ_GETOPT],
 [
   AC_CHECK_DECLS_ONCE([getenv])
diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4
index 5415f88..017d025 100644
--- a/gl/m4/gettext.m4
+++ b/gl/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 64 (gettext-0.18.2)
+# gettext.m4 serial 66 (gettext-0.18.2)
 dnl Copyright (C) 1995-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -97,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
   ])
 
-  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
   gt_INTL_MACOSX
 
   dnl Set USE_NLS.
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index d62b767..15d2b2b 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 32
+# gnulib-common.m4 serial 33
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -30,7 +30,7 @@ AC_DEFUN([gl_COMMON_BODY], [
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE__ && __MACH__ test for Mac OS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined 
__cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 4d13450..aad1024 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -450,6 +450,10 @@ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
   gl_PREREQ_FSEEKO
 fi
 gl_STDIO_MODULE_INDICATOR([fseeko])
+gl_FUNC_FSETERR
+if test $ac_cv_func___fseterr = no; then
+  AC_LIBOBJ([fseterr])
+fi
 gl_FUNC_FSTAT
 if test $REPLACE_FSTAT = 1; then
   AC_LIBOBJ([fstat])
@@ -1333,6 +1337,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/frexpl.m4
   m4/fseek.m4
   m4/fseeko.m4
+  m4/fseterr.m4
   m4/fstat.m4
   m4/ftell.m4
   m4/ftello.m4
diff --git a/gl/m4/intdiv0.m4 b/gl/m4/intdiv0.m4
index 6d89aeb..55bef60 100644
--- a/gl/m4/intdiv0.m4
+++ b/gl/m4/intdiv0.m4
@@ -1,4 +1,4 @@
-# intdiv0.m4 serial 5 (gettext-0.18.2)
+# intdiv0.m4 serial 6 (gettext-0.18.2)
 dnl Copyright (C) 2002, 2007-2008, 2010-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gt_INTDIV0],
 changequote(,)dnl
       case "$host_os" in
         macos* | darwin[6-9]* | darwin[1-9][0-9]*)
-          # On MacOS X 10.2 or newer, just assume the same as when cross-
+          # On Mac OS X 10.2 or newer, just assume the same as when cross-
           # compiling. If we were to perform the real test, 1 Crash Report
           # dialog window would pop up.
           case "$host_cpu" in
diff --git a/gl/m4/intlmacosx.m4 b/gl/m4/intlmacosx.m4
index dc2ddfe..d4da190 100644
--- a/gl/m4/intlmacosx.m4
+++ b/gl/m4/intlmacosx.m4
@@ -1,4 +1,4 @@
-# intlmacosx.m4 serial 4 (gettext-0.18.2)
+# intlmacosx.m4 serial 5 (gettext-0.18.2)
 dnl Copyright (C) 2004-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,11 +13,11 @@ dnl by the GNU Library General Public License, and the rest 
of the GNU
 dnl gettext package package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
-dnl Checks for special options needed on MacOS X.
+dnl Checks for special options needed on Mac OS X.
 dnl Defines INTL_MACOSX_LIBS.
 AC_DEFUN([gt_INTL_MACOSX],
 [
-  dnl Check for API introduced in MacOS X 10.2.
+  dnl Check for API introduced in Mac OS X 10.2.
   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
     [gt_cv_func_CFPreferencesCopyAppValue],
     [gt_save_LIBS="$LIBS"
@@ -31,9 +31,9 @@ AC_DEFUN([gt_INTL_MACOSX],
      LIBS="$gt_save_LIBS"])
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
     AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
-      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue 
in the CoreFoundation framework.])
+      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue 
in the CoreFoundation framework.])
   fi
-  dnl Check for API introduced in MacOS X 10.3.
+  dnl Check for API introduced in Mac OS X 10.3.
   AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
     [gt_save_LIBS="$LIBS"
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
@@ -46,7 +46,7 @@ AC_DEFUN([gt_INTL_MACOSX],
      LIBS="$gt_save_LIBS"])
   if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
     AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
-      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the 
CoreFoundation framework.])
+      [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in 
the CoreFoundation framework.])
   fi
   INTL_MACOSX_LIBS=
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test 
$gt_cv_func_CFLocaleCopyCurrent = yes; then
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
index a159f4a..a88850a 100644
--- a/gl/m4/largefile.m4
+++ b/gl/m4/largefile.m4
@@ -136,7 +136,7 @@ AC_DEFUN([gl_LARGEFILE],
     *)
       dnl Nothing to do on gnulib's side.
       dnl A 64-bit off_t is
-      dnl   - already the default on MacOS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+      dnl   - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
       dnl     OSF/1, Cygwin,
       dnl   - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
       dnl     glibc, HP-UX, Solaris,
diff --git a/gl/m4/ldexpl.m4 b/gl/m4/ldexpl.m4
index 11f20ca..6ecdd4f 100644
--- a/gl/m4/ldexpl.m4
+++ b/gl/m4/ldexpl.m4
@@ -1,4 +1,4 @@
-# ldexpl.m4 serial 15
+# ldexpl.m4 serial 16
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_LDEXPL],
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
   dnl Check whether it's declared.
-  dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+  dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
   AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
 
   LDEXPL_LIBM=
@@ -87,7 +87,7 @@ AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
 ])
 
 dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
-dnl and MacOS X 10.4/PowerPC).
+dnl and Mac OS X 10.4/PowerPC).
 AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index c0a6206..19c6d45 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,4 +1,4 @@
-# lock.m4 serial 11 (gettext-0.18.2)
+# lock.m4 serial 12 (gettext-0.18.2)
 dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,7 @@ AC_DEFUN([gl_LOCK],
 [
   AC_REQUIRE([gl_THREADLIB])
   if test "$gl_threads_api" = posix; then
-    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+    # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
     # pthread_rwlock_* functions.
     AC_CHECK_TYPE([pthread_rwlock_t],
       [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index 579323f..748b17d 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,4 +1,4 @@
-# mmap-anon.m4 serial 9
+# mmap-anon.m4 serial 10
 dnl Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
 #   and MAP_ANON exist and have the same value.
 # - On HP-UX, only MAP_ANONYMOUS exists.
-# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
 # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
 #   used.
 
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index b424dce..0c288b8 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,4 +1,4 @@
-# multiarch.m4 serial 6
+# multiarch.m4 serial 7
 dnl Copyright (C) 2008-2012 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,7 +6,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 # Determine whether the compiler is or may be producing universal binaries.
 #
-# On MacOS X 10.5 and later systems, the user can create libraries and
+# On Mac OS X 10.5 and later systems, the user can create libraries and
 # executables that work on multiple system types--known as "fat" or
 # "universal" binaries--by specifying multiple '-arch' options to the
 # compiler but only a single '-arch' option to the preprocessor.  Like
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index 08ef825..c2638df 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -1,4 +1,4 @@
-# nocrash.m4 serial 3
+# nocrash.m4 serial 4
 dnl Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ dnl          int main() { nocrash_init(); ... }
 AC_DEFUN([GL_NOCRASH],[[
 #include <stdlib.h>
 #if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on MacOS X.  */
+/* Avoid a crash on Mac OS X.  */
 #include <mach/mach.h>
 #include <mach/mach_error.h>
 #include <mach/thread_status.h>
diff --git a/gl/m4/printf-frexpl.m4 b/gl/m4/printf-frexpl.m4
index 55dd6bc..c960a49 100644
--- a/gl/m4/printf-frexpl.m4
+++ b/gl/m4/printf-frexpl.m4
@@ -1,4 +1,4 @@
-# printf-frexpl.m4 serial 9
+# printf-frexpl.m4 serial 10
 dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
     AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
       [Define if the frexpl function is available in libc.])
     dnl Also check whether it's declared.
-    dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+    dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
     AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
   fi
 
@@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
         AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
           [Define if the ldexpl function is available in libc.])
         dnl Also check whether it's declared.
-        dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in 
<math.h>.
+        dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in 
<math.h>.
         AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
         ;;
     esac
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index d75aca0..751e896 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 48
+# printf.m4 serial 50
 dnl Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -63,7 +63,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
            darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
                                  # Guess yes on OpenBSD >= 3.9.
@@ -222,7 +222,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 6.
            freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
            darwin*)              gl_cv_func_printf_infinite="guessing yes";;
                                  # Guess yes on HP-UX >= 11.
@@ -507,14 +507,14 @@ int main ()
   if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
       || buf[0] == '0')
     result |= 8;
-  /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
+  /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug.  */
   if (sprintf (buf, "%.1a", 1.999) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
     result |= 16;
-  /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
+  /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
      glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
   if (sprintf (buf, "%.1La", 1.999L) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
@@ -590,7 +590,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 6.
            freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
            darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
                                  # Guess yes on Solaris >= 2.10.
@@ -1028,8 +1028,9 @@ int main()
 changequote([,])dnl
           ])])
           if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-            (./conftest
+            (./conftest 2>&AS_MESSAGE_LOG_FD
              result=$?
+             _AS_ECHO_LOG([\$? = $result])
              if test $result != 0 && test $result != 77; then result=1; fi
              exit $result
             ) >/dev/null 2>/dev/null
@@ -1043,7 +1044,7 @@ changequote([,])dnl
           fi
           rm -fr conftest*
         else
-          dnl A universal build on Apple MacOS X platforms.
+          dnl A universal build on Apple Mac OS X platforms.
           dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
           dnl But we need a configuration result that is valid in both modes.
           gl_cv_func_printf_enomem="guessing no"
@@ -1137,7 +1138,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4]*)        gl_cv_func_snprintf_truncation_c99="guessing 
no";;
            freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing 
yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing 
no";;
            darwin*)              gl_cv_func_snprintf_truncation_c99="guessing 
yes";;
                                  # Guess yes on OpenBSD >= 3.9.
@@ -1236,7 +1237,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing 
yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
            darwin*)              gl_cv_func_snprintf_retval_c99="guessing 
yes";;
                                  # Guess yes on OpenBSD >= 3.9.
@@ -1317,7 +1318,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4]*)        gl_cv_func_snprintf_directive_n="guessing 
no";;
            freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing 
yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing 
no";;
            darwin*)              gl_cv_func_snprintf_directive_n="guessing 
yes";;
                                  # Guess yes on Solaris >= 2.6.
@@ -1459,7 +1460,7 @@ changequote(,)dnl
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4]*)        gl_cv_func_vsnprintf_zerosize_c99="guessing 
no";;
            freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing 
yes";;
-                                 # Guess yes on MacOS X >= 10.3.
+                                 # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing 
no";;
            darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing 
yes";;
                                  # Guess yes on Cygwin.
@@ -1539,8 +1540,8 @@ dnl                                  1  2  3  4  5  6  7  
8  9 10 11 12 13 14 15
 dnl   glibc 2.5                      .  .  .  .  .  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .
 dnl   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  
.  .  .  .  .  .
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
-dnl   MacOS X 10.5.8                 .  .  .  #  #  .  .  .  .  .  .  #  .  .  
.  .  .  .  .  .
-dnl   MacOS X 10.3.9                 .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
+dnl   Mac OS X 10.5.8                .  .  .  #  #  .  .  .  .  .  .  #  .  .  
.  .  .  .  .  .
+dnl   Mac OS X 10.3.9                .  .  .  .  #  .  .  .  .  .  .  #  .  #  
.  .  .  .  .  .
 dnl   OpenBSD 3.9, 4.0               .  .  #  #  #  #  .  #  .  #  .  #  .  #  
.  .  .  .  .  .
 dnl   Cygwin 1.7.0 (2009)            .  .  .  #  .  .  .  ?  .  .  .  .  .  ?  
.  .  .  .  .  .
 dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  
.  .  .  .  .  .
diff --git a/gl/m4/signbit.m4 b/gl/m4/signbit.m4
index e9877f6..fb707c9 100644
--- a/gl/m4/signbit.m4
+++ b/gl/m4/signbit.m4
@@ -1,4 +1,4 @@
-# signbit.m4 serial 12
+# signbit.m4 serial 13
 dnl Copyright (C) 2007-2012 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,7 @@ double m0d = -p0d;
 /* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
    So we use another constant expression instead.
    But that expression does not work on other platforms, such as when
-   cross-compiling to PowerPC on MacOS X 10.5.  */
+   cross-compiling to PowerPC on Mac OS X 10.5.  */
 long double p0l = 0.0L;
 #if defined __hpux || defined __sgi
 long double m0l = -LDBL_MIN * LDBL_MIN;
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index b03393b..5298dd6 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 41
+# stdio_h.m4 serial 42
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,9 @@ AC_DEFUN([gl_STDIO_H],
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
   GNULIB_FSCANF=1
+  gl_MODULE_INDICATOR([fscanf])
   GNULIB_SCANF=1
+  gl_MODULE_INDICATOR([scanf])
   GNULIB_FGETC=1
   GNULIB_GETC=1
   GNULIB_GETCHAR=1
diff --git a/gl/m4/strerror_r.m4 b/gl/m4/strerror_r.m4
index 5bdf0ab..bb035eb 100644
--- a/gl/m4/strerror_r.m4
+++ b/gl/m4/strerror_r.m4
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 14
+# strerror_r.m4 serial 15
 dnl Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -76,7 +76,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
         dnl HP-UX 11.31 strerror_r always fails when the buffer length argument
         dnl is less than 80.
         dnl FreeBSD 8.s strerror_r claims failure on 0
-        dnl MacOS X 10.5 strerror_r treats 0 like -1
+        dnl Mac OS X 10.5 strerror_r treats 0 like -1
         dnl Solaris 10 strerror_r corrupts errno on failure
         AC_CACHE_CHECK([whether strerror_r works],
           [gl_cv_func_strerror_r_works],
diff --git a/gl/m4/strndup.m4 b/gl/m4/strndup.m4
index bdde5fe..cef6889 100644
--- a/gl/m4/strndup.m4
+++ b/gl/m4/strndup.m4
@@ -1,4 +1,4 @@
-# strndup.m4 serial 20
+# strndup.m4 serial 21
 dnl Copyright (C) 2002-2003, 2005-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
       [AC_RUN_IFELSE([
          AC_LANG_PROGRAM([[#include <string.h>
                            #include <stdlib.h>]], [[
-#ifndef HAVE_DECL_STRNDUP
+#if !HAVE_DECL_STRNDUP
   extern
   #ifdef __cplusplus
   "C"
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
index 26eaf8e..c4a30cd 100644
--- a/gl/m4/sys_time_h.m4
+++ b/gl/m4/sys_time_h.m4
@@ -52,7 +52,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
     dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
     dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
     dnl smaller than the 'time_t' type mandated by POSIX.
-    AC_CACHE_CHECK([for correct struct timeval.tv_sec member],
+    dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
+    dnl that is good enough.
+    AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
       [gl_cv_sys_struct_timeval_tv_sec],
       [AC_COMPILE_IFELSE(
          [AC_LANG_PROGRAM(
@@ -65,7 +67,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
               #endif
             ]],
             [[static struct timeval x;
-              typedef int verify_tv_sec_type[sizeof (x.tv_sec) == sizeof 
(time_t) ? 1 : -1];
+              typedef int verify_tv_sec_type[
+                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+              ];
             ]])],
          [gl_cv_sys_struct_timeval_tv_sec=yes],
          [gl_cv_sys_struct_timeval_tv_sec=no])
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
index 9cedb67..cb93391 100644
--- a/gl/m4/threadlib.m4
+++ b/gl/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 9 (gettext-0.18.2)
+# threadlib.m4 serial 10 (gettext-0.18.2)
 dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -319,50 +319,50 @@ AC_DEFUN([gl_DISABLE_THREADS], [
 
 dnl Survey of platforms:
 dnl
-dnl Platform          Available   Compiler    Supports   test-lock
-dnl                   flavours    option      weak       result
-dnl ---------------   ---------   ---------   --------   ---------
-dnl Linux 2.4/glibc   posix       -lpthread       Y      OK
+dnl Platform           Available  Compiler    Supports   test-lock
+dnl                    flavours   option      weak       result
+dnl ---------------    ---------  ---------   --------   ---------
+dnl Linux 2.4/glibc    posix      -lpthread       Y      OK
 dnl
-dnl GNU Hurd/glibc    posix
+dnl GNU Hurd/glibc     posix
 dnl
-dnl FreeBSD 5.3       posix       -lc_r           Y
-dnl                   posix       -lkse ?         Y
-dnl                   posix       -lpthread ?     Y
-dnl                   posix       -lthr           Y
+dnl FreeBSD 5.3        posix      -lc_r           Y
+dnl                    posix      -lkse ?         Y
+dnl                    posix      -lpthread ?     Y
+dnl                    posix      -lthr           Y
 dnl
-dnl FreeBSD 5.2       posix       -lc_r           Y
-dnl                   posix       -lkse           Y
-dnl                   posix       -lthr           Y
+dnl FreeBSD 5.2        posix      -lc_r           Y
+dnl                    posix      -lkse           Y
+dnl                    posix      -lthr           Y
 dnl
-dnl FreeBSD 4.0,4.10  posix       -lc_r           Y      OK
+dnl FreeBSD 4.0,4.10   posix      -lc_r           Y      OK
 dnl
-dnl NetBSD 1.6        --
+dnl NetBSD 1.6         --
 dnl
-dnl OpenBSD 3.4       posix       -lpthread       Y      OK
+dnl OpenBSD 3.4        posix      -lpthread       Y      OK
 dnl
-dnl MacOS X 10.[123]  posix       -lpthread       Y      OK
+dnl Mac OS X 10.[123]  posix      -lpthread       Y      OK
 dnl
-dnl Solaris 7,8,9     posix       -lpthread       Y      Sol 7,8: 0.0; Sol 9: 
OK
-dnl                   solaris     -lthread        Y      Sol 7,8: 0.0; Sol 9: 
OK
+dnl Solaris 7,8,9      posix      -lpthread       Y      Sol 7,8: 0.0; Sol 9: 
OK
+dnl                    solaris    -lthread        Y      Sol 7,8: 0.0; Sol 9: 
OK
 dnl
-dnl HP-UX 11          posix       -lpthread       N (cc) OK
+dnl HP-UX 11           posix      -lpthread       N (cc) OK
 dnl                                               Y (gcc)
 dnl
-dnl IRIX 6.5          posix       -lpthread       Y      0.5
+dnl IRIX 6.5           posix      -lpthread       Y      0.5
 dnl
-dnl AIX 4.3,5.1       posix       -lpthread       N      AIX 4: 0.5; AIX 5: OK
+dnl AIX 4.3,5.1        posix      -lpthread       N      AIX 4: 0.5; AIX 5: OK
 dnl
-dnl OSF/1 4.0,5.1     posix       -pthread (cc)   N      OK
+dnl OSF/1 4.0,5.1      posix      -pthread (cc)   N      OK
 dnl                               -lpthread (gcc) Y
 dnl
-dnl Cygwin            posix       -lpthread       Y      OK
+dnl Cygwin             posix      -lpthread       Y      OK
 dnl
-dnl Any of the above  pth         -lpth                  0.0
+dnl Any of the above   pth        -lpth                  0.0
 dnl
-dnl Mingw             windows                     N      OK
+dnl Mingw              windows                    N      OK
 dnl
-dnl BeOS 5            --
+dnl BeOS 5             --
 dnl
 dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
 dnl turned off:
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index b88da76..6415bfb 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
-# serial 6
+# serial 7
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
 ])
 
-dnl Define HAVE_STRUCT_TIMESPEC if 'struct timespec' is declared
+dnl Check whether 'struct timespec' is declared
 dnl in time.h, sys/time.h, or pthread.h.
 
 AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4
index c3579fb..9ddbd01 100644
--- a/gl/m4/time_r.m4
+++ b/gl/m4/time_r.m4
@@ -17,7 +17,7 @@ AC_DEFUN([gl_TIME_R],
 
   dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
   dnl not defined.
-  AC_CHECK_DECLS_ONCE([localtime_r])
+  AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]])
   if test $ac_cv_have_decl_localtime_r = no; then
     HAVE_DECL_LOCALTIME_R=0
   fi
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index 7b24d39..a7d4d8c 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,4 +1,4 @@
-# visibility.m4 serial 4 (gettext-0.18.2)
+# visibility.m4 serial 5 (gettext-0.18.2)
 dnl Copyright (C) 2005, 2008, 2010-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ dnl __attribute__((__visibility__("hidden"))) and
 dnl __attribute__((__visibility__("default"))).
 dnl Does *not* test for __visibility__("protected") - which has tricky
 dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
-dnl MacOS X.
+dnl Mac OS X.
 dnl Does *not* test for __visibility__("internal") - which has processor
 dnl dependent semantics.
 dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index 308a175..815fd43 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -401,7 +401,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, 
arguments *a)
                       cp++;
                     }
 #if defined __APPLE__ && defined __MACH__
-                  /* On MacOS X 10.3, PRIdMAX is defined as "qd".
+                  /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
                      We cannot change it to "lld" because PRIdMAX must also
                      be understood by the system's printf routines.  */
                   else if (*cp == 'q')
diff --git a/gl/signal.in.h b/gl/signal.in.h
index e0f0554..8fb1ad1 100644
--- a/gl/signal.in.h
+++ b/gl/signal.in.h
@@ -55,7 +55,7 @@
 #ifndef address@hidden@_SIGNAL_H
 #define address@hidden@_SIGNAL_H
 
-/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare
+/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare
    pthread_sigmask in <pthread.h>, not in <signal.h>.
    But avoid namespace pollution on glibc systems.*/
 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
@@ -197,7 +197,7 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
 
 /* Test whether a given signal is contained in a signal set.  */
 # if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X.  */
+/* This function is defined as a macro on Mac OS X.  */
 #  if defined __cplusplus && defined GNULIB_NAMESPACE
 #   undef sigismember
 #  endif
@@ -210,7 +210,7 @@ _GL_CXXALIASWARN (sigismember);
 
 /* Initialize a signal set to the empty set.  */
 # if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X.  */
+/* This function is defined as a macro on Mac OS X.  */
 #  if defined __cplusplus && defined GNULIB_NAMESPACE
 #   undef sigemptyset
 #  endif
@@ -222,7 +222,7 @@ _GL_CXXALIASWARN (sigemptyset);
 
 /* Add a signal to a signal set.  */
 # if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X.  */
+/* This function is defined as a macro on Mac OS X.  */
 #  if defined __cplusplus && defined GNULIB_NAMESPACE
 #   undef sigaddset
 #  endif
@@ -235,7 +235,7 @@ _GL_CXXALIASWARN (sigaddset);
 
 /* Remove a signal from a signal set.  */
 # if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X.  */
+/* This function is defined as a macro on Mac OS X.  */
 #  if defined __cplusplus && defined GNULIB_NAMESPACE
 #   undef sigdelset
 #  endif
@@ -248,7 +248,7 @@ _GL_CXXALIASWARN (sigdelset);
 
 /* Fill a signal set with all possible signals.  */
 # if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X.  */
+/* This function is defined as a macro on Mac OS X.  */
 #  if defined __cplusplus && defined GNULIB_NAMESPACE
 #   undef sigfillset
 #  endif
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 59c00d5..e2a0eb1 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -83,7 +83,7 @@
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
-   MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+   Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
    relies on the system <stdint.h> definitions, so include
    <sys/types.h> after @address@hidden  */
 #if @HAVE_SYS_TYPES_H@ && ! defined _AIX
diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h
index 4935795..920b4d4 100644
--- a/gl/stdio-impl.h
+++ b/gl/stdio-impl.h
@@ -28,7 +28,7 @@
 
 #include <errno.h>                             /* For detecting Plan9.  */
 
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, MacOS X, Cygwin */
+#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, 
DragonFly, Mac OS X, Cygwin */
 
 # if defined __DragonFly__          /* DragonFly */
   /* See 
<http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.
  */
@@ -66,7 +66,7 @@
       /* More fields, not relevant here.  */
     };
 #  define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else                                         /* FreeBSD, NetBSD <= 1.5Z, 
DragonFly, MacOS X, Cygwin */
+# else                                         /* FreeBSD, NetBSD <= 1.5Z, 
DragonFly, Mac OS X, Cygwin */
 #  define fp_ub fp_->_ub
 # endif
 
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index b546133..1d67ec6 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -87,8 +87,8 @@ struct random_data
 #endif
 
 #if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined 
GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined 
__WIN32__) && ! defined __CYGWIN__)
-/* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
-/* On MacOS X 10.5, only <unistd.h> declares mkstemps.  */
+/* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
+/* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
 /* But avoid namespace pollution on glibc systems and native Windows.  */
 # include <unistd.h>
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index 214d75d..0aee2a1 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -63,7 +63,7 @@
 
 /* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
    of 'struct timeval', and no definition of this type.
-   Also, MacOS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
+   Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
    in <sys/time.h>.
    But avoid namespace pollution on glibc systems.  */
 # ifndef __GLIBC__
diff --git a/gl/tests/init.sh b/gl/tests/init.sh
index f525a7c..5f6e638 100644
--- a/gl/tests/init.sh
+++ b/gl/tests/init.sh
@@ -411,8 +411,7 @@ path_prepend_ ()
     case $path_dir_ in
       '') fail_ "invalid path dir: '$1'";;
       /*) abs_path_dir_=$path_dir_;;
-      *) abs_path_dir_=`cd "$initial_cwd_/$path_dir_" && echo "$PWD"` \
-           || fail_ "invalid path dir: $path_dir_";;
+      *) abs_path_dir_=$initial_cwd_/$path_dir_;;
     esac
     case $abs_path_dir_ in
       *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
@@ -448,7 +447,7 @@ setup_ ()
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
     || fail_ "failed to create temporary directory in $initial_cwd_"
-  cd "$test_dir_"
+  cd "$test_dir_" || fail_ "failed to cd to temporary directory"
 
   # As autoconf-generated configure scripts do, ensure that IFS
   # is defined initially, so that saving and restoring $IFS works.
diff --git a/gl/tests/minus-zero.h b/gl/tests/minus-zero.h
index 491cef3..b3c8dd2 100644
--- a/gl/tests/minus-zero.h
+++ b/gl/tests/minus-zero.h
@@ -24,7 +24,7 @@
 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f.
    ICC 10.0 has a bug when optimizing the expression -zero.
    The expression -FLT_MIN * FLT_MIN does not work when cross-compiling
-   to PowerPC on MacOS X 10.5.  */
+   to PowerPC on Mac OS X 10.5.  */
 #if defined __hpux || defined __sgi || defined __ICC
 static float
 compute_minus_zerof (void)
@@ -42,7 +42,7 @@ float minus_zerof = -0.0f;
 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
    ICC 10.0 has a bug when optimizing the expression -zero.
    The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
-   to PowerPC on MacOS X 10.5.  */
+   to PowerPC on Mac OS X 10.5.  */
 #if defined __hpux || defined __sgi || defined __ICC
 static double
 compute_minus_zerod (void)
@@ -61,7 +61,7 @@ double minus_zerod = -0.0;
    IRIX cc can't put -0.0L into .data, but can compute at runtime.
    ICC 10.0 has a bug when optimizing the expression -zero.
    The expression -LDBL_MIN * LDBL_MIN does not work when cross-compiling
-   to PowerPC on MacOS X 10.5.  */
+   to PowerPC on Mac OS X 10.5.  */
 #if defined __hpux || defined __sgi || defined __ICC
 static long double
 compute_minus_zerol (void)
diff --git a/gl/tests/stat.c b/gl/tests/stat.c
index 1fc633e..7599540 100644
--- a/gl/tests/stat.c
+++ b/gl/tests/stat.c
@@ -29,6 +29,7 @@
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # if _GL_WINDOWS_64_BIT_ST_SIZE
+#  undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
 #  define stat _stati64
 #  define REPLACE_FUNC_STAT_DIR 1
 #  undef REPLACE_FUNC_STAT_FILE
diff --git a/gl/tests/test-alloca-opt.c b/gl/tests/test-alloca-opt.c
index 4e814c6..6b9a4d7 100644
--- a/gl/tests/test-alloca-opt.c
+++ b/gl/tests/test-alloca-opt.c
@@ -44,7 +44,7 @@ main ()
     {
       /* Try various values.
          n = 0 gave a crash on Alpha with gcc-2.5.8.
-         Some versions of MacOS X have a stack size limit of 512 KB.  */
+         Some versions of Mac OS X have a stack size limit of 512 KB.  */
       func (34);
       func (134);
       func (399);
diff --git a/gl/tests/test-malloca.c b/gl/tests/test-malloca.c
index d7732c3..9c7109c 100644
--- a/gl/tests/test-malloca.c
+++ b/gl/tests/test-malloca.c
@@ -45,7 +45,7 @@ main ()
     {
       /* Try various values.
          n = 0 gave a crash on Alpha with gcc-2.5.8.
-         Some versions of MacOS X have a stack size limit of 512 KB.  */
+         Some versions of Mac OS X have a stack size limit of 512 KB.  */
       func (34);
       func (134);
       func (399);
diff --git a/gl/tests/test-select.h b/gl/tests/test-select.h
index 9fe998c..1169e59 100644
--- a/gl/tests/test-select.h
+++ b/gl/tests/test-select.h
@@ -265,7 +265,7 @@ test_bad_fd (select_fn my_select)
 #if !(defined __osf__ || defined WINDOWS_NATIVE)
   int fd;
 
-  /* On Linux, MacOS X, *BSD, values of fd like 99 or 399 are discarded
+  /* On Linux, Mac OS X, *BSD, values of fd like 99 or 399 are discarded
      by the kernel early and therefore do *not* lead to EBADF, as required
      by POSIX.  */
 # if defined __linux__ || (defined __APPLE__ && defined __MACH__) || defined 
__FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
diff --git a/gl/tests/test-time.c b/gl/tests/test-time.c
index acf3d2d..11a4208 100644
--- a/gl/tests/test-time.c
+++ b/gl/tests/test-time.c
@@ -26,7 +26,7 @@
 struct timespec t1;
 #if 0
 /* POSIX:2008 does not require pid_t in <time.h> unconditionally, and indeed
-   it's missing on MacOS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw.  */
+   it's missing on Mac OS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw.  */
 pid_t t2;
 #endif
 
diff --git a/gl/timespec.h b/gl/timespec.h
index 388ddb8..a587079 100644
--- a/gl/timespec.h
+++ b/gl/timespec.h
@@ -65,9 +65,12 @@ timespec_sign (struct timespec a)
   return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
 }
 
-struct timespec timespec_add (struct timespec, struct timespec);
-struct timespec timespec_sub (struct timespec, struct timespec);
-struct timespec dtotimespec (double);
+struct timespec timespec_add (struct timespec, struct timespec)
+  _GL_ATTRIBUTE_CONST;
+struct timespec timespec_sub (struct timespec, struct timespec)
+  _GL_ATTRIBUTE_CONST;
+struct timespec dtotimespec (double)
+  _GL_ATTRIBUTE_CONST;
 
 /* Return an approximation to A, of type 'double'.  */
 static inline double
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 9115486..e904e51 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -1318,7 +1318,7 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
 _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
                                     _GL_ARG_NONNULL ((1)));
 # endif
-/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5
+/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
    and FreeBSD 6.4 the second parameter is int.  On Solaris 11
    2011-10, the first parameter is not const.  */
 _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 0ebddf1..0261661 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -275,7 +275,7 @@ decimal_point_char (void)
 {
   const char *point;
   /* Determine it in a multithread-safe way.  We know nl_langinfo is
-     multithread-safe on glibc systems and MacOS X systems, but is not required
+     multithread-safe on glibc systems and Mac OS X systems, but is not 
required
      to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
      localeconv() is rarely multithread-safe.  */
 #  if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined 
__APPLE__ && defined __MACH__))
diff --git a/maint.mk b/maint.mk
index 11cb6a6..d5af750 100644
--- a/maint.mk
+++ b/maint.mk
@@ -61,7 +61,7 @@ endif
 # (i.e., with no $(srcdir) prefix), this definition is careful to
 # remove any $(srcdir) prefix, and to restore what it removes.
 _sc_excl = \
-  $(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$)
+  $(or $(exclude_file_name_regexp--$@),^$$)
 VC_LIST_EXCEPT = \
   $(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
        | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
@@ -187,9 +187,11 @@ syntax-check: $(local-check)
 #
 #  in_vc_files | in_files
 #
-#     grep-E-style regexp denoting the files to check.  If no files
-#     are specified the default are all the files that are under
-#     version control.
+#     grep-E-style regexp selecting the files to check.  For in_vc_files,
+#     the regexp is used to select matching files from the list of all
+#     version-controlled files; for in_files, it's from the names printed
+#     by "find $(srcdir)".  When neither is specified, use all files that
+#     are under version control.
 #
 #  containing | non_containing
 #
@@ -261,7 +263,7 @@ define _sc_search_regexp
    : Filter by file name;                                              \
    if test -n "$$in_files"; then                                       \
      files=$$(find $(srcdir) | grep -E "$$in_files"                    \
-              | grep -Ev '$(exclude_file_name_regexp--$@)');           \
+              | grep -Ev '$(_sc_excl)');                               \
    else                                                                        
\
      files=$$($(VC_LIST_EXCEPT));                                      \
      if test -n "$$in_vc_files"; then                                  \
@@ -775,6 +777,11 @@ sc_prohibit_always_true_header_tests:
        '  with the corresponding gnulib module, they are always true') \
          $(_sc_search_regexp)
 
+sc_prohibit_defined_have_decl_tests:
+       @prohibit='#[    ]*if(n?def|.*\<defined)\>[      (]+HAVE_DECL_' \
+       halt='$(ME): HAVE_DECL macros are always defined'               \
+         $(_sc_search_regexp)
+
 # ==================================================================
 gl_other_headers_ ?= \
   intprops.h   \
@@ -1059,7 +1066,7 @@ sc_makefile_at_at_check:
          && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-check: NEWS
-       if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS              \
+       if sed -n $(news-check-lines-spec)p $<                          \
            | grep -E $(news-check-regexp) >/dev/null; then             \
          :;                                                            \
        else                                                            \
@@ -1214,13 +1221,22 @@ sc_prohibit_path_max_allocation:
 
 sc_vulnerable_makefile_CVE-2009-4029:
        @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
-       in_files=$$(find $(srcdir) -name Makefile.in)                   \
+       in_files=(^\|/)Makefile\\.in$$                                  \
        halt=$$(printf '%s\n'                                           \
          'the above files are vulnerable; beware of running'           \
          '  "make dist*" rules, and upgrade to fixed automake'         \
          '  see http://bugzilla.redhat.com/542609 for details')        \
          $(_sc_search_regexp)
 
+sc_vulnerable_makefile_CVE-2012-3386:
+       @prohibit='chmod a\+w \$$\(distdir\)'                           \
+       in_files=(^\|/)Makefile\\.in$$                                  \
+       halt=$$(printf '%s\n'                                           \
+         'the above files are vulnerable; beware of running'           \
+         '  "make distcheck", and upgrade to fixed automake'           \
+         '  see http://bugzilla.redhat.com/CVE-2012-3386 for details') \
+         $(_sc_search_regexp)
+
 vc-diff-check:
        (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
        if test -s vc-diffs; then                               \
@@ -1242,7 +1258,7 @@ bootstrap-tools ?= autoconf,automake,gnulib
 gpg_key_ID ?= \
   $$(git cat-file tag v$(VERSION) \
      | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null \
-     | awk '/^\[GNUPG:\] ERRSIG / {print $3; exit}')
+     | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
 
 translation_project_ ?= address@hidden
 
@@ -1268,6 +1284,7 @@ announcement: NEWS ChangeLog $(rel-files)
            --prev=$(PREV_VERSION)                                      \
            --curr=$(VERSION)                                           \
            --gpg-key-id=$(gpg_key_ID)                                  \
+           --srcdir=$(srcdir)                                          \
            --news=$(srcdir)/NEWS                                       \
            --bootstrap-tools=$(bootstrap-tools)                        \
            $$(case ,$(bootstrap-tools), in (*,gnulib,*)                \
@@ -1367,7 +1384,7 @@ release-prep:
        fi
        echo $(VERSION) > $(prev_version_file)
        $(MAKE) update-NEWS-hash
-       perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' NEWS
+       perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' 
$(srcdir)/NEWS
        $(emit-commit-log) > .ci-msg
        $(VC) commit -F .ci-msg -a
        rm .ci-msg
diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c
index c069515..b620723 100644
--- a/src/benchmark-cipher.c
+++ b/src/benchmark-cipher.c
@@ -69,7 +69,7 @@ cipher_mac_bench (int algo, int mac_algo, int size)
   key.data = _key;
   key.size = keysize;
 
-  printf ("Checking %s with %s (%dkb payload)... ", gnutls_cipher_get_name 
(algo),
+  printf ("Checking %s with %s (%dkb payload)...\n", gnutls_cipher_get_name 
(algo),
       gnutls_mac_get_name(mac_algo), size);
   fflush (stdout);
 
@@ -140,7 +140,7 @@ cipher_bench (int algo, int size, int aead)
   key.data = _key;
   key.size = keysize;
 
-  printf ("Checking %s (%dkb payload)... ", gnutls_cipher_get_name (algo),
+  printf ("Checking %s (%dkb payload)...\n", gnutls_cipher_get_name (algo),
           size);
   fflush (stdout);
 
@@ -185,7 +185,7 @@ mac_bench (int algo, int size)
     return;
   memset (_key, 0xf0, blocksize);
 
-  printf ("Checking %s (%dkb payload)... ", gnutls_mac_get_name (algo), size);
+  printf ("Checking %s (%dkb payload)...\n", gnutls_mac_get_name (algo), size);
   fflush (stdout);
 
   start_benchmark(&st);
diff --git a/src/benchmark-tls.c b/src/benchmark-tls.c
index b941c5c..37a2a32 100644
--- a/src/benchmark-tls.c
+++ b/src/benchmark-tls.c
@@ -30,6 +30,7 @@
 #include <errno.h>
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
+#include <math.h>
 
 #define fail(...) \
        { \
@@ -214,7 +215,7 @@ static void test_ciphersuite(const char *cipher_prio, int 
size)
 
     HANDSHAKE(client, server);
 
-    fprintf(stdout, "Testing %s with %d packet size: ",
+    fprintf(stdout, "Testing %s with %d packet size...\n",
             gnutls_cipher_suite_get_name(gnutls_kx_get(server),
                                          gnutls_cipher_get(server),
                                          gnutls_mac_get(server)), size);
@@ -250,6 +251,7 @@ static void test_ciphersuite(const char *cipher_prio, int 
size)
     while (benchmark_must_finish == 0);
 
     stop_benchmark(&st, NULL);
+    fprintf(stdout, "\n");
 
     gnutls_bye(client, GNUTLS_SHUT_WR);
     gnutls_bye(server, GNUTLS_SHUT_WR);
@@ -264,6 +266,41 @@ static void test_ciphersuite(const char *cipher_prio, int 
size)
 
 }
 
+static
+double calc_avg(unsigned int *diffs, unsigned int diffs_size)
+{
+double avg = 0;
+unsigned int i;
+
+  for(i=0;i<diffs_size;i++)
+    avg += diffs[i];
+    
+  avg /= diffs_size;
+
+  return avg;
+}
+
+static
+double calc_sstdev(unsigned int *diffs, unsigned int diffs_size, double avg)
+{
+double sum = 0, d;
+unsigned int i;
+
+  for (i=0;i<diffs_size;i++) {
+    d = ((double)diffs[i] - avg);
+    d *= d;
+    
+    sum += d;
+  }
+  sum /= diffs_size - 1;
+  
+  return sum;
+}
+
+
+unsigned int diffs[32*1024];
+unsigned int diffs_size = 0;
+
 static void test_ciphersuite_kx(const char *cipher_prio)
 {
     /* Server stuff. */
@@ -281,6 +318,8 @@ static void test_ciphersuite_kx(const char *cipher_prio)
     /* Need to enable anonymous KX specifically. */
     int ret;
     struct benchmark_st st;
+    struct timespec tr_start, tr_stop;
+    double avg, sstddev;
 
     /* Init server */
     gnutls_certificate_allocate_credentials(&s_certcred);
@@ -298,9 +337,15 @@ static void test_ciphersuite_kx(const char *cipher_prio)
     gnutls_certificate_set_x509_key_mem (s_certcred, &server_ecc_cert, 
&server_ecc_key,
                                          GNUTLS_X509_FMT_PEM);
 
+    /* Init client */
+    gnutls_anon_allocate_client_credentials(&c_anoncred);
+    gnutls_certificate_allocate_credentials(&c_certcred);
+
     start_benchmark(&st);
 
     do {
+        gettime(&tr_start);
+        
         gnutls_init(&server, GNUTLS_SERVER);
         ret = gnutls_priority_set_direct(server, cipher_prio, &str);
         if (ret < 0) {
@@ -314,10 +359,6 @@ static void test_ciphersuite_kx(const char *cipher_prio)
         gnutls_transport_set_ptr(server, (gnutls_transport_ptr_t) server);
         reset_buffers();
 
-        /* Init client */
-        gnutls_anon_allocate_client_credentials(&c_anoncred);
-        gnutls_certificate_allocate_credentials(&c_certcred);
-
         gnutls_init(&client, GNUTLS_CLIENT);
 
         ret = gnutls_priority_set_direct(client, cipher_prio, &str);
@@ -342,13 +383,24 @@ static void test_ciphersuite_kx(const char *cipher_prio)
         gnutls_deinit(client);
         gnutls_deinit(server);
 
+        gettime(&tr_stop);
+
+        diffs[diffs_size++] = timespec_sub_ms(&tr_stop, &tr_start);
+        if (diffs_size > sizeof(diffs))
+          abort();
+
         st.size += 1;
     }
     while (benchmark_must_finish == 0);
 
-    fprintf(stdout, "Tested %s: ", suite);
+    fprintf(stdout, "Benchmarked %s.\n", suite);
     stop_benchmark(&st, "transactions");
 
+    avg = calc_avg(diffs, diffs_size);
+    sstddev = calc_sstdev(diffs, diffs_size, avg);
+
+    printf("  Average time: %.2f ms, sample variance: %.2f\n\n", avg, sstddev);
+
     gnutls_anon_free_client_credentials(c_anoncred);
     gnutls_anon_free_server_credentials(s_anoncred);
 
@@ -364,7 +416,7 @@ void benchmark_tls(int debug_level, int ciphers)
 
     if (ciphers != 0)
       {
-        printf("Testing throughput in cipher/MAC combinations:\n");
+        printf("Testing throughput in cipher/MAC combinations:\n\n");
 
         test_ciphersuite(PRIO_ARCFOUR_128_MD5, 1024);
         test_ciphersuite(PRIO_ARCFOUR_128_MD5, 4096);
@@ -388,7 +440,7 @@ void benchmark_tls(int debug_level, int ciphers)
       }
     else
       {
-        printf("\nTesting key exchanges (RSA/DH bits: %d, EC bits: %d):\n", 
rsa_bits, ec_bits);
+        printf("\nTesting key exchanges (RSA/DH bits: %d, EC bits: %d):\n\n", 
rsa_bits, ec_bits);
         test_ciphersuite_kx(PRIO_DH);
         test_ciphersuite_kx(PRIO_ECDH);
         test_ciphersuite_kx(PRIO_ECDHE_ECDSA);
diff --git a/src/benchmark.c b/src/benchmark.c
index 398c732..8ab3f8c 100644
--- a/src/benchmark.c
+++ b/src/benchmark.c
@@ -142,14 +142,14 @@ double stop_benchmark(struct benchmark_st * st, const 
char* metric)
   if (metric == NULL)
     { /* assume bytes/sec */
       value2human (st->size, secs, &ddata, &dspeed, imetric);
-      printf ("Processed %.2f %s in %.2f secs: ", ddata, imetric, secs);
+      printf ("  Processed %.2f %s in %.2f secs: ", ddata, imetric, secs);
       printf ("%.2f %s/sec\n", dspeed, imetric);
     }
   else
     {
       ddata = (double) st->size;
       dspeed = ddata / secs;
-      printf ("Processed %.2f %s in %.2f secs: ", ddata, metric, secs);
+      printf ("  Processed %.2f %s in %.2f secs: ", ddata, metric, secs);
       printf ("%.2f %s/sec\n", dspeed, metric);
     }
 
diff --git a/src/benchmark.h b/src/benchmark.h
index 40bd602..bcc07c7 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -47,3 +47,9 @@ extern int benchmark_must_finish;
 void start_benchmark(struct benchmark_st * st);
 double stop_benchmark(struct benchmark_st * st, const char* metric);
 
+inline static unsigned int
+timespec_sub_ms (struct timespec *a, struct timespec *b)
+{
+  return (a->tv_sec * 1000 + a->tv_nsec / (1000 * 1000) -
+          (b->tv_sec * 1000 + b->tv_nsec / (1000 * 1000)));
+}


hooks/post-receive
-- 
GNU gnutls



reply via email to

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