summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-09-04 15:16:35 +0200
committerLudovic Courtès <ludo@gnu.org>2010-09-04 15:16:35 +0200
commit9157d901024558ca2cb2a59d21f26b7f897714cd (patch)
treef6174b78e2213e49df81a47417f83ca6c1c8807b
parentfb0b64c12a40529a03c22481570a11457076b7f9 (diff)
downloadguile-9157d901024558ca2cb2a59d21f26b7f897714cd.tar.gz
Use Gnulib's `stat-time' module; update Gnulib.
This updates Gnulib files to v0.0-4207-gc82b481. * m4/gnulib-cache.m4: Add `stat-time'.
-rwxr-xr-xbuild-aux/gendocs.sh26
-rw-r--r--lib/Makefile.am17
-rw-r--r--lib/canonicalize-lgpl.c8
-rw-r--r--lib/duplocale.c4
-rw-r--r--lib/malloc.c7
-rw-r--r--lib/malloca.c3
-rw-r--r--lib/stat-time.h187
-rw-r--r--lib/stdio.in.h2
-rw-r--r--lib/stdlib.in.h29
-rw-r--r--lib/striconveh.c22
-rw-r--r--lib/string.in.h52
-rw-r--r--lib/unistd.in.h2
-rw-r--r--m4/codeset.m412
-rw-r--r--m4/duplocale.m432
-rw-r--r--m4/environ.m416
-rw-r--r--m4/fcntl-o.m48
-rw-r--r--m4/gnulib-cache.m43
-rw-r--r--m4/gnulib-comp.m46
-rw-r--r--m4/hostent.m412
-rw-r--r--m4/iconv.m484
-rw-r--r--m4/iconv_open.m49
-rw-r--r--m4/include_next.m411
-rw-r--r--m4/intmax_t.m413
-rw-r--r--m4/inttypes_h.m417
-rw-r--r--m4/ld-version-script.m44
-rw-r--r--m4/lib-ld.m419
-rw-r--r--m4/lib-link.m439
-rw-r--r--m4/libunistring.m421
-rw-r--r--m4/locale_h.m416
-rw-r--r--m4/malloc.m445
-rw-r--r--m4/mbrlen.m427
-rw-r--r--m4/mbrtowc.m438
-rw-r--r--m4/printf.m4736
-rw-r--r--m4/servent.m412
-rw-r--r--m4/size_max.m414
-rw-r--r--m4/socklen.m47
-rw-r--r--m4/sockpfaf.m43
-rw-r--r--m4/ssize_t.m412
-rw-r--r--m4/stat-time.m485
-rw-r--r--m4/stat.m44
-rw-r--r--m4/stdarg.m422
-rw-r--r--m4/stdbool.m4128
-rw-r--r--m4/stdint.m414
-rw-r--r--m4/stdint_h.m415
-rw-r--r--m4/stdlib_h.m412
-rw-r--r--m4/visibility.m423
-rw-r--r--m4/wchar_t.m412
-rw-r--r--m4/wint_t.m412
-rw-r--r--maint.mk10
49 files changed, 1230 insertions, 682 deletions
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 8cab8f6cd..e219df3a6 100755
--- a/build-aux/gendocs.sh
+++ b/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-05-04.09
+scriptversion=2010-07-26.16
# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
@@ -44,7 +44,7 @@ unset use_texi2html
version="gendocs.sh $scriptversion
-Copyright 2009 Free Software Foundation, Inc.
+Copyright 2010 Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
@@ -95,16 +95,16 @@ If a manual's Texinfo sources are spread across several directories,
first copy or symlink all Texinfo sources into a single directory.
(Part of the script's work is to make a tar.gz of the sources.)
-You can set the environment variables MAKEINFO, TEXI2DVI, and DVIPS to
-control the programs that get executed, and GENDOCS_TEMPLATE_DIR to
-control where the gendocs_template file is looked for. (With --docbook,
-the environment variables DOCBOOK2HTML, DOCBOOK2PDF, DOCBOOK2PS, and
-DOCBOOK2TXT are also respected.)
+You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, and
+DVIPS to control the programs that get executed, and
+GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is
+looked for. With --docbook, the environment variables DOCBOOK2HTML,
+DOCBOOK2PDF, DOCBOOK2PS, and DOCBOOK2TXT are also respected.
-By default, makeinfo is run in the default (English) locale, since
-that's the language of most Texinfo manuals. If you happen to have a
-non-English manual and non-English web site, see the SETLANG setting
-in the source.
+By default, makeinfo and texi2dvi are run in the default (English)
+locale, since that's the language of most Texinfo manuals. If you
+happen to have a non-English manual and non-English web site, see the
+SETLANG setting in the source.
Email bug reports or enhancement requests to bug-texinfo@gnu.org.
"
@@ -192,7 +192,7 @@ info_tgz_size=`calcsize $outdir/$PACKAGE.info.tar.gz`
# do not mv the info files, there's no point in having them available
# separately on the web.
-cmd="${TEXI2DVI} \"$srcfile\""
+cmd="$SETLANG ${TEXI2DVI} \"$srcfile\""
echo "Generating dvi ... ($cmd)"
eval "$cmd"
@@ -208,7 +208,7 @@ gzip -f -9 $PACKAGE.dvi
dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
mv $PACKAGE.dvi.gz $outdir/
-cmd="${TEXI2DVI} --pdf \"$srcfile\""
+cmd="$SETLANG ${TEXI2DVI} --pdf \"$srcfile\""
echo "Generating pdf ... ($cmd)"
eval "$cmd"
pdf_size=`calcsize $PACKAGE.pdf`
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1a7eb9d41..dded76e2e 100644
--- a/lib/Makefile.am
+++ b/lib/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=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stat-time stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
@@ -796,6 +796,13 @@ EXTRA_libgnu_la_SOURCES += stat.c
## end gnulib module stat
+## begin gnulib module stat-time
+
+
+EXTRA_DIST += stat-time.h
+
+## end gnulib module stat-time
+
## begin gnulib module stdarg
BUILT_SOURCES += $(STDARG_H)
@@ -1022,6 +1029,7 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \
-e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
-e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
-e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
@@ -1046,13 +1054,12 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
-e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
-e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
+ -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
-e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
- -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
-e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
- -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
@@ -1061,7 +1068,6 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
- -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
@@ -1072,9 +1078,12 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
+ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index 9979eda2c..ec55f2619 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -51,6 +51,12 @@
# include "pathmax.h"
# include "malloca.h"
# if HAVE_GETCWD
+# if IN_RELOCWRAPPER
+ /* When building the relocatable program wrapper, use the system's getcwd
+ function, not the gnulib override, otherwise we would get a link error.
+ */
+# undef getcwd
+# endif
# ifdef VMS
/* We want the directory in Unix syntax, not in VMS syntax. */
# define __getcwd(buf, max) getcwd (buf, max, 0)
@@ -62,6 +68,8 @@
# endif
# define __readlink readlink
# define __set_errno(e) errno = (e)
+/* Use the system functions, not the gnulib overrides in this file. */
+# undef malloc
# ifndef MAXSYMLINKS
# ifdef SYMLOOP_MAX
# define MAXSYMLINKS SYMLOOP_MAX
diff --git a/lib/duplocale.c b/lib/duplocale.c
index 857f545cd..23527b1da 100644
--- a/lib/duplocale.c
+++ b/lib/duplocale.c
@@ -32,7 +32,9 @@ locale_t
rpl_duplocale (locale_t locale)
{
/* Work around crash in the duplocale function in glibc < 2.12.
- See <http://sourceware.org/bugzilla/show_bug.cgi?id=10969>. */
+ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
+ Also, on AIX 7.1, duplocale(LC_GLOBAL_LOCALE) returns (locale_t)0 with
+ errno set to EINVAL. */
if (locale == LC_GLOBAL_LOCALE)
{
/* Create a copy of the locale by fetching the name of each locale
diff --git a/lib/malloc.c b/lib/malloc.c
index 614320c43..c8d76c335 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -21,8 +21,11 @@
#include <config.h>
/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
#ifdef malloc
-# define NEED_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
# undef malloc
+/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */
+#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
#endif
/* Specification. */
@@ -41,7 +44,7 @@ rpl_malloc (size_t n)
{
void *result;
-#ifdef NEED_MALLOC_GNU
+#if NEED_MALLOC_GNU
if (n == 0)
n = 1;
#endif
diff --git a/lib/malloca.c b/lib/malloca.c
index 39baa5e25..5eb9e12dc 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -21,6 +21,9 @@
/* Specification. */
#include "malloca.h"
+/* Use the system functions, not the gnulib overrides in this file. */
+#undef malloc
+
/* The speed critical point in this file is freea() applied to an alloca()
result: it must be fast, to match the speed of alloca(). The speed of
mmalloca() and freea() in the other case are not critical, because they
diff --git a/lib/stat-time.h b/lib/stat-time.h
new file mode 100644
index 000000000..1cb73ab11
--- /dev/null
+++ b/lib/stat-time.h
@@ -0,0 +1,187 @@
+/* stat-related time functions.
+
+ Copyright (C) 2005, 2007, 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 Lesser 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 Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef STAT_TIME_H
+#define STAT_TIME_H 1
+
+#include <sys/stat.h>
+#include <time.h>
+
+/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
+ struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
+ ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
+ if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim
+ for access, status change, data modification, or birth (creation)
+ time respectively.
+
+ These macros are private to stat-time.h. */
+#if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+# ifdef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# else
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
+# endif
+#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec)
+#endif
+
+/* Return the nanosecond component of *ST's access time. */
+static inline long int
+get_stat_atime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_atim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_atim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's status change time. */
+static inline long int
+get_stat_ctime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_ctim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_ctim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's data modification time. */
+static inline long int
+get_stat_mtime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_mtim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_mtim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's birth time. */
+static inline long int
+get_stat_birthtime_ns (struct stat const *st)
+{
+# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+ return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
+# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+ return STAT_TIMESPEC_NS (st, st_birthtim);
+# else
+ /* Avoid a "parameter unused" warning. */
+ (void) st;
+ return 0;
+# endif
+}
+
+/* Return *ST's access time. */
+static inline struct timespec
+get_stat_atime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_atim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_atime;
+ t.tv_nsec = get_stat_atime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's status change time. */
+static inline struct timespec
+get_stat_ctime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_ctim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = get_stat_ctime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's data modification time. */
+static inline struct timespec
+get_stat_mtime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_mtim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_mtime;
+ t.tv_nsec = get_stat_mtime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's birth time, if available; otherwise return a value
+ with negative tv_nsec. */
+static inline struct timespec
+get_stat_birthtime (struct stat const *st)
+{
+ struct timespec t;
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
+ t = STAT_TIMESPEC (st, st_birthtim);
+#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+ t.tv_sec = st->st_birthtime;
+ t.tv_nsec = st->st_birthtimensec;
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* Woe32 native platforms (but not Cygwin) put the "file creation
+ time" in st_ctime (!). See
+ <http://msdn2.microsoft.com/de-de/library/14h5k7ff(VS.80).aspx>. */
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = 0;
+#else
+ /* Birth time is not supported. Set tv_sec to avoid undefined behavior. */
+ t.tv_sec = -1;
+ t.tv_nsec = -1;
+ /* Avoid a "parameter unused" warning. */
+ (void) st;
+#endif
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
+ /* FreeBSD and NetBSD sometimes signal the absence of knowledge by
+ using zero. Attempt to work around this problem. Alas, this can
+ report failure even for valid time stamps. Also, NetBSD
+ sometimes returns junk in the birth time fields; work around this
+ bug if it it is detected. There's no need to detect negative
+ tv_nsec junk as negative tv_nsec already indicates an error. */
+ if (t.tv_sec == 0 || 1000000000 <= t.tv_nsec)
+ t.tv_nsec = -1;
+#endif
+
+ return t;
+}
+
+#endif
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index ca61fd684..d39b7dd52 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -661,7 +661,7 @@ _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, ...));
+_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
# endif
# define GNULIB_overrides_printf 1
# else
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 3839ff341..6834a3e1f 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -74,6 +74,12 @@ struct random_data
# include <unistd.h>
#endif
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+# define __attribute__(Spec) /* empty */
+# endif
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
@@ -95,6 +101,23 @@ struct random_data
#endif
+#if @GNULIB__EXIT@
+/* Terminate the current process with the given return code, without running
+ the 'atexit' handlers. */
+# if !@HAVE__EXIT@
+_GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
+# endif
+_GL_CXXALIAS_SYS (_Exit, void, (int status));
+_GL_CXXALIASWARN (_Exit);
+#elif defined GNULIB_POSIXCHECK
+# undef _Exit
+# if HAVE_RAW_DECL__EXIT
+_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
+ "use gnulib module _Exit for portability");
+# endif
+#endif
+
+
#if @GNULIB_ATOLL@
/* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */
@@ -112,7 +135,7 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
#endif
#if @GNULIB_CALLOC_POSIX@
-# if !@HAVE_CALLOC_POSIX@
+# if @REPLACE_CALLOC@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef calloc
# define calloc rpl_calloc
@@ -218,7 +241,7 @@ _GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
#endif
#if @GNULIB_MALLOC_POSIX@
-# if !@HAVE_MALLOC_POSIX@
+# if @REPLACE_MALLOC@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef malloc
# define malloc rpl_malloc
@@ -477,7 +500,7 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
#if @GNULIB_REALLOC_POSIX@
-# if !@HAVE_REALLOC_POSIX@
+# if @REPLACE_REALLOC@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef realloc
# define realloc rpl_realloc
diff --git a/lib/striconveh.c b/lib/striconveh.c
index ae10f3c1c..8db6677a5 100644
--- a/lib/striconveh.c
+++ b/lib/striconveh.c
@@ -970,19 +970,23 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
if (result == tmpbuf)
{
size_t memsize = length + extra_alloc;
- char *memory;
- memory = (char *) malloc (memsize > 0 ? memsize : 1);
- if (memory != NULL)
- {
- memcpy (memory, tmpbuf, length);
- result = memory;
- }
+ if (*resultp != NULL && *lengthp >= memsize)
+ result = *resultp;
else
{
- errno = ENOMEM;
- return -1;
+ char *memory;
+
+ memory = (char *) malloc (memsize > 0 ? memsize : 1);
+ if (memory != NULL)
+ result = memory;
+ else
+ {
+ errno = ENOMEM;
+ return -1;
+ }
}
+ memcpy (result, tmpbuf, length);
}
else if (result != *resultp && length + extra_alloc < allocated)
{
diff --git a/lib/string.in.h b/lib/string.in.h
index 75deca015..21045fe99 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -41,10 +41,12 @@
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
# define __attribute__(Spec) /* empty */
# endif
+#endif
/* The attribute __pure__ was added in gcc 2.96. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-# define __pure__ /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
#endif
@@ -62,13 +64,13 @@
# define memchr rpl_memchr
# endif
_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
# else
# if ! @HAVE_MEMCHR@
_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -102,7 +104,8 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
_GL_FUNCDECL_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len));
@@ -111,7 +114,8 @@ _GL_CXXALIAS_RPL (memmem, void *,
_GL_FUNCDECL_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
# endif
_GL_CXXALIAS_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
@@ -152,7 +156,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
#if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@
_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -182,7 +186,7 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
#if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@
_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -229,6 +233,7 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
@@ -272,7 +277,7 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
#if @GNULIB_STRCHRNUL@
# if ! @HAVE_STRCHRNUL@
_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -306,6 +311,10 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+ /* strdup exists as a function and as a macro. Get rid of the macro. */
+# undef strdup
+# endif
# if !(@HAVE_DECL_STRDUP@ || defined strdup)
_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
# endif
@@ -378,13 +387,13 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
# define strnlen rpl_strnlen
# endif
_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
# else
# if ! @HAVE_DECL_STRNLEN@
_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
@@ -414,7 +423,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
#if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@
_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -514,7 +523,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
# define strstr rpl_strstr
# endif
_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
# else
@@ -556,14 +565,16 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
# endif
_GL_FUNCDECL_RPL (strcasestr, char *,
(const char *haystack, const char *needle)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strcasestr, char *,
(const char *haystack, const char *needle));
# else
# if ! @HAVE_STRCASESTR@
_GL_FUNCDECL_SYS (strcasestr, char *,
(const char *haystack, const char *needle)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const char * strcasestr (const char *, const char *); }
@@ -764,11 +775,10 @@ _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
#if @GNULIB_MBSPCASECMP@
/* Compare the initial segment of the character string STRING consisting of
at most mbslen (PREFIX) characters with the character string PREFIX,
- ignoring case, returning less than, equal to or greater than zero if this
- initial segment is lexicographically less than, equal to or greater than
- PREFIX.
- Note: This function may, in multibyte locales, return 0 if STRING is of
- smaller length than PREFIX!
+ ignoring case. If the two match, return a pointer to the first byte
+ after this prefix in STRING. Otherwise, return NULL.
+ Note: This function may, in multibyte locales, return non-NULL if STRING
+ is of smaller length than PREFIX!
Unlike strncasecmp(), this function works correctly in multibyte
locales. */
_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 89d01539e..005ae9786 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -1097,7 +1097,7 @@ _GL_CXXALIASWARN (readlinkat);
# undef readlinkat
# if HAVE_RAW_DECL_READLINKAT
_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
- "use gnulib module symlinkat for portability");
+ "use gnulib module readlinkat for portability");
# endif
#endif
diff --git a/m4/codeset.m4 b/m4/codeset.m4
index a53c04260..f722b2e86 100644
--- a/m4/codeset.m4
+++ b/m4/codeset.m4
@@ -1,4 +1,4 @@
-# codeset.m4 serial 4 (gettext-0.18)
+# codeset.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,10 +9,12 @@ dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
- [AC_TRY_LINK([#include <langinfo.h>],
- [char* cs = nl_langinfo(CODESET); return !cs;],
- [am_cv_langinfo_codeset=yes],
- [am_cv_langinfo_codeset=no])
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <langinfo.h>]],
+ [[char* cs = nl_langinfo(CODESET); return !cs;]])],
+ [am_cv_langinfo_codeset=yes],
+ [am_cv_langinfo_codeset=no])
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
diff --git a/m4/duplocale.m4 b/m4/duplocale.m4
index a444bfc52..4fc613757 100644
--- a/m4/duplocale.m4
+++ b/m4/duplocale.m4
@@ -1,5 +1,5 @@
-# duplocale.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# duplocale.m4 serial 4
+dnl Copyright (C) 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,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,30 +12,42 @@ AC_DEFUN([gl_FUNC_DUPLOCALE],
if test $ac_cv_func_duplocale = yes; then
dnl Check against glibc bug where duplocale crashes.
dnl See <http://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
+ dnl Also, on AIX 7.1, duplocale(LC_GLOBAL_LOCALE) returns (locale_t)0 with
+ dnl errno set to EINVAL.
AC_REQUIRE([gl_LOCALE_H])
AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works],
[gl_cv_func_duplocale_works],
- [AC_TRY_RUN([
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#if HAVE_XLOCALE_H
# include <xlocale.h>
#endif
int main ()
{
- (void) duplocale (LC_GLOBAL_LOCALE);
+ if (duplocale (LC_GLOBAL_LOCALE) == (locale_t)0)
+ return 1;
return 0;
-}], [gl_cv_func_duplocale_works=yes], [gl_cv_func_duplocale_works=no],
- [dnl Guess it works except on glibc < 2.12.
- AC_EGREP_CPP([Unlucky GNU user], [
+}]])],
+ [gl_cv_func_duplocale_works=yes],
+ [gl_cv_func_duplocale_works=no],
+ [dnl Guess it works except on glibc < 2.12 and AIX.
+ case "$host_os" in
+ aix*) gl_cv_func_duplocale_works="guessing no";;
+ *-gnu*)
+ AC_EGREP_CPP([Unlucky GNU user], [
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)
Unlucky GNU user
#endif
#endif
- ],
- [gl_cv_func_duplocale_works="guessing no"],
- [gl_cv_func_duplocale_works="guessing yes"])
+ ],
+ [gl_cv_func_duplocale_works="guessing no"],
+ [gl_cv_func_duplocale_works="guessing yes"])
+ ;;
+ *) gl_cv_func_duplocale_works="guessing yes";;
+ esac
])
])
case "$gl_cv_func_duplocale_works" in
diff --git a/m4/environ.m4 b/m4/environ.m4
index 5f50d6e3b..b9dc2ef27 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,4 +1,4 @@
-# environ.m4 serial 3
+# environ.m4 serial 5
dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,14 +22,16 @@ AC_DEFUN([gt_CHECK_VAR_DECL],
define([gt_cv_var], [gt_cv_var_]$2[_declaration])
AC_MSG_CHECKING([if $2 is properly declared])
AC_CACHE_VAL([gt_cv_var], [
- AC_TRY_COMPILE([$1
- extern struct { int foo; } $2;],
- [$2.foo = 1;],
- gt_cv_var=no,
- gt_cv_var=yes)])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1
+ extern struct { int foo; } $2;]],
+ [[$2.foo = 1;]])],
+ [gt_cv_var=no],
+ [gt_cv_var=yes])])
AC_MSG_RESULT([$gt_cv_var])
if test $gt_cv_var = yes; then
- AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1,
+ AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
[Define if you have the declaration of $2.])
fi
undefine([gt_cv_var])
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index d416a61c8..1adacc8ab 100644
--- a/m4/fcntl-o.m4
+++ b/m4/fcntl-o.m4
@@ -1,4 +1,4 @@
-# fcntl-o.m4 serial 1
+# fcntl-o.m4 serial 2
dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,11 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_FCNTL_O_FLAGS],
[
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+ dnl AC_GNU_SOURCE.
+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+ [AC_REQUIRE([AC_GNU_SOURCE])])
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 97018535f..9c59c62fd 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stat-time stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
@@ -50,6 +50,7 @@ gl_MODULES([
locale
maintainer-makefile
putenv
+ stat-time
stdlib
strcase
strftime
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index bbaa17ec5..37f95ce00 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -98,6 +98,7 @@ AC_DEFUN([gl_EARLY],
# Code from module socklen:
# Code from module ssize_t:
# Code from module stat:
+ # Code from module stat-time:
# Code from module stdarg:
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
@@ -308,6 +309,9 @@ AC_DEFUN([gl_INIT],
# Code from module stat:
gl_FUNC_STAT
gl_SYS_STAT_MODULE_INDICATOR([stat])
+ # Code from module stat-time:
+ gl_STAT_TIME
+ gl_STAT_BIRTHTIME
# Code from module stdarg:
gl_STDARG_H
# Code from module stdbool:
@@ -608,6 +612,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/safe-write.h
lib/size_max.h
lib/snprintf.c
+ lib/stat-time.h
lib/stat.c
lib/stdarg.in.h
lib/stdbool.in.h
@@ -721,6 +726,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/socklen.m4
m4/sockpfaf.m4
m4/ssize_t.m4
+ m4/stat-time.m4
m4/stat.m4
m4/stdarg.m4
m4/stdbool.m4
diff --git a/m4/hostent.m4 b/m4/hostent.m4
index 111104112..7104b3089 100644
--- a/m4/hostent.m4
+++ b/m4/hostent.m4
@@ -1,5 +1,5 @@
-# hostent.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# hostent.m4 serial 2
+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,
dnl with or without modifications, as long as this notice is preserved.
@@ -28,12 +28,16 @@ AC_DEFUN([gl_HOSTENT],
[gl_cv_w32_gethostbyname=no
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <stddef.h>
-], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes])
+ ]],
+ [[gethostbyname(NULL);]])],
+ [gl_cv_w32_gethostbyname=yes])
LIBS="$gl_save_LIBS"
])
if test "$gl_cv_w32_gethostbyname" = "yes"; then
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index e2041b9b4..425145c0a 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 11 (gettext-0.18.1)
+# iconv.m4 serial 15 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -30,27 +30,35 @@ AC_DEFUN([AM_ICONV_LINK],
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first
- dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+ dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
- [iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);],
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);]])],
[am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
- [iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);],
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);]])],
[am_cv_lib_iconv=yes]
[am_cv_func_iconv=yes])
LIBS="$am_save_LIBS"
@@ -58,12 +66,14 @@ AC_DEFUN([AM_ICONV_LINK],
])
if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
- dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
+ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+ dnl Solaris 10.
am_save_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <iconv.h>
#include <string.h>
int main ()
@@ -106,6 +116,24 @@ int main ()
return 1;
}
}
+ /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ const char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+ return 1;
+ }
+ }
#if 0 /* This bug could be worked around by the caller. */
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
{
@@ -138,11 +166,17 @@ int main ()
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
return 1;
return 0;
-}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
- [case "$host_os" in
+}]])],
+ [am_cv_func_iconv_works=yes],
+ [am_cv_func_iconv_works=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
*) am_cv_func_iconv_works="guessing yes" ;;
- esac])
+ esac
+changequote([,])dnl
+ ])
LIBS="$am_save_LIBS"
])
case "$am_cv_func_iconv_works" in
@@ -183,15 +217,20 @@ m4_define([gl_iconv_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
- [[AC_DEFUN(
- [$1], [$2])]]))
+ [m4_ifdef([gl_00GNULIB],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]])]))
gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL([am_cv_proto_iconv], [
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#include <stdlib.h>
#include <iconv.h>
extern
@@ -203,7 +242,10 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
#else
size_t iconv();
#endif
-], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
+ ]],
+ [[]])],
+ [am_cv_proto_iconv_arg1=""],
+ [am_cv_proto_iconv_arg1="const"])
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([
diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4
index 60f62ca51..8219ecf5c 100644
--- a/m4/iconv_open.m4
+++ b/m4/iconv_open.m4
@@ -1,4 +1,4 @@
-# iconv_open.m4 serial 7
+# iconv_open.m4 serial 8
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,
@@ -63,7 +63,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF],
[
save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <iconv.h>
#include <errno.h>
#include <stdio.h>
@@ -209,7 +210,9 @@ int main ()
ASSERT (iconv_close (cd) == 0);
}
return 0;
-}], [gl_cv_func_iconv_supports_utf=yes], [gl_cv_func_iconv_supports_utf=no],
+}]])],
+ [gl_cv_func_iconv_supports_utf=yes],
+ [gl_cv_func_iconv_supports_utf=no],
[
dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index c7e0672f6..51a719b0a 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,4 +1,4 @@
-# include_next.m4 serial 14
+# include_next.m4 serial 15
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -68,10 +68,11 @@ EOF
EOF
gl_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
- AC_COMPILE_IFELSE([#include <conftest.h>],
+dnl We intentionally avoid using AC_LANG_SOURCE here.
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
[gl_cv_have_include_next=yes],
[CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
- AC_COMPILE_IFELSE([#include <conftest.h>],
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
[gl_cv_have_include_next=buggy],
[gl_cv_have_include_next=no])
])
@@ -185,3 +186,7 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
[$gl_next_as_first_directive])
AS_VAR_POPDEF([gl_next_header])])
])
+
+# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
+# this fallback is safe for all earlier autoconf versions.
+m4_define_default([AC_LANG_DEFINES_PROVIDED])
diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4
index 975caac50..493e4a932 100644
--- a/m4/intmax_t.m4
+++ b/m4/intmax_t.m4
@@ -1,4 +1,4 @@
-# intmax_t.m4 serial 7
+# intmax_t.m4 serial 8
dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert.
-AC_PREREQ([2.13])
+AC_PREREQ([2.53])
# Define intmax_t to 'long' or 'long long'
# if it is not already defined in <stdint.h> or <inttypes.h>.
@@ -38,7 +38,9 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
- [AC_TRY_COMPILE([
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#include <stddef.h>
#include <stdlib.h>
#if HAVE_STDINT_H_WITH_UINTMAX
@@ -47,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
#if HAVE_INTTYPES_H_WITH_UINTMAX
#include <inttypes.h>
#endif
-], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+ ]],
+ [[intmax_t x = -1; return !x;]])],
+ [gt_cv_c_intmax_t=yes],
+ [gt_cv_c_intmax_t=no])])
if test $gt_cv_c_intmax_t = yes; then
AC_DEFINE([HAVE_INTMAX_T], [1],
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
index 782d77ed8..9d8f92692 100644
--- a/m4/inttypes_h.m4
+++ b/m4/inttypes_h.m4
@@ -1,4 +1,4 @@
-# inttypes_h.m4 serial 9
+# inttypes_h.m4 serial 10
dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,12 +12,15 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
[
AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
- [AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <inttypes.h>],
- [uintmax_t i = (uintmax_t) -1; return !i;],
- [gl_cv_header_inttypes_h=yes],
- [gl_cv_header_inttypes_h=no])])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/types.h>
+#include <inttypes.h>
+ ]],
+ [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+ [gl_cv_header_inttypes_h=yes],
+ [gl_cv_header_inttypes_h=no])])
if test $gl_cv_header_inttypes_h = yes; then
AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4
index 43c1ef12f..8fd8c8995 100644
--- a/m4/ld-version-script.m4
+++ b/m4/ld-version-script.m4
@@ -1,4 +1,4 @@
-# ld-version-script.m4 serial 1
+# ld-version-script.m4 serial 2
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,
@@ -34,7 +34,7 @@ VERS_2 {
global: sym;
} VERS_1;
EOF
- AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[have_ld_version_script=yes], [have_ld_version_script=no])
rm -f conftest.map
LDFLAGS="$save_LDFLAGS"
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
index ebb30528b..294db72e1 100644
--- a/m4/lib-ld.m4
+++ b/m4/lib-ld.m4
@@ -1,4 +1,4 @@
-# lib-ld.m4 serial 4 (gettext-0.18)
+# lib-ld.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 1996-2003, 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,
@@ -31,15 +31,14 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
fi
ac_prog=ld
if test "$GCC" = yes; then
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index c73bd8e3a..2ea9d6d07 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 21 (gettext-0.18)
+# lib-link.m4 serial 25 (gettext-0.18.2)
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
- pushdef([Name],[translit([$1],[./-], [___])])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
AC_LIB_LINKFLAGS_BODY([$1], [$2])
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@@ -58,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
- pushdef([Name],[translit([$1],[./-], [___])])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
dnl accordingly.
@@ -85,7 +85,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
*" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
*) LIBS="$LIB[]NAME $LIBS" ;;
esac
- AC_TRY_LINK([$3], [$4],
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[$3]], [[$4]])],
[ac_cv_lib[]Name=yes],
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
LIBS="$ac_save_LIBS"
@@ -157,15 +158,15 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
dnl macro call that searches for libname.
AC_DEFUN([AC_LIB_FROMPACKAGE],
[
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
define([acl_frompackage_]NAME, [$2])
popdef([NAME])
pushdef([PACK],[$2])
- pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
define([acl_libsinpackage_]PACKUP,
- m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
+ m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
popdef([PACKUP])
popdef([PACK])
])
@@ -178,14 +179,14 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
- pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
dnl Autoconf >= 2.61 supports dots in --with options.
- pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
+ pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
@@ -242,7 +243,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
names_already_handled="$names_already_handled $name"
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
dnl or AC_LIB_HAVE_LINKFLAGS call.
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
diff --git a/m4/libunistring.m4 b/m4/libunistring.m4
index 7e920e5d9..61b7cc9e6 100644
--- a/m4/libunistring.m4
+++ b/m4/libunistring.m4
@@ -1,4 +1,4 @@
-# libunistring.m4 serial 9
+# libunistring.m4 serial 11
dnl Copyright (C) 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,
@@ -25,8 +25,11 @@ m4_define([gl_libunistring_AC_DEFUN],
m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
- [[AC_DEFUN(
- [$1], [$2])]]))
+ [m4_ifdef([gl_00GNULIB],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]])]))
gl_libunistring_AC_DEFUN([gl_LIBUNISTRING],
[
AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE])
@@ -103,9 +106,10 @@ AC_DEFUN([gl_LIBUNISTRING_CORE],
dnl Use other tests to distinguish them.
if test $gl_libunistring_hexversion = 9; then
dnl Version 0.9.2 introduced the header <unistring/cdefs.h>.
- AC_TRY_COMPILE([#include <unistring/cdefs.h>], ,
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <unistring/cdefs.h>]], [[]])],
[gl_cv_libunistring_version092=true],
- [gl_cv_libunistring_version092=false]);
+ [gl_cv_libunistring_version092=false])
if $gl_cv_libunistring_version092; then
dnl Version 0.9.3 changed a comment in <unistr.h>.
gl_ABSOLUTE_HEADER_ONE([unistr.h])
@@ -119,8 +123,11 @@ AC_DEFUN([gl_LIBUNISTRING_CORE],
fi
else
dnl Version 0.9.1 introduced the type casing_suffix_context_t.
- AC_TRY_COMPILE([#include <unicase.h>
- casing_suffix_context_t ct;], ,
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unicase.h>
+ casing_suffix_context_t ct;]],
+ [[]])],
[gl_cv_libunistring_version091=true],
[gl_cv_libunistring_version091=false])
if $gl_cv_libunistring_version091; then
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 18a119b8e..8f4f3d440 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,4 +1,4 @@
-# locale_h.m4 serial 10
+# locale_h.m4 serial 11
dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,8 +18,11 @@ AC_DEFUN([gl_LOCALE_H],
AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001],
[gl_cv_header_locale_h_posix2001],
- [AC_TRY_COMPILE([#include <locale.h>
-int x = LC_MESSAGES;], [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ int x = LC_MESSAGES;]],
+ [[]])],
[gl_cv_header_locale_h_posix2001=yes],
[gl_cv_header_locale_h_posix2001=no])])
@@ -32,8 +35,11 @@ int x = LC_MESSAGES;], [],
dnl itself, we assume that <xlocale.h> will do so.
AC_CACHE_CHECK([whether locale.h defines locale_t],
[gl_cv_header_locale_has_locale_t],
- [AC_TRY_COMPILE([#include <locale.h>
-locale_t x;], [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ locale_t x;]],
+ [[]])],
[gl_cv_header_locale_has_locale_t=yes],
[gl_cv_header_locale_has_locale_t=no])
])
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index 910ac9229..7a749254a 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,25 +1,40 @@
-# malloc.m4 serial 9
+# malloc.m4 serial 12
dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+# gl_FUNC_MALLOC_GNU
+# ------------------
+# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
+# it is not.
+AC_DEFUN([gl_FUNC_MALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
+ _AC_FUNC_MALLOC_IF(
+ [AC_DEFINE([HAVE_MALLOC_GNU], [1],
+ [Define to 1 if your system has a GNU libc compatible 'malloc'
+ function, and to 0 otherwise.])],
+ [AC_DEFINE([HAVE_MALLOC_GNU], [0])
+ gl_REPLACE_MALLOC
+ ])
+])
+
# gl_FUNC_MALLOC_POSIX
# --------------------
# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
# fails), and replace malloc if it is not.
AC_DEFUN([gl_FUNC_MALLOC_POSIX],
[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
if test $gl_cv_func_malloc_posix = yes; then
- HAVE_MALLOC_POSIX=1
AC_DEFINE([HAVE_MALLOC_POSIX], [1],
[Define if the 'malloc' function is POSIX compliant.])
else
- AC_LIBOBJ([malloc])
- HAVE_MALLOC_POSIX=0
+ gl_REPLACE_MALLOC
fi
- AC_SUBST([HAVE_MALLOC_POSIX])
])
# Test whether malloc, realloc, calloc are POSIX compliant,
@@ -32,10 +47,20 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
dnl It is too dangerous to try to allocate a large amount of memory:
dnl some systems go to their knees when you do that. So assume that
dnl all Unix implementations of the function are POSIX compliant.
- AC_TRY_COMPILE([],
- [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- choke me
- #endif
- ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[]],
+ [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ choke me
+ #endif
+ ]])],
+ [gl_cv_func_malloc_posix=yes],
+ [gl_cv_func_malloc_posix=no])
])
])
+
+AC_DEFUN([gl_REPLACE_MALLOC],
+[
+ AC_LIBOBJ([malloc])
+ REPLACE_MALLOC=1
+])
diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4
index 6049d1a19..731c2b318 100644
--- a/m4/mbrlen.m4
+++ b/m4/mbrlen.m4
@@ -1,5 +1,5 @@
-# mbrlen.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# mbrlen.m4 serial 3
+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,
dnl with or without modifications, as long as this notice is preserved.
@@ -45,14 +45,15 @@ AC_DEFUN([gl_MBRLEN_INCOMPLETE_STATE],
dnl is present.
changequote(,)dnl
case "$host_os" in
- # Guess no on AIX and OSF/1.
- osf*) gl_cv_func_mbrlen_incomplete_state="guessing no" ;;
- # Guess yes otherwise.
- *) gl_cv_func_mbrlen_incomplete_state="guessing yes" ;;
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrlen_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrlen_incomplete_state="guessing yes" ;;
esac
changequote([,])dnl
if test $LOCALE_JA != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -69,7 +70,7 @@ int main ()
return 1;
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrlen_incomplete_state=yes],
[gl_cv_func_mbrlen_incomplete_state=no],
[])
@@ -102,7 +103,8 @@ changequote(,)dnl
esac
changequote([,])dnl
if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -137,7 +139,7 @@ int main ()
}
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrlen_retval=yes],
[gl_cv_func_mbrlen_retval=no],
[])
@@ -167,7 +169,8 @@ changequote(,)dnl
esac
changequote([,])dnl
if test $LOCALE_ZH_CN != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -183,7 +186,7 @@ int main ()
return 1;
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrlen_nul_retval=yes],
[gl_cv_func_mbrlen_nul_retval=no],
[])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index 606de5c9f..28b9c43bf 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 17
+# mbrtowc.m4 serial 18
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -101,14 +101,15 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
dnl is present.
changequote(,)dnl
case "$host_os" in
- # Guess no on AIX and OSF/1.
- osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
- # Guess yes otherwise.
- *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
esac
changequote([,])dnl
if test $LOCALE_JA != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -126,7 +127,7 @@ int main ()
return 1;
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrtowc_incomplete_state=yes],
[gl_cv_func_mbrtowc_incomplete_state=no],
[:])
@@ -156,7 +157,8 @@ changequote(,)dnl
esac
changequote([,])dnl
if test $LOCALE_ZH_CN != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <stdlib.h>
#include <string.h>
@@ -178,7 +180,7 @@ int main ()
return 1;
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrtowc_sanitycheck=yes],
[gl_cv_func_mbrtowc_sanitycheck=no],
[:])
@@ -208,7 +210,8 @@ changequote(,)dnl
esac
changequote([,])dnl
if test $LOCALE_FR_UTF8 != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -228,7 +231,10 @@ int main ()
return 1;
}
return 0;
-}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:])
+}]])],
+ [gl_cv_func_mbrtowc_null_arg=yes],
+ [gl_cv_func_mbrtowc_null_arg=no],
+ [:])
fi
])
])
@@ -258,7 +264,8 @@ changequote(,)dnl
esac
changequote([,])dnl
if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -295,7 +302,7 @@ int main ()
}
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrtowc_retval=yes],
[gl_cv_func_mbrtowc_retval=no],
[:])
@@ -325,7 +332,8 @@ changequote(,)dnl
esac
changequote([,])dnl
if test $LOCALE_ZH_CN != none; then
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
#include <wchar.h>
@@ -342,7 +350,7 @@ int main ()
return 1;
}
return 0;
-}],
+}]])],
[gl_cv_func_mbrtowc_nul_retval=yes],
[gl_cv_func_mbrtowc_nul_retval=no],
[:])
diff --git a/m4/printf.m4 b/m4/printf.m4
index ebca5364c..e850862c0 100644
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 33
+# printf.m4 serial 35
dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,8 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
[gl_cv_func_printf_sizes_c99],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stddef.h>
#include <stdio.h>
#include <string.h>
@@ -50,34 +51,36 @@ int main ()
|| strcmp (buf, "1.5 33") != 0)
return 1;
return 0;
-}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
- [
+}]])],
+ [gl_cv_func_printf_sizes_c99=yes],
+ [gl_cv_func_printf_sizes_c99=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # 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.
- 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.
- openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
- gl_cv_func_printf_sizes_c99="guessing no";;
- openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on Solaris >= 2.10.
- solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
- solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_printf_sizes_c99="guessing no";;
- netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_sizes_c99="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # 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.
+ 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.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_printf_sizes_c99="guessing no";;
+ openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_sizes_c99="guessing no";;
+ netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_sizes_c99="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -92,7 +95,8 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
AC_CACHE_CHECK([whether printf supports 'long double' arguments],
[gl_cv_func_printf_long_double],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[10000];
@@ -111,16 +115,18 @@ int main ()
|| strcmp (buf, "1.75 33") != 0)
return 1;
return 0;
-}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
- [
+}]])],
+ [gl_cv_func_printf_long_double=yes],
+ [gl_cv_func_printf_long_double=no],
+ [
changequote(,)dnl
- case "$host_os" in
- beos*) gl_cv_func_printf_long_double="guessing no";;
- mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
- *) gl_cv_func_printf_long_double="guessing yes";;
- esac
+ case "$host_os" in
+ beos*) gl_cv_func_printf_long_double="guessing no";;
+ mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
+ *) gl_cv_func_printf_long_double="guessing yes";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -136,7 +142,8 @@ AC_DEFUN([gl_PRINTF_INFINITE],
AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
[gl_cv_func_printf_infinite],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static int
@@ -201,32 +208,34 @@ int main ()
|| strcmp (buf, "-0") != 0)
return 1;
return 0;
-}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
- [
+}]])],
+ [gl_cv_func_printf_infinite=yes],
+ [gl_cv_func_printf_infinite=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
- # 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.
- darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
- darwin*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on HP-UX >= 11.
- hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
- hpux*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_printf_infinite="guessing no";;
- netbsd*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_infinite="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_infinite="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
+ # 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.
+ darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
+ darwin*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+ hpux*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_infinite="guessing no";;
+ netbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_infinite="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_infinite="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -252,7 +261,8 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
[gl_cv_func_printf_infinite_long_double],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
]GL_NOCRASH[
#include <float.h>
#include <stdio.h>
@@ -414,38 +424,38 @@ int main ()
}
#endif
return 0;
-}],
- [gl_cv_func_printf_infinite_long_double=yes],
- [gl_cv_func_printf_infinite_long_double=no],
- [
+}]])],
+ [gl_cv_func_printf_infinite_long_double=yes],
+ [gl_cv_func_printf_infinite_long_double=no],
+ [
changequote(,)dnl
- case "$host_cpu" in
- # Guess no on ia64, x86_64, i386.
- ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
- *)
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on FreeBSD >= 6.
- freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
- freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
- darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
- darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on HP-UX >= 11.
- hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
- hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_printf_infinite_long_double="guessing no";;
- netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_infinite_long_double="guessing no";;
- esac
- ;;
- esac
+ case "$host_cpu" in
+ # Guess no on ia64, x86_64, i386.
+ ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+ *)
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on MacOS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_infinite_long_double="guessing no";;
+ netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_infinite_long_double="guessing no";;
+ esac
+ ;;
+ esac
changequote([,])dnl
- ])
+ ])
])
;;
*)
@@ -466,7 +476,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
[gl_cv_func_printf_directive_a],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -512,26 +523,28 @@ int main ()
&& strcmp (buf, "0x8.0p-2") != 0))
return 1;
return 0;
-}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
- [
- case "$host_os" in
- # Guess yes on glibc >= 2.5 systems.
- *-gnu*)
- AC_EGREP_CPP([BZ2908], [
- #include <features.h>
- #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
- BZ2908
- #endif
- #endif
- ],
- [gl_cv_func_printf_directive_a="guessing yes"],
- [gl_cv_func_printf_directive_a="guessing no"])
- ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_directive_a="guessing no";;
- esac
- ])
+}]])],
+ [gl_cv_func_printf_directive_a=yes],
+ [gl_cv_func_printf_directive_a=no],
+ [
+ case "$host_os" in
+ # Guess yes on glibc >= 2.5 systems.
+ *-gnu*)
+ AC_EGREP_CPP([BZ2908], [
+ #include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
+ BZ2908
+ #endif
+ #endif
+ ],
+ [gl_cv_func_printf_directive_a="guessing yes"],
+ [gl_cv_func_printf_directive_a="guessing no"])
+ ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_directive_a="guessing no";;
+ esac
+ ])
])
])
@@ -546,7 +559,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
AC_CACHE_CHECK([whether printf supports the 'F' directive],
[gl_cv_func_printf_directive_f],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -563,26 +577,28 @@ int main ()
|| strcmp (buf, "1234") != 0)
return 1;
return 0;
-}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
- [
+}]])],
+ [gl_cv_func_printf_directive_f=yes],
+ [gl_cv_func_printf_directive_f=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
- # 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.
- 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.
- solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
- solaris*) gl_cv_func_printf_directive_f="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_directive_f="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
+ # 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.
+ 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.
+ solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
+ solaris*) gl_cv_func_printf_directive_f="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_directive_f="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -597,7 +613,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
AC_CACHE_CHECK([whether printf supports the 'n' directive],
[gl_cv_func_printf_directive_n],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char fmtstring[10];
@@ -614,14 +631,16 @@ int main ()
|| count != 4)
return 1;
return 0;
-}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
- [
+}]])],
+ [gl_cv_func_printf_directive_n=yes],
+ [gl_cv_func_printf_directive_n=no],
+ [
changequote(,)dnl
- case "$host_os" in
- *) gl_cv_func_printf_directive_n="guessing yes";;
- esac
+ case "$host_os" in
+ *) gl_cv_func_printf_directive_n="guessing yes";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -639,7 +658,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
AC_CACHE_CHECK([whether printf supports the 'ls' directive],
[gl_cv_func_printf_directive_ls],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
@@ -687,19 +707,21 @@ int main ()
return 1;
}
return 0;
-}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no],
- [
+}]])],
+ [gl_cv_func_printf_directive_ls=yes],
+ [gl_cv_func_printf_directive_ls=no],
+ [
changequote(,)dnl
- case "$host_os" in
- openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
- irix*) gl_cv_func_printf_directive_ls="guessing no";;
- solaris*) gl_cv_func_printf_directive_ls="guessing no";;
- cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
- beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
- *) gl_cv_func_printf_directive_ls="guessing yes";;
- esac
+ case "$host_os" in
+ openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
+ irix*) gl_cv_func_printf_directive_ls="guessing no";;
+ solaris*) gl_cv_func_printf_directive_ls="guessing no";;
+ cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
+ beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
+ *) gl_cv_func_printf_directive_ls="guessing yes";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -714,7 +736,8 @@ AC_DEFUN([gl_PRINTF_POSITIONS],
AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
[gl_cv_func_printf_positions],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
/* The string "%2$d %1$d", with dollar characters protected from the shell's
@@ -725,18 +748,20 @@ int main ()
{
sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0);
-}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
- [
+}]])],
+ [gl_cv_func_printf_positions=yes],
+ [gl_cv_func_printf_positions=no],
+ [
changequote(,)dnl
- case "$host_os" in
- netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
- gl_cv_func_printf_positions="guessing no";;
- beos*) gl_cv_func_printf_positions="guessing no";;
- mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
- *) gl_cv_func_printf_positions="guessing yes";;
- esac
+ case "$host_os" in
+ netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+ gl_cv_func_printf_positions="guessing no";;
+ beos*) gl_cv_func_printf_positions="guessing no";;
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -751,7 +776,8 @@ AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
AC_CACHE_CHECK([whether printf supports the grouping flag],
[gl_cv_func_printf_flag_grouping],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -761,17 +787,19 @@ int main ()
|| buf[strlen (buf) - 1] != '9')
return 1;
return 0;
-}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
- [
+}]])],
+ [gl_cv_func_printf_flag_grouping=yes],
+ [gl_cv_func_printf_flag_grouping=no],
+ [
changequote(,)dnl
- case "$host_os" in
- cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
- netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
- mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
- *) gl_cv_func_printf_flag_grouping="guessing yes";;
- esac
+ case "$host_os" in
+ cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
+ netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
+ mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+ *) gl_cv_func_printf_flag_grouping="guessing yes";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -787,7 +815,8 @@ AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
[gl_cv_func_printf_flag_leftadjust],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -798,7 +827,7 @@ int main ()
|| strcmp (buf, "ab c") != 0)
return 1;
return 0;
-}],
+}]])],
[gl_cv_func_printf_flag_leftadjust=yes],
[gl_cv_func_printf_flag_leftadjust=no],
[
@@ -828,7 +857,8 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO],
AC_CACHE_CHECK([whether printf supports the zero flag correctly],
[gl_cv_func_printf_flag_zero],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -839,19 +869,21 @@ int main ()
&& strcmp (buf, " infinity") != 0))
return 1;
return 0;
-}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
- [
+}]])],
+ [gl_cv_func_printf_flag_zero=yes],
+ [gl_cv_func_printf_flag_zero=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_flag_zero="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_flag_zero="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_printf_flag_zero="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -868,7 +900,8 @@ AC_DEFUN([gl_PRINTF_PRECISION],
AC_CACHE_CHECK([whether printf supports large precisions],
[gl_cv_func_printf_precision],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[5000];
@@ -881,17 +914,19 @@ int main ()
if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
return 1;
return 0;
-}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
- [
+}]])],
+ [gl_cv_func_printf_precision=yes],
+ [gl_cv_func_printf_precision=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess no only on native Win32 and BeOS systems.
- mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
- beos*) gl_cv_func_printf_precision="guessing no" ;;
- *) gl_cv_func_printf_precision="guessing yes" ;;
- esac
+ case "$host_os" in
+ # Guess no only on native Win32 and BeOS systems.
+ mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+ beos*) gl_cv_func_printf_precision="guessing no" ;;
+ *) gl_cv_func_printf_precision="guessing yes" ;;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -1031,7 +1066,8 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
[gl_cv_func_snprintf_truncation_c99],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -1042,47 +1078,49 @@ int main ()
if (memcmp (buf, "45\0DEF", 6) != 0)
return 1;
return 0;
-}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
- [
+}]])],
+ [gl_cv_func_snprintf_truncation_c99=yes],
+ [gl_cv_func_snprintf_truncation_c99=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # 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.
- 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.
- openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
- gl_cv_func_snprintf_truncation_c99="guessing no";;
- openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on HP-UX >= 11.
- hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on IRIX >= 6.5.
- irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on OSF/1 >= 5.
- osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_snprintf_truncation_c99="guessing no";;
- netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_truncation_c99="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # 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.
+ 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.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -1101,14 +1139,15 @@ dnl }
dnl ---------------------------------------------------------------------
dnl Result is gl_cv_func_snprintf_retval_c99.
-AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
+AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
[gl_cv_func_snprintf_retval_c99],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char buf[100];
@@ -1118,39 +1157,41 @@ int main ()
if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
return 1;
return 0;
-}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
- [
+}]])],
+ [gl_cv_func_snprintf_retval_c99=yes],
+ [gl_cv_func_snprintf_retval_c99=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # 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.
- 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.
- openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
- gl_cv_func_snprintf_retval_c99="guessing no";;
- openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
- solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
- aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_snprintf_retval_c99="guessing no";;
- netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_retval_c99="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # 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.
+ 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.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_retval_c99="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -1165,7 +1206,8 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
[gl_cv_func_snprintf_directive_n],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
static char fmtstring[10];
@@ -1181,40 +1223,42 @@ int main ()
if (count != 6)
return 1;
return 0;
-}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
- [
+}]])],
+ [gl_cv_func_snprintf_directive_n=yes],
+ [gl_cv_func_snprintf_directive_n=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # 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.
- 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.
- solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
- solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
- aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on IRIX >= 6.5.
- irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on OSF/1 >= 5.
- osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
- osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_snprintf_directive_n="guessing no";;
- netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_directive_n="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # 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.
+ 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.
+ solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
+ netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_snprintf_directive_n="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -1229,17 +1273,18 @@ AC_DEFUN([gl_SNPRINTF_SIZE1],
AC_CACHE_CHECK([whether snprintf respects a size of 1],
[gl_cv_func_snprintf_size1],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdio.h>
int main()
{
static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
snprintf (buf, 1, "%d", 12345);
return buf[1] != 'E';
-}],
- [gl_cv_func_snprintf_size1=yes],
- [gl_cv_func_snprintf_size1=no],
- [gl_cv_func_snprintf_size1="guessing yes"])
+}]])],
+ [gl_cv_func_snprintf_size1=yes],
+ [gl_cv_func_snprintf_size1=no],
+ [gl_cv_func_snprintf_size1="guessing yes"])
])
])
@@ -1286,7 +1331,8 @@ AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
[gl_cv_func_vsnprintf_zerosize_c99],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <stdarg.h>
#include <stdio.h>
static int my_snprintf (char *buf, int size, const char *format, ...)
@@ -1303,43 +1349,43 @@ int main()
static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
my_snprintf (buf, 0, "%d", 12345);
return buf[0] != 'D';
-}],
- [gl_cv_func_vsnprintf_zerosize_c99=yes],
- [gl_cv_func_vsnprintf_zerosize_c99=no],
- [
+}]])],
+ [gl_cv_func_vsnprintf_zerosize_c99=yes],
+ [gl_cv_func_vsnprintf_zerosize_c99=no],
+ [
changequote(,)dnl
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # 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.
- darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on Cygwin.
- cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on Solaris >= 2.6.
- solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on AIX >= 4.
- aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on IRIX >= 6.5.
- irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on NetBSD >= 3.
- netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
- gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on mingw.
- mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
- esac
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # 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.
+ darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on mingw.
+ mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ esac
changequote([,])dnl
- ])
+ ])
])
])
@@ -1401,7 +1447,7 @@ dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # .
dnl Solaris 10 . . # # # . . # . . . # . . . . . . . .
dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . .
dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
-dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
+dnl AIX 5.2, 7.1 . . # # # . . . . . . # . . . . . . . .
dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . .
dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
diff --git a/m4/servent.m4 b/m4/servent.m4
index 2ed961a43..2486511aa 100644
--- a/m4/servent.m4
+++ b/m4/servent.m4
@@ -1,5 +1,5 @@
-# servent.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# servent.m4 serial 2
+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,
dnl with or without modifications, as long as this notice is preserved.
@@ -30,12 +30,16 @@ AC_DEFUN([gl_SERVENT],
[gl_cv_w32_getservbyname=no
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <stddef.h>
-], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes])
+ ]],
+ [[getservbyname(NULL,NULL);]])],
+ [gl_cv_w32_getservbyname=yes])
LIBS="$gl_save_LIBS"
])
if test "$gl_cv_w32_getservbyname" = "yes"; then
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index ce992db1f..f3b1a9dfb 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -1,4 +1,4 @@
-# size_max.m4 serial 9
+# size_max.m4 serial 10
dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -34,10 +34,14 @@ Found it
if test $fits_in_uint = 1; then
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
- AC_TRY_COMPILE([#include <stddef.h>
- extern size_t foo;
- extern unsigned long foo;
- ], [], [fits_in_uint=0])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ]],
+ [[]])],
+ [fits_in_uint=0])
fi
dnl We cannot use 'expr' to simplify this expression, because 'expr'
dnl works only with 'long' integers in the host environment, while we
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index 2933d4b89..d0d6baab5 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,4 +1,4 @@
-# socklen.m4 serial 7
+# socklen.m4 serial 8
dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,8 +8,9 @@ dnl From Albert Chin, Windows fixes from Simon Josefsson.
dnl Check for socklen_t: historically on BSD it is an int, and in
dnl POSIX 1g it is a type of its own, but some platforms use different
-dnl types for the argument to getsockopt, getpeername, etc. So we
-dnl have to test to find something that will work.
+dnl types for the argument to getsockopt, getpeername, etc.:
+dnl HP-UX 10.20, IRIX 6.5, Interix 3.5, BeOS.
+dnl So we have to test to find something that will work.
dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
dnl it there first. That file is included by gnulib's sys_socket.in.h, which
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
index 8a0c23603..8806705ae 100644
--- a/m4/sockpfaf.m4
+++ b/m4/sockpfaf.m4
@@ -47,6 +47,9 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
#endif]],
[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
if (&x && &y && &z) return 0;]])],
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index e0ccee3a5..e4c160b50 100644
--- a/m4/ssize_t.m4
+++ b/m4/ssize_t.m4
@@ -1,5 +1,5 @@
-# ssize_t.m4 serial 4 (gettext-0.15)
-dnl Copyright (C) 2001-2003, 2006, 2009-2010 Free Software Foundation, Inc.
+# ssize_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2001-2003, 2006, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,9 +10,11 @@ dnl Test whether ssize_t is defined.
AC_DEFUN([gt_TYPE_SSIZE_T],
[
AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
- [AC_TRY_COMPILE([#include <sys/types.h>],
- [int x = sizeof (ssize_t *) + sizeof (ssize_t);
- return !x;],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>]],
+ [[int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;]])],
[gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
if test $gt_cv_ssize_t = no; then
AC_DEFINE([ssize_t], [int],
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4
new file mode 100644
index 000000000..e653c4341
--- /dev/null
+++ b/m4/stat-time.m4
@@ -0,0 +1,85 @@
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2010 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# st_atim.tv_nsec - Linux, Solaris, Cygwin
+# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
+# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
+# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
+
+# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
+# st_birthtim - Cygwin 1.7.0+
+
+AC_DEFUN([gl_STAT_TIME],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+
+ AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+ [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+ ]],
+ [[
+ st.st_atim = ts;
+ ]])],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+ AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+ [Define to 1 if the type of the st_atim member of a struct stat is
+ struct timespec.])
+ fi],
+ [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
+
+# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
+# and NTFS (Cygwin).
+# There was a time when this field was named st_createtime (21 June
+# 2002 to 16 July 2002) But that window is very small and applied only
+# to development code, so systems still using that configuration are
+# not supported. See revisions 1.10 and 1.11 of FreeBSD's
+# src/sys/ufs/ufs/dinode.h.
+#
+AC_DEFUN([gl_STAT_BIRTHTIME],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
diff --git a/m4/stat.m4 b/m4/stat.m4
index acd32d86a..75e1d9473 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,4 +1,4 @@
-# serial 4
+# serial 5
# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
#
@@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_STAT],
mingw*) gl_cv_func_stat_dir_slash="guessing no";;
*) gl_cv_func_stat_dir_slash="guessing yes";;
esac])])
- dnl Solaris 9 mistakenly succeeds on stat("file/")
+ dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/")
dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
AC_CACHE_CHECK([whether stat handles trailing slashes on files],
[gl_cv_func_stat_file_slash],
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
index 5c87bd8b5..8a62f2e84 100644
--- a/m4/stdarg.m4
+++ b/m4/stdarg.m4
@@ -1,4 +1,4 @@
-# stdarg.m4 serial 3
+# stdarg.m4 serial 4
dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,12 +13,16 @@ AC_DEFUN([gl_STDARG_H],
NEXT_STDARG_H='<stdarg.h>'; AC_SUBST([NEXT_STDARG_H])
AC_MSG_CHECKING([for va_copy])
AC_CACHE_VAL([gl_cv_func_va_copy], [
- AC_TRY_COMPILE([#include <stdarg.h>], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
#ifndef va_copy
void (*func) (va_list, va_list) = va_copy;
#endif
-],
- [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])])
+ ]])],
+ [gl_cv_func_va_copy=yes],
+ [gl_cv_func_va_copy=no])])
AC_MSG_RESULT([$gl_cv_func_va_copy])
if test $gl_cv_func_va_copy = no; then
dnl Provide a substitute.
@@ -47,12 +51,16 @@ void (*func) (va_list, va_list) = va_copy;
dnl Provide a substitute in <config.h>, either __va_copy or as a simple
dnl assignment.
gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
- AC_TRY_COMPILE([#include <stdarg.h>], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
#ifndef __va_copy
error, bail out
#endif
-],
- [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])])
+ ]])],
+ [gl_cv_func___va_copy=yes],
+ [gl_cv_func___va_copy=no])])
if test $gl_cv_func___va_copy = yes; then
AC_DEFINE([va_copy], [__va_copy],
[Define as a macro for copying va_list variables.])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index 3d672d747..1efe59ea1 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -5,6 +5,8 @@ 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.
+#serial 3
+
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_STDBOOL_H],
@@ -31,82 +33,68 @@ AC_DEFUN([AM_STDBOOL_H],
# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf
-# have this macro built-in.
+# This version of the macro is needed in autoconf <= 2.67. Autoconf has
+# it built in since 2.60, but we want the tweaks from the 2.68 version
+# to avoid rejecting xlc and clang due to relying on extensions.
AC_DEFUN([AC_HEADER_STDBOOL],
[AC_CACHE_CHECK([for stdbool.h that conforms to C99],
[ac_cv_header_stdbool_h],
- [AC_TRY_COMPILE(
- [
- #include <stdbool.h>
- #ifndef bool
- "error: bool is not defined"
- #endif
- #ifndef false
- "error: false is not defined"
- #endif
- #if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: true is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
- #endif
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
- #endif
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <stdbool.h>
+ #ifndef bool
+ "error: bool is not defined"
+ #endif
+ #ifndef false
+ "error: false is not defined"
+ #endif
+ #if false
+ "error: false is not 0"
+ #endif
+ #ifndef true
+ "error: true is not defined"
+ #endif
+ #if true != 1
+ "error: true is not 1"
+ #endif
+ #ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+ #endif
- struct s { _Bool s: 1; _Bool t; } s;
+ struct s { _Bool s: 1; _Bool t; } s;
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- bool e = &s;
- char f[(_Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (_Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
- _Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- #if defined __xlc__ || defined __GNUC__
- /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
- reported by James Lemley on 2005-10-05; see
- http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
- This test is not quite right, since xlc is allowed to
- reject this program, as the initializer for xlcbug is
- not one of the forms that C requires support for.
- However, doing the test right would require a run-time
- test, and that would make cross-compilation harder.
- Let us hope that IBM fixes the xlc bug, and also adds
- support for this kind of constant expression. In the
- meantime, this test will reject xlc, which is OK, since
- our stdbool.h substitute should suffice. We also test
- this with GCC, where it should work, to detect more
- quickly whether someone messes up the test in the
- future. */
- char digs[] = "0123456789";
- int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
- #endif
- /* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- */
- _Bool q = true;
- _Bool *pq = &q;
- ],
- [
- *pq |= q;
- *pq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq);
- ],
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+ ]],
+ [[
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+ ]])],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
AC_CHECK_TYPES([_Bool])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 1cc57e6e9..c5e813a96 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 34
+# stdint.m4 serial 35
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -309,7 +309,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
dnl config.h.in,
dnl - extra AC_SUBST calls, so that the right substitutions are made.
m4_foreach_w([gltype], [$1],
- [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
[Define to the number of bits in type ']gltype['.])])
for gltype in $1 ; do
AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
@@ -334,7 +334,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
eval BITSIZEOF_${GLTYPE}=\$result
done
m4_foreach_w([gltype], [$1],
- [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+ [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
])
dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
@@ -347,7 +347,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
dnl config.h.in,
dnl - extra AC_SUBST calls, so that the right substitutions are made.
m4_foreach_w([gltype], [$1],
- [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
[Define to 1 if ']gltype[' is a signed integer type.])])
for gltype in $1 ; do
AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
@@ -367,7 +367,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
fi
done
m4_foreach_w([gltype], [$1],
- [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+ [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
])
dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
@@ -380,7 +380,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
dnl config.h.in,
dnl - extra AC_SUBST calls, so that the right substitutions are made.
m4_foreach_w([gltype], [$1],
- [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+ [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
[Define to l, ll, u, ul, ull, etc., as suitable for
constants of type ']gltype['.])])
for gltype in $1 ; do
@@ -419,7 +419,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
done
m4_foreach_w([gltype], [$1],
- [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+ [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
])
dnl gl_STDINT_INCLUDES
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
index b8e3c6cc7..670c0cc2b 100644
--- a/m4/stdint_h.m4
+++ b/m4/stdint_h.m4
@@ -1,4 +1,4 @@
-# stdint_h.m4 serial 8
+# stdint_h.m4 serial 9
dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,12 +12,13 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_STDINT_H],
[
AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
- [AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <stdint.h>],
- [uintmax_t i = (uintmax_t) -1; return !i;],
- [gl_cv_header_stdint_h=yes],
- [gl_cv_header_stdint_h=no])])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <stdint.h>]],
+ [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+ [gl_cv_header_stdint_h=yes],
+ [gl_cv_header_stdint_h=no])])
if test $gl_cv_header_stdint_h = yes; then
AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index dd84796d2..fc150197b 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 28
+# stdlib_h.m4 serial 30
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,
@@ -33,7 +33,7 @@ AC_DEFUN([gl_STDLIB_H],
#if HAVE_RANDOM_H
# include <random.h>
#endif
- ]], [atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp
+ ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp
mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r
setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt
unsetenv])
@@ -50,6 +50,7 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
AC_DEFUN([gl_STDLIB_H_DEFAULTS],
[
+ GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT])
GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL])
GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
@@ -75,13 +76,12 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT])
GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
- HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX])
HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
- HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX])
HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
@@ -89,7 +89,6 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
- HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
@@ -100,9 +99,12 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
+ REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+ REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
+ REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
diff --git a/m4/visibility.m4 b/m4/visibility.m4
index 077c4765e..19cd8f3d3 100644
--- a/m4/visibility.m4
+++ b/m4/visibility.m4
@@ -1,5 +1,5 @@
-# visibility.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc.
+# visibility.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2005, 2008, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -33,7 +33,8 @@ AC_DEFUN([gl_VISIBILITY],
AC_CACHE_VAL([gl_cv_cc_vis_werror], [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
- AC_TRY_COMPILE([], [],
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_cc_vis_werror=yes],
[gl_cv_cc_vis_werror=no])
CFLAGS="$gl_save_CFLAGS"])
@@ -51,13 +52,15 @@ AC_DEFUN([gl_VISIBILITY],
if test $gl_cv_cc_vis_werror = yes; then
CFLAGS="$CFLAGS -Werror"
fi
- AC_TRY_COMPILE(
- [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
- extern __attribute__((__visibility__("default"))) int exportedvar;
- extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
- extern __attribute__((__visibility__("default"))) int exportedfunc (void);
- void dummyfunc (void) {}],
- [],
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
[gl_cv_cc_visibility=yes],
[gl_cv_cc_visibility=no])
CFLAGS="$gl_save_CFLAGS"])
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index ed804e664..a133e6ad5 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,4 +1,4 @@
-# wchar_t.m4 serial 3 (gettext-0.18)
+# wchar_t.m4 serial 4 (gettext-0.18.2)
dnl Copyright (C) 2002-2003, 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,
@@ -11,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WCHAR_T],
[
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
- [AC_TRY_COMPILE([#include <stddef.h>
- wchar_t foo = (wchar_t)'\0';], ,
- [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';]],
+ [[]])],
+ [gt_cv_c_wchar_t=yes],
+ [gt_cv_c_wchar_t=no])])
if test $gt_cv_c_wchar_t = yes; then
AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
fi
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index a6c7d15cb..58ef86556 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,4 +1,4 @@
-# wint_t.m4 serial 4 (gettext-0.18)
+# wint_t.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,9 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WINT_T],
[
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
- [AC_TRY_COMPILE([
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
#include <stdio.h>
#include <time.h>
#include <wchar.h>
- wint_t foo = (wchar_t)'\0';], ,
- [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
+ wint_t foo = (wchar_t)'\0';]],
+ [[]])],
+ [gt_cv_c_wint_t=yes],
+ [gt_cv_c_wint_t=no])])
if test $gt_cv_c_wint_t = yes; then
AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
fi
diff --git a/maint.mk b/maint.mk
index 644fbb648..59e9cb58e 100644
--- a/maint.mk
+++ b/maint.mk
@@ -103,6 +103,12 @@ endif
# Override this in cfg.mk if you are using a different format in your
# NEWS file.
today = $(shell date +%Y-%m-%d)
+
+# Select which lines of NEWS are searched for $(news-check-regexp).
+# This is a sed line number spec. The default says that we search
+# lines 1..10 of NEWS for $(news-check-regexp).
+# If you want to search only line 3 or only lines 20-22, use "3" or "20,22".
+news-check-lines-spec ?= 1,10
news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
# Prevent programs like 'sort' from considering distinct strings to be equal.
@@ -874,8 +880,8 @@ sc_makefile_at_at_check:
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
news-check: NEWS
- if head $(srcdir)/NEWS | grep -E $(news-check-regexp) \
- >/dev/null; then \
+ if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS \
+ | grep -E $(news-check-regexp) >/dev/null; then \
:; \
else \
echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2; \