summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-01-07 12:02:28 +0100
committerSimon Josefsson <simon@josefsson.org>2009-01-07 12:02:28 +0100
commit73b18e6f6336324619877923ac79b31ca19b5194 (patch)
treeb3863d045ddf668ce07a4ae0eee684a0e670b154
parent27e846ea09a28e896004be9ce1d057b12f80150f (diff)
downloadgnutls-73b18e6f6336324619877923ac79b31ca19b5194.tar.gz
Update gnulib files.
-rwxr-xr-xbuild-aux/gendocs.sh54
-rw-r--r--doc/gendocs_template12
-rw-r--r--gl/Makefile.am37
-rw-r--r--gl/m4/errno_h.m48
-rw-r--r--gl/m4/extensions.m414
-rw-r--r--gl/m4/getaddrinfo.m437
-rw-r--r--gl/m4/gnulib-cache.m42
-rw-r--r--gl/m4/gnulib-comp.m44
-rw-r--r--gl/m4/inttypes_h.m412
-rw-r--r--gl/m4/lib-link.m410
-rw-r--r--gl/m4/manywarnings.m410
-rw-r--r--gl/m4/multiarch.m474
-rw-r--r--gl/m4/printf.m436
-rw-r--r--gl/m4/size_max.m414
-rw-r--r--gl/m4/stdint.m415
-rw-r--r--gl/m4/stdint_h.m412
-rw-r--r--gl/m4/wchar.m434
-rw-r--r--gl/m4/wchar_t.m410
-rw-r--r--gl/m4/wint_t.m410
-rw-r--r--gl/m4/xsize.m46
-rw-r--r--gl/stdint.in.h44
-rw-r--r--gl/stdlib.in.h4
-rw-r--r--gl/sys_select.in.h23
-rw-r--r--gl/tests/Makefile.am4
-rwxr-xr-xgl/tests/test-select-in.sh4
-rw-r--r--gl/unistd.in.h1
-rw-r--r--gl/version-etc.c4
-rw-r--r--gl/wchar.in.h191
-rw-r--r--lib/gl/Makefile.am37
-rw-r--r--lib/gl/m4/codeset.m412
-rw-r--r--lib/gl/m4/errno_h.m48
-rw-r--r--lib/gl/m4/extensions.m414
-rw-r--r--lib/gl/m4/gettext.m436
-rw-r--r--lib/gl/m4/glibc2.m414
-rw-r--r--lib/gl/m4/glibc21.m414
-rw-r--r--lib/gl/m4/gnulib-cache.m42
-rw-r--r--lib/gl/m4/gnulib-comp.m44
-rw-r--r--lib/gl/m4/iconv.m430
-rw-r--r--lib/gl/m4/intdiv0.m48
-rw-r--r--lib/gl/m4/intlmacosx.m48
-rw-r--r--lib/gl/m4/intmax.m412
-rw-r--r--lib/gl/m4/inttypes-pri.m410
-rw-r--r--lib/gl/m4/inttypes_h.m412
-rw-r--r--lib/gl/m4/lcmessage.m410
-rw-r--r--lib/gl/m4/lib-link.m410
-rw-r--r--lib/gl/m4/multiarch.m474
-rw-r--r--lib/gl/m4/nls.m46
-rw-r--r--lib/gl/m4/po.m46
-rw-r--r--lib/gl/m4/printf-posix.m49
-rw-r--r--lib/gl/m4/printf.m436
-rw-r--r--lib/gl/m4/progtest.m410
-rw-r--r--lib/gl/m4/size_max.m414
-rw-r--r--lib/gl/m4/stdint.m415
-rw-r--r--lib/gl/m4/stdint_h.m412
-rw-r--r--lib/gl/m4/threadlib.m423
-rw-r--r--lib/gl/m4/uintmax_t.m48
-rw-r--r--lib/gl/m4/visibility.m410
-rw-r--r--lib/gl/m4/wchar.m434
-rw-r--r--lib/gl/m4/wchar_t.m410
-rw-r--r--lib/gl/m4/wint_t.m410
-rw-r--r--lib/gl/m4/xsize.m46
-rw-r--r--lib/gl/stdint.in.h44
-rw-r--r--lib/gl/stdlib.in.h4
-rw-r--r--lib/gl/tests/Makefile.am2
-rw-r--r--lib/gl/unistd.in.h1
-rw-r--r--lib/gl/wchar.in.h191
-rw-r--r--libextra/gl/Makefile.am2
-rw-r--r--libextra/gl/m4/extensions.m414
-rw-r--r--libextra/gl/m4/gnulib-cache.m42
-rw-r--r--libextra/gl/m4/gnulib-comp.m42
-rw-r--r--libextra/gl/m4/lib-link.m410
71 files changed, 1167 insertions, 315 deletions
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index aded2c4d7f..ba767441ad 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,9 +2,9 @@
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
-scriptversion=2008-03-05.14
+scriptversion=2009-01-02.08
-# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -44,7 +44,7 @@ unset use_texi2html
version="gendocs.sh $scriptversion
-Copyright (C) 2007 Free Software Foundation, Inc.
+Copyright 2009 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."
@@ -57,24 +57,28 @@ See the GNU Maintainers document for a more extensive discussion:
Options:
-o OUTDIR write files into OUTDIR, instead of manual/.
+ --email ADR use ADR as contact in generated web pages.
--docbook convert to DocBook too (xml, txt, html, pdf and ps).
--html ARG pass indicated ARG to makeinfo or texi2html for HTML targets.
--texi2html use texi2html to generate HTML targets.
--help display this help and exit successfully.
--version display version information and exit successfully.
-Simple example: $prog emacs \"GNU Emacs Manual\"
+Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\"
Typical sequence:
- cd YOURPACKAGESOURCE/doc
+ cd PACKAGESOURCE/doc
wget \"$scripturl\"
wget \"$templateurl\"
- $prog YOURMANUAL \"GNU YOURMANUAL - One-line description\"
+ $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\"
Output will be in a new subdirectory \"manual\" (by default, use -o OUTDIR
to override). Move all the new files into your web CVS tree, as
explained in the Web Pages node of maintain.texi.
+Please use the --email ADDRESS option to specify your bug-reporting
+address in the generated HTML pages.
+
MANUAL-TITLE is included as part of the HTML <title> of the overall
manual/index.html file. It should include the name of the package being
documented. manual/index.html is created by substitution from the file
@@ -82,11 +86,11 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the
generic template for your own purposes.)
If you have several manuals, you'll need to run this script several
-times with different YOURMANUAL values, specifying a different output
+times with different MANUAL values, specifying a different output
directory with -o each time. Then write (by hand) an overall index.html
with links to them all.
-If a manual's texinfo sources are spread across several directories,
+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.)
@@ -98,7 +102,7 @@ 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, check the SETLANG setting
+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.
@@ -110,21 +114,23 @@ calcsize()
echo $size
}
-outdir=manual
-html=
-PACKAGE=
MANUAL_TITLE=
+PACKAGE=
+EMAIL=webmasters@gnu.org # please override with --email
+htmlarg=
+outdir=manual
while test $# -gt 0; do
case $1 in
+ --email) shift; EMAIL=$1;;
--help) echo "$usage"; exit 0;;
--version) echo "$version"; exit 0;;
-o) shift; outdir=$1;;
--docbook) docbook=yes;;
- --html) shift; html=$1;;
+ --html) shift; htmlarg=$1;;
--texi2html) use_texi2html=1;;
-*)
- echo "$0: Unknown or ambiguous option \`$1'." >&2
+ echo "$0: Unknown option \`$1'." >&2
echo "$0: Try \`--help' for more information." >&2
exit 1;;
*)
@@ -203,8 +209,10 @@ gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz
ascii_gz_size=`calcsize $outdir/$PACKAGE.txt.gz`
mv $PACKAGE.txt $outdir/
-html_split() {
- cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html --split=$1 $html --node-files \"$srcfile\""
+html_split()
+{
+ opt="--split=$1 $htmlarg --node-files"
+ cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\""
echo "Generating html by $1... ($cmd)"
eval "$cmd"
split_html_dir=$PACKAGE.html
@@ -221,7 +229,8 @@ html_split() {
}
if test -z "$use_texi2html"; then
- cmd="$SETLANG $MAKEINFO --no-split --html -o $PACKAGE.html $html \"$srcfile\""
+ opt="--no-split --html -o $PACKAGE.html $htmlarg"
+ cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
echo "Generating monolithic html... ($cmd)"
rm -rf $PACKAGE.html # in case a directory is left over
eval "$cmd"
@@ -230,7 +239,7 @@ if test -z "$use_texi2html"; then
html_mono_gz_size=`calcsize $outdir/$PACKAGE.html.gz`
mv $PACKAGE.html $outdir/
- cmd="$SETLANG $MAKEINFO --html -o $PACKAGE.html $html \"$srcfile\""
+ cmd="$SETLANG $MAKEINFO --html -o $PACKAGE.html $htmlarg \"$srcfile\""
echo "Generating html by node... ($cmd)"
eval "$cmd"
split_html_dir=$PACKAGE.html
@@ -244,7 +253,7 @@ if test -z "$use_texi2html"; then
mv ${split_html_dir}/*.html $outdir/html_node/
rmdir ${split_html_dir}
else
- cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $html \"$srcfile\""
+ cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $htmlarg \"$srcfile\""
echo "Generating monolithic html... ($cmd)"
rm -rf $PACKAGE.html # in case a directory is left over
eval "$cmd"
@@ -306,7 +315,7 @@ if test -n "$docbook"; then
mv $PACKAGE-db.pdf $outdir/
fi
-echo Writing index file...
+echo "Writing index file..."
if test -z "$use_texi2html"; then
CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d"
@@ -316,8 +325,9 @@ fi
curdate=`$SETLANG date '+%B %d, %Y'`
sed \
-e "s!%%TITLE%%!$MANUAL_TITLE!g" \
- -e "s!%%DATE%%!$curdate!g" \
+ -e "s!%%EMAIL%%!$EMAIL!g" \
-e "s!%%PACKAGE%%!$PACKAGE!g" \
+ -e "s!%%DATE%%!$curdate!g" \
-e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \
-e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \
-e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \
@@ -341,7 +351,7 @@ sed \
-e "$CONDS" \
$GENDOCS_TEMPLATE_DIR/gendocs_template >$outdir/index.html
-echo "Done! See $outdir/ subdirectory for new files."
+echo "Done, see $outdir/ subdirectory for new files."
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/doc/gendocs_template b/doc/gendocs_template
index 63a636a6e4..5a119ef7f4 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -90,16 +90,14 @@ There are also <a href="/contact/">other ways to contact</a>
the FSF.
<br />
Please send broken links and other corrections or suggestions to
-<a href="mailto:webmasters@gnu.org"><em>webmasters@gnu.org</em></a>.
+<a href="mailto:%%EMAIL%%"><em>%%EMAIL%%</em></a>.
</p>
-<p>
-Copyright &copy; 2008 Free Software Foundation, Inc.,
-</p>
-<address>51 Franklin Street, Fifth Floor, Boston, MA 02111, USA</address>
+<p>Copyright &copy; 2009 Free Software Foundation, Inc.</p>
+
<p>Verbatim copying and distribution of this entire article is
-permitted in any medium, provided this notice is preserved.
-</p>
+permitted in any medium, provided this notice is preserved.</p>
+
</div>
</div>
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 7aa2f12541..85ab1c2ed6 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -576,6 +576,7 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
-e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
@@ -1051,10 +1052,40 @@ wchar.h: wchar.in.h
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
- -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+ -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
+ -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
+ -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
+ -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
+ -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
+ -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
+ -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
+ -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
+ -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
+ -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
-e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
- -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
+ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
+ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
+ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
+ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
+ -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
+ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
+ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
+ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+ -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
+ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
+ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
+ -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
+ -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
+ -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
+ -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
+ -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
+ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index b5af07800c..22c08f07fa 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,4 +1,4 @@
-# errno_h.m4 serial 1
+# errno_h.m4 serial 2
dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -111,3 +111,9 @@ yes
AC_SUBST($1[_VALUE])
fi
])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 917af94805..611fcfdbc4 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 5 -*- Autoconf -*-
+# serial 6 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
@@ -24,6 +24,8 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
@@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
[Define to 1 if on MINIX.])
fi
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
index f1cc01da12..9655a4289b 100644
--- a/gl/m4/getaddrinfo.m4
+++ b/gl/m4/getaddrinfo.m4
@@ -1,4 +1,4 @@
-# getaddrinfo.m4 serial 18
+# getaddrinfo.m4 serial 19
dnl Copyright (C) 2004, 2005, 2006, 2007, 2008 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,8 +9,21 @@ AC_DEFUN([gl_GETADDRINFO],
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
+ GETADDRINFO_LIB=
+ gai_saved_LIBS="$LIBS"
+
+ dnl Where is getaddrinfo()?
+ dnl - On Solaris, it is in libsocket.
+ dnl - On Haiku, it is in libnetwork.
+ dnl - On BeOS, it is in libnet.
+ dnl - On native Windows, it is in ws2_32.dll.
+ dnl - Otherwise it is in libc.
+ AC_SEARCH_LIBS(getaddrinfo, [socket network net],
+ [if test "$ac_cv_search_getaddrinfo" != "none required"; then
+ GETADDRINFO_LIB="$ac_cv_search_getaddrinfo"
+ fi])
+ LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
- AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
AC_TRY_LINK([
#include <sys/types.h>
@@ -39,7 +52,8 @@ AC_DEFUN([gl_GETADDRINFO],
LIBS="$am_save_LIBS"
])
if test "$gl_cv_w32_getaddrinfo" = "yes"; then
- LIBS="$LIBS -lws2_32"
+ GETADDRINFO_LIB="-lws2_32"
+ LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
else
AC_LIBOBJ(getaddrinfo)
fi
@@ -69,7 +83,11 @@ AC_DEFUN([gl_GETADDRINFO],
AC_LIBOBJ(gai_strerror)
fi
+ LIBS="$gai_saved_LIBS"
+
gl_PREREQ_GETADDRINFO
+
+ AC_SUBST([GETADDRINFO_LIB])
])
# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c.
@@ -78,7 +96,6 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
- LIBS="$LIBS $HOSTENT_LIB $SERVENT_LIB"
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_SOCKET_FAMILIES])
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
@@ -134,4 +151,16 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
if test $ac_cv_type_struct_addrinfo = no; then
HAVE_STRUCT_ADDRINFO=0
fi
+
+ dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
+ case " $GETADDRINFO_LIB " in
+ *" $HOSTENT_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
+ esac
+
+ dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
+ case " $GETADDRINFO_LIB " in
+ *" $SERVENT_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
+ esac
])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 80ecea9309..9d969d7131 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index ea89089432..79bab7e942 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -115,6 +115,7 @@ AC_SUBST([LTALLOCA])
gl_FUNC_LSEEK
gl_UNISTD_MODULE_INDICATOR([lseek])
gl_MINMAX
+ gl_MULTIARCH
gl_HEADER_NETDB
gl_HEADER_NETINET_IN
AC_PROG_MKDIR_P
@@ -441,6 +442,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/malloc.m4
m4/manywarnings.m4
m4/minmax.m4
+ m4/multiarch.m4
m4/netdb_h.m4
m4/netinet_in_h.m4
m4/perror.m4
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
index edc8ecb2db..cf482d2875 100644
--- a/gl/m4/inttypes_h.m4
+++ b/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
-# inttypes_h.m4 serial 7
-dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+# inttypes_h.m4 serial 8
+dnl Copyright (C) 1997-2004, 2006, 2008 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.
@@ -11,15 +11,15 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
[
- AC_CACHE_CHECK([for inttypes.h], gl_cv_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)])
+ [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,
+ AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], 1,
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
fi
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index 7e07a42468..e29eead276 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 16 (gettext-0.18)
+# lib-link.m4 serial 17 (gettext-0.18)
dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -446,12 +446,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
case "$found_dir" in
*/$acl_libdirstem | */$acl_libdirstem/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
- LIB[]NAME[]_PREFIX="$basedir"
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
additional_includedir="$basedir/include"
;;
*/$acl_libdirstem2 | */$acl_libdirstem2/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
- LIB[]NAME[]_PREFIX="$basedir"
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
additional_includedir="$basedir/include"
;;
esac
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index b0c413e844..93b1315618 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -90,5 +90,15 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
; do
gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
done
+ # The following are not documented in the manual but are included in
+ # output from gcc --help=warnings.
+ for gl_manywarn_item in \
+ -Wattributes \
+ -Wcoverage-mismatch \
+ -Wmultichar \
+ -Wunused-macros \
+ ; do
+ gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+ done
$1=$gl_manywarn_set
])
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
new file mode 100644
index 0000000000..7b73e15ee9
--- /dev/null
+++ b/gl/m4/multiarch.m4
@@ -0,0 +1,74 @@
+# multiarch.m4 serial 3
+dnl Copyright (C) 2008 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.
+
+# Determine whether the compiler is or may be producing universal binaries.
+#
+# On MacOS X 10.5 and later systems, the user can create libraries and
+# executables that work on multiple system types--known as "fat" or
+# "universal" binaries--by specifying multiple '-arch' options to the
+# compiler but only a single '-arch' option to the preprocessor. Like
+# this:
+#
+# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CPP="gcc -E" CXXCPP="g++ -E"
+#
+# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
+# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
+
+AC_DEFUN([gl_MULTIARCH],
+[
+ dnl This AC_REQUIRE is not necessary in theory. It works around a bug in
+ dnl autoconf <= 2.63: AC_REQUIRE invocations inside AC_REQUIREd macros are
+ dnl being handled better than AC_REQUIRE invocations inside normally invoked
+ dnl macros.
+ AC_REQUIRE([gl_MULTIARCH_BODY])
+])
+
+AC_DEFUN([gl_MULTIARCH_BODY],
+[
+ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
+ gl_cv_c_multiarch=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+ ]])],
+ [
+ dnl Check for potential -arch flags. It is not universal unless
+ dnl there are at least two -arch flags with different values.
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+ ])
+ if test $gl_cv_c_multiarch = yes; then
+ AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
+ [Define if the compiler is building for multiple architectures of Apple platforms at once.])
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+ AC_SUBST([APPLE_UNIVERSAL_BUILD])
+])
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index df26c13ecc..474a635575 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 24
+# printf.m4 serial 25
dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -811,13 +811,15 @@ dnl Result is gl_cv_func_printf_enomem.
AC_DEFUN([gl_PRINTF_ENOMEM],
[
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_MULTIARCH])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
[gl_cv_func_printf_enomem],
[
gl_cv_func_printf_enomem="guessing no"
if test "$cross_compiling" = no; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([
]GL_NOCRASH[
changequote(,)dnl
#include <stdio.h>
@@ -866,21 +868,27 @@ int main()
}
changequote([,])dnl
])])
- if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- (./conftest
- result=$?
- if test $result != 0 && test $result != 77; then result=1; fi
- exit $result
- ) >/dev/null 2>/dev/null
- case $? in
- 0) gl_cv_func_printf_enomem="yes" ;;
- 77) gl_cv_func_printf_enomem="guessing no" ;;
- *) gl_cv_func_printf_enomem="no" ;;
- esac
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ (./conftest
+ result=$?
+ if test $result != 0 && test $result != 77; then result=1; fi
+ exit $result
+ ) >/dev/null 2>/dev/null
+ case $? in
+ 0) gl_cv_func_printf_enomem="yes" ;;
+ 77) gl_cv_func_printf_enomem="guessing no" ;;
+ *) gl_cv_func_printf_enomem="no" ;;
+ esac
+ else
+ gl_cv_func_printf_enomem="guessing no"
+ fi
+ rm -fr conftest*
else
+ dnl A universal build on Apple MacOS X platforms.
+ dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
+ dnl But we need a configuration result that is valid in both modes.
gl_cv_func_printf_enomem="guessing no"
fi
- rm -fr conftest*
fi
if test "$gl_cv_func_printf_enomem" = "guessing no"; then
changequote(,)dnl
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index 6cb4868927..e0e7b3ff95 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
-# size_max.m4 serial 6
-dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
+# size_max.m4 serial 7
+dnl Copyright (C) 2003, 2005-2006, 2008 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.
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
AC_DEFUN([gl_SIZE_MAX],
[
- AC_CHECK_HEADERS(stdint.h)
+ AC_CHECK_HEADERS([stdint.h])
dnl First test whether the system already has SIZE_MAX.
AC_MSG_CHECKING([for SIZE_MAX])
AC_CACHE_VAL([gl_cv_size_max], [
@@ -21,16 +21,16 @@ AC_DEFUN([gl_SIZE_MAX],
#ifdef SIZE_MAX
Found it
#endif
-], gl_cv_size_max=yes)
+], [gl_cv_size_max=yes])
if test -z "$gl_cv_size_max"; then
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
dnl than the type 'unsigned long'. Try hard to find a definition that can
dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
[#include <stddef.h>
-#include <limits.h>], size_t_bits_minus_1=)
+#include <limits.h>], [size_t_bits_minus_1=])
AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
- [#include <stddef.h>], fits_in_uint=)
+ [#include <stddef.h>], [fits_in_uint=])
if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
if test $fits_in_uint = 1; then
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
@@ -38,7 +38,7 @@ Found it
AC_TRY_COMPILE([#include <stddef.h>
extern size_t foo;
extern unsigned long foo;
- ], [], fits_in_uint=0)
+ ], [], [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/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index b255692567..e507a02eb8 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 31
+# stdint.m4 serial 32
dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -373,13 +373,22 @@ dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
dnl of interest to stdint.in.h.
AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
[
- gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
+ AC_REQUIRE([gl_MULTIARCH])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_cv_type_ptrdiff_t_signed=yes
gl_cv_type_size_t_signed=no
- gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
])
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
index db9a8ac4c2..2c8e649799 100644
--- a/gl/m4/stdint_h.m4
+++ b/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
-# stdint_h.m4 serial 6
-dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+# stdint_h.m4 serial 7
+dnl Copyright (C) 1997-2004, 2006, 2008 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.
@@ -11,15 +11,15 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_STDINT_H],
[
- AC_CACHE_CHECK([for stdint.h], gl_cv_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)])
+ [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,
+ AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], 1,
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
fi
diff --git a/gl/m4/wchar.m4 b/gl/m4/wchar.m4
index 5c923fa0e0..ba8ee6ab7b 100644
--- a/gl/m4/wchar.m4
+++ b/gl/m4/wchar.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar.m4 serial 6
+# wchar.m4 serial 22
AC_DEFUN([gl_WCHAR_H],
[
@@ -61,9 +61,39 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
AC_DEFUN([gl_WCHAR_H_DEFAULTS],
[
- GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
+ GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
+ GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
+ GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
+ GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
+ GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
+ GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
+ GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
+ GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
+ GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
+ GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
+ GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
+ HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
+ HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
+ HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
+ HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
+ HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
+ HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
+ HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
+ HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
+ HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
+ REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
+ REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
+ REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
+ REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
+ REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
+ REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
+ REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
+ REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS])
+ REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
+ REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
WCHAR_H=''; AC_SUBST([WCHAR_H])
])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index cde2129a97..3c81564adc 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
-# wchar_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# wchar_t.m4 serial 2 (gettext-0.18)
+dnl Copyright (C) 2002-2003, 2008 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,11 +10,11 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WCHAR_T],
[
- AC_CACHE_CHECK([for wchar_t], gt_cv_c_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)])
+ [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.])
+ AC_DEFINE([HAVE_WCHAR_T], 1, [Define if you have the 'wchar_t' type.])
fi
])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index af5ed936cc..0026a13188 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 2 (gettext-0.17)
-dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+# wint_t.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2003, 2007-2008 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,7 +10,7 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WINT_T],
[
- AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_TRY_COMPILE([
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
@@ -21,8 +21,8 @@ AC_DEFUN([gt_TYPE_WINT_T],
#include <time.h>
#include <wchar.h>
wint_t foo = (wchar_t)'\0';], ,
- gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+ [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.])
+ AC_DEFINE([HAVE_WINT_T], 1, [Define if you have the 'wint_t' type.])
fi
])
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
index 85bb721e43..631893cf59 100644
--- a/gl/m4/xsize.m4
+++ b/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
-# xsize.m4 serial 3
-dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# xsize.m4 serial 4
+dnl Copyright (C) 2003-2004, 2008 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.
@@ -9,5 +9,5 @@ AC_DEFUN([gl_XSIZE],
dnl Prerequisites of lib/xsize.h.
AC_REQUIRE([gl_SIZE_MAX])
AC_REQUIRE([AC_C_INLINE])
- AC_CHECK_HEADERS(stdint.h)
+ AC_CHECK_HEADERS([stdint.h])
])
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 099a2cf9b6..f8218c8537 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -89,15 +89,6 @@
# include <sys/bitypes.h>
#endif
-#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
-/* Get WCHAR_MIN, WCHAR_MAX. */
-# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
-# include <wchar.h>
-# endif
-
-#endif
-
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
/* Minimum and maximum values for a integer type under the usual assumption.
@@ -443,10 +434,20 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
/* ptrdiff_t limits */
#undef PTRDIFF_MIN
#undef PTRDIFF_MAX
-#define PTRDIFF_MIN \
- _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
-#define PTRDIFF_MAX \
- _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+#if @APPLE_UNIVERSAL_BUILD@
+# if _LP64
+# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
+# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
+# else
+# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
+# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
+# endif
+#else
+# define PTRDIFF_MIN \
+ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+# define PTRDIFF_MAX \
+ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+#endif
/* sig_atomic_t limits */
#undef SIG_ATOMIC_MIN
@@ -461,9 +462,24 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
/* size_t limit */
#undef SIZE_MAX
-#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+#if @APPLE_UNIVERSAL_BUILD@
+# if _LP64
+# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
+# else
+# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
+# endif
+#else
+# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+#endif
/* wchar_t limits */
+/* Get WCHAR_MIN, WCHAR_MAX.
+ This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
+ includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
+ <stdint.h> and assumes its types are already defined. */
+#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# include <wchar.h>
+#endif
#undef WCHAR_MIN
#undef WCHAR_MAX
#define WCHAR_MIN \
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index f6ebe253c8..3820b10971 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -52,8 +52,8 @@ struct random_data
int32_t *rptr; /* Rear pointer. */
int32_t *state; /* Array of state values. */
int rand_type; /* Type of random number generator. */
- int rand_deg; /* Degree of random number generator. */
- int rand_sep; /* Distance between front and rear. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
int32_t *end_ptr; /* Pointer behind state table. */
};
#endif
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index 86f35d31d8..ff2a0f7457 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -15,14 +15,28 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifndef _GL_SYS_SELECT_H
-
-#if @HAVE_SYS_SELECT_H@
-
# if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
# endif
+/* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>.
+ Simply delegate to the system's header in this case. */
+#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#else
+
+#ifndef _GL_SYS_SELECT_H
+
+#if @HAVE_SYS_SELECT_H@
+
/* On many platforms, <sys/select.h> assumes prior inclusion of
<sys/types.h>. */
# include <sys/types.h>
@@ -76,3 +90,4 @@ extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif /* _GL_SYS_SELECT_H */
#endif /* _GL_SYS_SELECT_H */
+#endif /* OSF/1 */
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index 9add074500..d9cda94fe1 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -91,7 +91,7 @@ EXTRA_DIST += test-fseeko.c test-fseeko.sh
TESTS += test-getaddrinfo
check_PROGRAMS += test-getaddrinfo
-test_getaddrinfo_LDADD = $(LDADD) @LIBINTL@
+test_getaddrinfo_LDADD = $(LDADD) @GETADDRINFO_LIB@ @LIBINTL@
EXTRA_DIST += test-getaddrinfo.c
diff --git a/gl/tests/test-select-in.sh b/gl/tests/test-select-in.sh
index ff55136faf..fdeb01ce83 100755
--- a/gl/tests/test-select-in.sh
+++ b/gl/tests/test-select-in.sh
@@ -1,6 +1,9 @@
#!/bin/sh
# Test select() on file descriptors opened for reading.
+# This test is known to fail on Solaris 2.6 and older, due to its handling
+# of /dev/null.
+
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
@@ -23,6 +26,7 @@ echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
test `cat t-select-in.tmp` = "1" || exit 1
# Special files.
+# This part of the test is known to fail on Solaris 2.6 and older.
# Doesn't work under mingw -- simon@josefsson.org
#rm -f t-select-in.tmp
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index a919936a0e..1b2f80ee18 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -35,6 +35,7 @@
#endif
/* mingw fails to declare _exit in <unistd.h>. */
+/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
#include <stdlib.h>
#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
diff --git a/gl/version-etc.c b/gl/version-etc.c
index 823e08562c..6ef1cca70c 100644
--- a/gl/version-etc.c
+++ b/gl/version-etc.c
@@ -1,5 +1,5 @@
/* Utility to help print --version output in a consistent format.
- Copyright (C) 1999-2008 Free Software Foundation, Inc.
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
#include "gettext.h"
#define _(msgid) gettext (msgid)
-enum { COPYRIGHT_YEAR = 2008 };
+enum { COPYRIGHT_YEAR = 2009 };
/* Like version_etc, below, but with the NULL-terminated author list
provided via a variable of type va_list. */
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index 563c3d8d81..f8b9948f74 100644
--- a/gl/wchar.in.h
+++ b/gl/wchar.in.h
@@ -68,6 +68,197 @@ extern "C" {
/* Define wint_t. (Also done in wctype.in.h.) */
#if !@HAVE_WINT_T@ && !defined wint_t
# define wint_t int
+# ifndef WEOF
+# define WEOF -1
+# endif
+#endif
+
+
+/* Override mbstate_t if it is too small.
+ On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
+ implementing mbrtowc for encodings like UTF-8. */
+#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+typedef int rpl_mbstate_t;
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# define GNULIB_defined_mbstate_t 1
+#endif
+
+
+/* Convert a single-byte character to a wide character. */
+#if @GNULIB_BTOWC@
+# if @REPLACE_BTOWC@
+# undef btowc
+# define btowc rpl_btowc
+# endif
+# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
+extern wint_t btowc (int c);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef btowc
+# define btowc(c) \
+ (GL_LINK_WARNING ("btowc is unportable - " \
+ "use gnulib module btowc for portability"), \
+ btowc (c))
+#endif
+
+
+/* Convert a wide character to a single-byte character. */
+#if @GNULIB_WCTOB@
+# if @REPLACE_WCTOB@
+# undef wctob
+# define wctob rpl_wctob
+# endif
+# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
+/* wctob is provided by gnulib, or wctob exists but is not declared. */
+extern int wctob (wint_t wc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctob
+# define wctob(w) \
+ (GL_LINK_WARNING ("wctob is unportable - " \
+ "use gnulib module wctob for portability"), \
+ wctob (w))
+#endif
+
+
+/* Test whether *PS is in the initial state. */
+#if @GNULIB_MBSINIT@
+# if @REPLACE_MBSINIT@
+# undef mbsinit
+# define mbsinit rpl_mbsinit
+# endif
+# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
+extern int mbsinit (const mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsinit
+# define mbsinit(p) \
+ (GL_LINK_WARNING ("mbsinit is unportable - " \
+ "use gnulib module mbsinit for portability"), \
+ mbsinit (p))
+#endif
+
+
+/* Convert a multibyte character to a wide character. */
+#if @GNULIB_MBRTOWC@
+# if @REPLACE_MBRTOWC@
+# undef mbrtowc
+# define mbrtowc rpl_mbrtowc
+# endif
+# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
+extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrtowc
+# define mbrtowc(w,s,n,p) \
+ (GL_LINK_WARNING ("mbrtowc is unportable - " \
+ "use gnulib module mbrtowc for portability"), \
+ mbrtowc (w, s, n, p))
+#endif
+
+
+/* Recognize a multibyte character. */
+#if @GNULIB_MBRLEN@
+# if @REPLACE_MBRLEN@
+# undef mbrlen
+# define mbrlen rpl_mbrlen
+# endif
+# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
+extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrlen
+# define mbrlen(s,n,p) \
+ (GL_LINK_WARNING ("mbrlen is unportable - " \
+ "use gnulib module mbrlen for portability"), \
+ mbrlen (s, n, p))
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSRTOWCS@
+# if @REPLACE_MBSRTOWCS@
+# undef mbsrtowcs
+# define mbsrtowcs rpl_mbsrtowcs
+# endif
+# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
+extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsrtowcs
+# define mbsrtowcs(d,s,l,p) \
+ (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
+ "use gnulib module mbsrtowcs for portability"), \
+ mbsrtowcs (d, s, l, p))
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSNRTOWCS@
+# if @REPLACE_MBSNRTOWCS@
+# undef mbsnrtowcs
+# define mbsnrtowcs rpl_mbsnrtowcs
+# endif
+# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
+extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsnrtowcs
+# define mbsnrtowcs(d,s,n,l,p) \
+ (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
+ "use gnulib module mbsnrtowcs for portability"), \
+ mbsnrtowcs (d, s, n, l, p))
+#endif
+
+
+/* Convert a wide character to a multibyte character. */
+#if @GNULIB_WCRTOMB@
+# if @REPLACE_WCRTOMB@
+# undef wcrtomb
+# define wcrtomb rpl_wcrtomb
+# endif
+# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
+extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcrtomb
+# define wcrtomb(s,w,p) \
+ (GL_LINK_WARNING ("wcrtomb is unportable - " \
+ "use gnulib module wcrtomb for portability"), \
+ wcrtomb (s, w, p))
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSRTOMBS@
+# if @REPLACE_WCSRTOMBS@
+# undef wcsrtombs
+# define wcsrtombs rpl_wcsrtombs
+# endif
+# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
+extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrtombs
+# define wcsrtombs(d,s,l,p) \
+ (GL_LINK_WARNING ("wcsrtombs is unportable - " \
+ "use gnulib module wcsrtombs for portability"), \
+ wcsrtombs (d, s, l, p))
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSNRTOMBS@
+# if !@HAVE_WCSNRTOMBS@
+extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnrtombs
+# define wcsnrtombs(d,s,n,l,p) \
+ (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
+ "use gnulib module wcsnrtombs for portability"), \
+ wcsnrtombs (d, s, n, l, p))
#endif
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index d0c7232489..a65da22f4e 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -309,6 +309,7 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
-e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
-e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
@@ -798,10 +799,40 @@ wchar.h: wchar.in.h
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
- -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+ -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
+ -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
+ -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
+ -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
+ -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
+ -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
+ -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
+ -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
+ -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
+ -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
-e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
- -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
+ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
+ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
+ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
+ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
+ -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
+ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
+ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
+ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+ -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
+ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
+ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
+ -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
+ -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
+ -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
+ -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
+ -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
+ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
diff --git a/lib/gl/m4/codeset.m4 b/lib/gl/m4/codeset.m4
index 223955b454..de4181d7d2 100644
--- a/lib/gl/m4/codeset.m4
+++ b/lib/gl/m4/codeset.m4
@@ -1,5 +1,5 @@
-# codeset.m4 serial 2 (gettext-0.16)
-dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
+# codeset.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2000-2002, 2006, 2008 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.
@@ -8,14 +8,14 @@ dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
- AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_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)
+ [am_cv_langinfo_codeset=yes],
+ [am_cv_langinfo_codeset=no])
])
if test $am_cv_langinfo_codeset = yes; then
- AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ AC_DEFINE([HAVE_LANGINFO_CODESET], 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])
diff --git a/lib/gl/m4/errno_h.m4 b/lib/gl/m4/errno_h.m4
index b5af07800c..22c08f07fa 100644
--- a/lib/gl/m4/errno_h.m4
+++ b/lib/gl/m4/errno_h.m4
@@ -1,4 +1,4 @@
-# errno_h.m4 serial 1
+# errno_h.m4 serial 2
dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -111,3 +111,9 @@ yes
AC_SUBST($1[_VALUE])
fi
])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/lib/gl/m4/extensions.m4 b/lib/gl/m4/extensions.m4
index 917af94805..611fcfdbc4 100644
--- a/lib/gl/m4/extensions.m4
+++ b/lib/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 5 -*- Autoconf -*-
+# serial 6 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
@@ -24,6 +24,8 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
@@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
[Define to 1 if on MINIX.])
fi
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
diff --git a/lib/gl/m4/gettext.m4 b/lib/gl/m4/gettext.m4
index c9ae1f7de8..c48856397b 100644
--- a/lib/gl/m4/gettext.m4
+++ b/lib/gl/m4/gettext.m4
@@ -1,5 +1,5 @@
-# gettext.m4 serial 60 (gettext-0.17)
-dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+# gettext.m4 serial 61 (gettext-0.18)
+dnl Copyright (C) 1995-2008 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.
@@ -127,7 +127,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
- AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+ AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
@@ -267,7 +267,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
- AC_DEFINE(ENABLE_NLS, 1,
+ AC_DEFINE([ENABLE_NLS], 1,
[Define to 1 if translation of program messages to the user's native language
is requested.])
else
@@ -301,9 +301,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
fi
dnl For backward compatibility. Some packages may be using this.
- AC_DEFINE(HAVE_GETTEXT, 1,
+ AC_DEFINE([HAVE_GETTEXT], 1,
[Define if the GNU gettext() function is already present or preinstalled.])
- AC_DEFINE(HAVE_DCGETTEXT, 1,
+ AC_DEFINE([HAVE_DCGETTEXT], 1,
[Define if the GNU dcgettext() function is already present or preinstalled.])
fi
@@ -319,9 +319,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
fi
dnl Make all variables we use known to autoconf.
- AC_SUBST(BUILD_INCLUDED_LIBINTL)
- AC_SUBST(USE_INCLUDED_LIBINTL)
- AC_SUBST(CATOBJEXT)
+ AC_SUBST([BUILD_INCLUDED_LIBINTL])
+ AC_SUBST([USE_INCLUDED_LIBINTL])
+ AC_SUBST([CATOBJEXT])
dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl=
@@ -329,36 +329,36 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
dnl For backward compatibility. Some Makefiles may be using this.
DATADIRNAME=share
- AC_SUBST(DATADIRNAME)
+ AC_SUBST([DATADIRNAME])
dnl For backward compatibility. Some Makefiles may be using this.
INSTOBJEXT=.mo
- AC_SUBST(INSTOBJEXT)
+ AC_SUBST([INSTOBJEXT])
dnl For backward compatibility. Some Makefiles may be using this.
GENCAT=gencat
- AC_SUBST(GENCAT)
+ AC_SUBST([GENCAT])
dnl For backward compatibility. Some Makefiles may be using this.
INTLOBJS=
if test "$USE_INCLUDED_LIBINTL" = yes; then
INTLOBJS="\$(GETTOBJS)"
fi
- AC_SUBST(INTLOBJS)
+ AC_SUBST([INTLOBJS])
dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
- AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+ AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
])
dnl For backward compatibility. Some Makefiles may be using this.
INTLLIBS="$LIBINTL"
- AC_SUBST(INTLLIBS)
+ AC_SUBST([INTLLIBS])
dnl Make all documented variables known to autoconf.
- AC_SUBST(LIBINTL)
- AC_SUBST(LTLIBINTL)
- AC_SUBST(POSUB)
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ AC_SUBST([POSUB])
])
diff --git a/lib/gl/m4/glibc2.m4 b/lib/gl/m4/glibc2.m4
index e8f5bfe6ed..fe58a0f326 100644
--- a/lib/gl/m4/glibc2.m4
+++ b/lib/gl/m4/glibc2.m4
@@ -1,5 +1,5 @@
-# glibc2.m4 serial 1
-dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+# glibc2.m4 serial 2
+dnl Copyright (C) 2000-2002, 2004, 2008 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.
@@ -9,8 +9,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gt_GLIBC2],
[
- AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
- ac_cv_gnu_library_2,
+ AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
+ [ac_cv_gnu_library_2],
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
@@ -20,11 +20,11 @@ AC_DEFUN([gt_GLIBC2],
#endif
#endif
],
- ac_cv_gnu_library_2=yes,
- ac_cv_gnu_library_2=no)
+ [ac_cv_gnu_library_2=yes],
+ [ac_cv_gnu_library_2=no])
]
)
- AC_SUBST(GLIBC2)
+ AC_SUBST([GLIBC2])
GLIBC2="$ac_cv_gnu_library_2"
]
)
diff --git a/lib/gl/m4/glibc21.m4 b/lib/gl/m4/glibc21.m4
index d95fd98613..93fbf47459 100644
--- a/lib/gl/m4/glibc21.m4
+++ b/lib/gl/m4/glibc21.m4
@@ -1,5 +1,5 @@
-# glibc21.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+# glibc21.m4 serial 4
+dnl Copyright (C) 2000-2002, 2004, 2008 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.
@@ -9,8 +9,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_GLIBC21],
[
- AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
- ac_cv_gnu_library_2_1,
+ AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
+ [ac_cv_gnu_library_2_1],
[AC_EGREP_CPP([Lucky GNU user],
[
#include <features.h>
@@ -20,11 +20,11 @@ AC_DEFUN([gl_GLIBC21],
#endif
#endif
],
- ac_cv_gnu_library_2_1=yes,
- ac_cv_gnu_library_2_1=no)
+ [ac_cv_gnu_library_2_1=yes],
+ [ac_cv_gnu_library_2_1=no])
]
)
- AC_SUBST(GLIBC21)
+ AC_SUBST([GLIBC21])
GLIBC21="$ac_cv_gnu_library_2_1"
]
)
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 1e311606cd..e422fa283c 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 6ace8bcc90..242e33652b 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -60,6 +60,7 @@ AC_DEFUN([lgl_INIT],
gl_STRING_MODULE_INDICATOR([memmem])
gl_FUNC_MEMMOVE
gl_MINMAX
+ gl_MULTIARCH
gl_HEADER_NETDB
gl_FUNC_READ_FILE
gl_FUNC_REALLOC_POSIX
@@ -311,6 +312,7 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/memmem.m4
m4/memmove.m4
m4/minmax.m4
+ m4/multiarch.m4
m4/netdb_h.m4
m4/nls.m4
m4/po.m4
diff --git a/lib/gl/m4/iconv.m4 b/lib/gl/m4/iconv.m4
index 66bc76f48c..848b2f85c3 100644
--- a/lib/gl/m4/iconv.m4
+++ b/lib/gl/m4/iconv.m4
@@ -1,5 +1,5 @@
-# iconv.m4 serial AM6 (gettext-0.17)
-dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
+# iconv.m4 serial AM6 (gettext-0.18)
+dnl Copyright (C) 2000-2002, 2007-2008 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.
@@ -34,7 +34,7 @@ AC_DEFUN([AM_ICONV_LINK],
am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
- AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
+ 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>
@@ -42,7 +42,7 @@ AC_DEFUN([AM_ICONV_LINK],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
- am_cv_func_iconv=yes)
+ [am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
@@ -51,13 +51,13 @@ AC_DEFUN([AM_ICONV_LINK],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
- am_cv_lib_iconv=yes
- am_cv_func_iconv=yes)
+ [am_cv_lib_iconv=yes]
+ [am_cv_func_iconv=yes])
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
- AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
+ AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
am_save_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then
@@ -134,7 +134,7 @@ int main ()
am_func_iconv=no am_cv_lib_iconv=no
fi
if test "$am_func_iconv" = yes; then
- AC_DEFINE(HAVE_ICONV, 1,
+ AC_DEFINE([HAVE_ICONV], 1,
[Define if you have the iconv() function and it works.])
fi
if test "$am_cv_lib_iconv" = yes; then
@@ -147,8 +147,8 @@ int main ()
LIBICONV=
LTLIBICONV=
fi
- AC_SUBST(LIBICONV)
- AC_SUBST(LTLIBICONV)
+ AC_SUBST([LIBICONV])
+ AC_SUBST([LTLIBICONV])
])
AC_DEFUN([AM_ICONV],
@@ -156,7 +156,7 @@ 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_CACHE_VAL([am_cv_proto_iconv], [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
@@ -169,12 +169,12 @@ 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([$]{ac_t:-
- }[$]am_cv_proto_iconv)
- AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ AC_MSG_RESULT([${ac_t:-
+ }$am_cv_proto_iconv])
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
fi
])
diff --git a/lib/gl/m4/intdiv0.m4 b/lib/gl/m4/intdiv0.m4
index 8c8a67084f..29e6e0aa16 100644
--- a/lib/gl/m4/intdiv0.m4
+++ b/lib/gl/m4/intdiv0.m4
@@ -1,5 +1,5 @@
-# intdiv0.m4 serial 2 (gettext-0.17)
-dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+# intdiv0.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2002, 2007-2008 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.
@@ -61,7 +61,7 @@ int main ()
nan = y / y;
exit (1);
}
-], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
[
# Guess based on the CPU.
changequote(,)dnl
@@ -79,6 +79,6 @@ changequote([,])dnl
*yes) value=1;;
*) value=0;;
esac
- AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+ AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
[Define if integer division by zero raises signal SIGFPE.])
])
diff --git a/lib/gl/m4/intlmacosx.m4 b/lib/gl/m4/intlmacosx.m4
index d3f0d904d2..b77527d17d 100644
--- a/lib/gl/m4/intlmacosx.m4
+++ b/lib/gl/m4/intlmacosx.m4
@@ -1,5 +1,5 @@
-# intlmacosx.m4 serial 1 (gettext-0.17)
-dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
+# intlmacosx.m4 serial 2 (gettext-0.18)
+dnl Copyright (C) 2004-2008 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.
@@ -19,7 +19,7 @@ AC_DEFUN([gt_INTL_MACOSX],
[
dnl Check for API introduced in MacOS X 10.2.
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
- gt_cv_func_CFPreferencesCopyAppValue,
+ [gt_cv_func_CFPreferencesCopyAppValue],
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
@@ -32,7 +32,7 @@ AC_DEFUN([gt_INTL_MACOSX],
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi
dnl Check for API introduced in MacOS X 10.3.
- AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
diff --git a/lib/gl/m4/intmax.m4 b/lib/gl/m4/intmax.m4
index ce7a8a49de..d713db2286 100644
--- a/lib/gl/m4/intmax.m4
+++ b/lib/gl/m4/intmax.m4
@@ -1,5 +1,5 @@
-# intmax.m4 serial 3 (gettext-0.16)
-dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
+# intmax.m4 serial 4 (gettext-0.18)
+dnl Copyright (C) 2002-2005, 2008 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,7 +12,7 @@ AC_DEFUN([gt_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_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
[AC_TRY_COMPILE([
#include <stddef.h>
#include <stdlib.h>
@@ -24,10 +24,10 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
#endif
], [intmax_t x = -1;
return !x;],
- gt_cv_c_intmax_t=yes,
- gt_cv_c_intmax_t=no)])
+ [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,
+ AC_DEFINE([HAVE_INTMAX_T], 1,
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
fi
])
diff --git a/lib/gl/m4/inttypes-pri.m4 b/lib/gl/m4/inttypes-pri.m4
index 7c7f89401a..66650ebdc8 100644
--- a/lib/gl/m4/inttypes-pri.m4
+++ b/lib/gl/m4/inttypes-pri.m4
@@ -1,5 +1,5 @@
-# inttypes-pri.m4 serial 4 (gettext-0.16)
-dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
+# inttypes-pri.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1997-2002, 2006, 2008 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.
@@ -16,17 +16,17 @@ AC_DEFUN([gt_INTTYPES_PRI],
AC_CHECK_HEADERS([inttypes.h])
if test $ac_cv_header_inttypes_h = yes; then
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
- gt_cv_inttypes_pri_broken,
+ [gt_cv_inttypes_pri_broken],
[
AC_TRY_COMPILE([#include <inttypes.h>
#ifdef PRId32
char *p = PRId32;
#endif
-], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes])
])
fi
if test "$gt_cv_inttypes_pri_broken" = yes; then
- AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+ AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], 1,
[Define if <inttypes.h> exists and defines unusable PRI* macros.])
PRI_MACROS_BROKEN=1
else
diff --git a/lib/gl/m4/inttypes_h.m4 b/lib/gl/m4/inttypes_h.m4
index edc8ecb2db..cf482d2875 100644
--- a/lib/gl/m4/inttypes_h.m4
+++ b/lib/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
-# inttypes_h.m4 serial 7
-dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+# inttypes_h.m4 serial 8
+dnl Copyright (C) 1997-2004, 2006, 2008 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.
@@ -11,15 +11,15 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
[
- AC_CACHE_CHECK([for inttypes.h], gl_cv_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)])
+ [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,
+ AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], 1,
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
fi
diff --git a/lib/gl/m4/lcmessage.m4 b/lib/gl/m4/lcmessage.m4
index 19aa77e4f7..b7c4730272 100644
--- a/lib/gl/m4/lcmessage.m4
+++ b/lib/gl/m4/lcmessage.m4
@@ -1,5 +1,5 @@
-# lcmessage.m4 serial 4 (gettext-0.14.2)
-dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
+# lcmessage.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2002, 2004-2005, 2008 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.
@@ -20,11 +20,11 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
AC_DEFUN([gt_LC_MESSAGES],
[
- AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
+ AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
+ [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])])
if test $gt_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ AC_DEFINE([HAVE_LC_MESSAGES], 1,
[Define if your <locale.h> file defines LC_MESSAGES.])
fi
])
diff --git a/lib/gl/m4/lib-link.m4 b/lib/gl/m4/lib-link.m4
index 7e07a42468..e29eead276 100644
--- a/lib/gl/m4/lib-link.m4
+++ b/lib/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 16 (gettext-0.18)
+# lib-link.m4 serial 17 (gettext-0.18)
dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -446,12 +446,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
case "$found_dir" in
*/$acl_libdirstem | */$acl_libdirstem/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
- LIB[]NAME[]_PREFIX="$basedir"
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
additional_includedir="$basedir/include"
;;
*/$acl_libdirstem2 | */$acl_libdirstem2/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
- LIB[]NAME[]_PREFIX="$basedir"
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
additional_includedir="$basedir/include"
;;
esac
diff --git a/lib/gl/m4/multiarch.m4 b/lib/gl/m4/multiarch.m4
new file mode 100644
index 0000000000..7b73e15ee9
--- /dev/null
+++ b/lib/gl/m4/multiarch.m4
@@ -0,0 +1,74 @@
+# multiarch.m4 serial 3
+dnl Copyright (C) 2008 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.
+
+# Determine whether the compiler is or may be producing universal binaries.
+#
+# On MacOS X 10.5 and later systems, the user can create libraries and
+# executables that work on multiple system types--known as "fat" or
+# "universal" binaries--by specifying multiple '-arch' options to the
+# compiler but only a single '-arch' option to the preprocessor. Like
+# this:
+#
+# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CPP="gcc -E" CXXCPP="g++ -E"
+#
+# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
+# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
+
+AC_DEFUN([gl_MULTIARCH],
+[
+ dnl This AC_REQUIRE is not necessary in theory. It works around a bug in
+ dnl autoconf <= 2.63: AC_REQUIRE invocations inside AC_REQUIREd macros are
+ dnl being handled better than AC_REQUIRE invocations inside normally invoked
+ dnl macros.
+ AC_REQUIRE([gl_MULTIARCH_BODY])
+])
+
+AC_DEFUN([gl_MULTIARCH_BODY],
+[
+ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
+ gl_cv_c_multiarch=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+ ]])],
+ [
+ dnl Check for potential -arch flags. It is not universal unless
+ dnl there are at least two -arch flags with different values.
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+ ])
+ if test $gl_cv_c_multiarch = yes; then
+ AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
+ [Define if the compiler is building for multiple architectures of Apple platforms at once.])
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+ AC_SUBST([APPLE_UNIVERSAL_BUILD])
+])
diff --git a/lib/gl/m4/nls.m4 b/lib/gl/m4/nls.m4
index 7967cc2f9a..5f155f01a2 100644
--- a/lib/gl/m4/nls.m4
+++ b/lib/gl/m4/nls.m4
@@ -1,5 +1,5 @@
-# nls.m4 serial 3 (gettext-0.15)
-dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
+# nls.m4 serial 4 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008 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.
@@ -27,5 +27,5 @@ AC_DEFUN([AM_NLS],
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
- AC_SUBST(USE_NLS)
+ AC_SUBST([USE_NLS])
])
diff --git a/lib/gl/m4/po.m4 b/lib/gl/m4/po.m4
index 0734762ab1..818143e713 100644
--- a/lib/gl/m4/po.m4
+++ b/lib/gl/m4/po.m4
@@ -1,5 +1,5 @@
-# po.m4 serial 15 (gettext-0.17)
-dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+# po.m4 serial 16 (gettext-0.18)
+dnl Copyright (C) 1995-2008 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.
@@ -41,7 +41,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
[$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
:)
- AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
dnl Test whether it is GNU msgfmt >= 0.15.
changequote(,)dnl
diff --git a/lib/gl/m4/printf-posix.m4 b/lib/gl/m4/printf-posix.m4
index 14ba612839..8933ee399d 100644
--- a/lib/gl/m4/printf-posix.m4
+++ b/lib/gl/m4/printf-posix.m4
@@ -1,4 +1,4 @@
-# printf-posix.m4 serial 3 (gettext-0.17)
+# printf-posix.m4 serial 4 (gettext-0.18)
dnl Copyright (C) 2003, 2007 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,13 +31,14 @@ int main ()
#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
notposix
#endif
- ], gt_cv_func_printf_posix="guessing no",
- gt_cv_func_printf_posix="guessing yes")
+ ],
+ [gt_cv_func_printf_posix="guessing no"],
+ [gt_cv_func_printf_posix="guessing yes"])
])
])
case $gt_cv_func_printf_posix in
*yes)
- AC_DEFINE(HAVE_POSIX_PRINTF, 1,
+ AC_DEFINE([HAVE_POSIX_PRINTF], 1,
[Define if your printf() function supports format strings with positions.])
;;
esac
diff --git a/lib/gl/m4/printf.m4 b/lib/gl/m4/printf.m4
index df26c13ecc..474a635575 100644
--- a/lib/gl/m4/printf.m4
+++ b/lib/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 24
+# printf.m4 serial 25
dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -811,13 +811,15 @@ dnl Result is gl_cv_func_printf_enomem.
AC_DEFUN([gl_PRINTF_ENOMEM],
[
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_MULTIARCH])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
[gl_cv_func_printf_enomem],
[
gl_cv_func_printf_enomem="guessing no"
if test "$cross_compiling" = no; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([
]GL_NOCRASH[
changequote(,)dnl
#include <stdio.h>
@@ -866,21 +868,27 @@ int main()
}
changequote([,])dnl
])])
- if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- (./conftest
- result=$?
- if test $result != 0 && test $result != 77; then result=1; fi
- exit $result
- ) >/dev/null 2>/dev/null
- case $? in
- 0) gl_cv_func_printf_enomem="yes" ;;
- 77) gl_cv_func_printf_enomem="guessing no" ;;
- *) gl_cv_func_printf_enomem="no" ;;
- esac
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ (./conftest
+ result=$?
+ if test $result != 0 && test $result != 77; then result=1; fi
+ exit $result
+ ) >/dev/null 2>/dev/null
+ case $? in
+ 0) gl_cv_func_printf_enomem="yes" ;;
+ 77) gl_cv_func_printf_enomem="guessing no" ;;
+ *) gl_cv_func_printf_enomem="no" ;;
+ esac
+ else
+ gl_cv_func_printf_enomem="guessing no"
+ fi
+ rm -fr conftest*
else
+ dnl A universal build on Apple MacOS X platforms.
+ dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
+ dnl But we need a configuration result that is valid in both modes.
gl_cv_func_printf_enomem="guessing no"
fi
- rm -fr conftest*
fi
if test "$gl_cv_func_printf_enomem" = "guessing no"; then
changequote(,)dnl
diff --git a/lib/gl/m4/progtest.m4 b/lib/gl/m4/progtest.m4
index a56365cd37..9b55f75120 100644
--- a/lib/gl/m4/progtest.m4
+++ b/lib/gl/m4/progtest.m4
@@ -1,5 +1,5 @@
-# progtest.m4 serial 4 (gettext-0.14.2)
-dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
+# progtest.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1996-2003, 2005, 2008 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.
@@ -55,7 +55,7 @@ rm -f conf$$.file
# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
+AC_CACHE_VAL([ac_cv_path_$1],
[case "[$]$1" in
[[\\/]]* | ?:[[\\/]]*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
@@ -84,9 +84,9 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
esac])dnl
$1="$ac_cv_path_$1"
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
- AC_MSG_RESULT([$]$1)
+ AC_MSG_RESULT([$][$1])
else
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT([no])
fi
AC_SUBST($1)dnl
])
diff --git a/lib/gl/m4/size_max.m4 b/lib/gl/m4/size_max.m4
index 6cb4868927..e0e7b3ff95 100644
--- a/lib/gl/m4/size_max.m4
+++ b/lib/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
-# size_max.m4 serial 6
-dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
+# size_max.m4 serial 7
+dnl Copyright (C) 2003, 2005-2006, 2008 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.
@@ -8,7 +8,7 @@ dnl From Bruno Haible.
AC_DEFUN([gl_SIZE_MAX],
[
- AC_CHECK_HEADERS(stdint.h)
+ AC_CHECK_HEADERS([stdint.h])
dnl First test whether the system already has SIZE_MAX.
AC_MSG_CHECKING([for SIZE_MAX])
AC_CACHE_VAL([gl_cv_size_max], [
@@ -21,16 +21,16 @@ AC_DEFUN([gl_SIZE_MAX],
#ifdef SIZE_MAX
Found it
#endif
-], gl_cv_size_max=yes)
+], [gl_cv_size_max=yes])
if test -z "$gl_cv_size_max"; then
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
dnl than the type 'unsigned long'. Try hard to find a definition that can
dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
[#include <stddef.h>
-#include <limits.h>], size_t_bits_minus_1=)
+#include <limits.h>], [size_t_bits_minus_1=])
AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
- [#include <stddef.h>], fits_in_uint=)
+ [#include <stddef.h>], [fits_in_uint=])
if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
if test $fits_in_uint = 1; then
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
@@ -38,7 +38,7 @@ Found it
AC_TRY_COMPILE([#include <stddef.h>
extern size_t foo;
extern unsigned long foo;
- ], [], fits_in_uint=0)
+ ], [], [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/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4
index b255692567..e507a02eb8 100644
--- a/lib/gl/m4/stdint.m4
+++ b/lib/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 31
+# stdint.m4 serial 32
dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -373,13 +373,22 @@ dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
dnl of interest to stdint.in.h.
AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
[
- gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
+ AC_REQUIRE([gl_MULTIARCH])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
gl_cv_type_ptrdiff_t_signed=yes
gl_cv_type_size_t_signed=no
- gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
])
diff --git a/lib/gl/m4/stdint_h.m4 b/lib/gl/m4/stdint_h.m4
index db9a8ac4c2..2c8e649799 100644
--- a/lib/gl/m4/stdint_h.m4
+++ b/lib/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
-# stdint_h.m4 serial 6
-dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+# stdint_h.m4 serial 7
+dnl Copyright (C) 1997-2004, 2006, 2008 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.
@@ -11,15 +11,15 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_STDINT_H],
[
- AC_CACHE_CHECK([for stdint.h], gl_cv_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)])
+ [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,
+ AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], 1,
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
fi
diff --git a/lib/gl/m4/threadlib.m4 b/lib/gl/m4/threadlib.m4
index 3a8655e931..51caf576b3 100644
--- a/lib/gl/m4/threadlib.m4
+++ b/lib/gl/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 1 (gettext-0.18)
+# threadlib.m4 serial 2 (gettext-0.18)
dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -104,7 +104,8 @@ AC_DEFUN([gl_THREADLIB_BODY],
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
# it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
- AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
+ AC_CHECK_HEADER([pthread.h],
+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
if test "$gl_have_pthread_h" = yes; then
# Other possible tests:
# -lpthreads (FSU threads, PCthreads)
@@ -122,7 +123,7 @@ AC_DEFUN([gl_THREADLIB_BODY],
if test -n "$gl_have_pthread"; then
# The program links fine without libpthread. But it may actually
# need to link with libpthread in order to create multiple threads.
- AC_CHECK_LIB(pthread, pthread_kill,
+ AC_CHECK_LIB([pthread], [pthread_kill],
[LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
# On Solaris and HP-UX, most pthread functions exist also in libc.
# Therefore pthread_in_use() needs to actually try to create a
@@ -136,13 +137,13 @@ AC_DEFUN([gl_THREADLIB_BODY],
])
else
# Some library is needed. Try libpthread and libc_r.
- AC_CHECK_LIB(pthread, pthread_kill,
+ AC_CHECK_LIB([pthread], [pthread_kill],
[gl_have_pthread=yes
LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
if test -z "$gl_have_pthread"; then
# For FreeBSD 4.
- AC_CHECK_LIB(c_r, pthread_kill,
+ AC_CHECK_LIB([c_r], [pthread_kill],
[gl_have_pthread=yes
LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
@@ -192,11 +193,11 @@ AC_DEFUN([gl_THREADLIB_BODY],
fi
if test "$gl_use_threads" = pth; then
gl_save_CPPFLAGS="$CPPFLAGS"
- AC_LIB_LINKFLAGS(pth)
+ AC_LIB_LINKFLAGS([pth])
gl_have_pth=
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lpth"
- AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
+ AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes])
LIBS="$gl_save_LIBS"
if test -n "$gl_have_pth"; then
gl_threads_api=pth
@@ -234,10 +235,10 @@ AC_DEFUN([gl_THREADLIB_BODY],
fi
AC_MSG_CHECKING([for multithread API to use])
AC_MSG_RESULT([$gl_threads_api])
- AC_SUBST(LIBTHREAD)
- AC_SUBST(LTLIBTHREAD)
- AC_SUBST(LIBMULTITHREAD)
- AC_SUBST(LTLIBMULTITHREAD)
+ AC_SUBST([LIBTHREAD])
+ AC_SUBST([LTLIBTHREAD])
+ AC_SUBST([LIBMULTITHREAD])
+ AC_SUBST([LTLIBMULTITHREAD])
])
AC_DEFUN([gl_THREADLIB],
diff --git a/lib/gl/m4/uintmax_t.m4 b/lib/gl/m4/uintmax_t.m4
index 641c4898d3..cde46d2e8f 100644
--- a/lib/gl/m4/uintmax_t.m4
+++ b/lib/gl/m4/uintmax_t.m4
@@ -1,5 +1,5 @@
-# uintmax_t.m4 serial 10
-dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc.
+# uintmax_t.m4 serial 11
+dnl Copyright (C) 1997-2004, 2007-2008 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.
@@ -20,11 +20,11 @@ AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
test $ac_cv_type_unsigned_long_long_int = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
- AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+ AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
[Define to unsigned long or unsigned long long
if <stdint.h> and <inttypes.h> don't define.])
else
- AC_DEFINE(HAVE_UINTMAX_T, 1,
+ AC_DEFINE([HAVE_UINTMAX_T], 1,
[Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
fi
])
diff --git a/lib/gl/m4/visibility.m4 b/lib/gl/m4/visibility.m4
index 2ff6330aa4..70bca56437 100644
--- a/lib/gl/m4/visibility.m4
+++ b/lib/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
-# visibility.m4 serial 1 (gettext-0.15)
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# visibility.m4 serial 2 (gettext-0.18)
+dnl Copyright (C) 2005, 2008 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.
@@ -27,7 +27,7 @@ AC_DEFUN([gl_VISIBILITY],
HAVE_VISIBILITY=0
if test -n "$GCC"; then
AC_MSG_CHECKING([for simple visibility declarations])
- AC_CACHE_VAL(gl_cv_cc_visibility, [
+ AC_CACHE_VAL([gl_cv_cc_visibility], [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_TRY_COMPILE(
@@ -36,8 +36,8 @@ AC_DEFUN([gl_VISIBILITY],
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
[],
- gl_cv_cc_visibility=yes,
- gl_cv_cc_visibility=no)
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
CFLAGS="$gl_save_CFLAGS"])
AC_MSG_RESULT([$gl_cv_cc_visibility])
if test $gl_cv_cc_visibility = yes; then
diff --git a/lib/gl/m4/wchar.m4 b/lib/gl/m4/wchar.m4
index 5c923fa0e0..ba8ee6ab7b 100644
--- a/lib/gl/m4/wchar.m4
+++ b/lib/gl/m4/wchar.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar.m4 serial 6
+# wchar.m4 serial 22
AC_DEFUN([gl_WCHAR_H],
[
@@ -61,9 +61,39 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
AC_DEFUN([gl_WCHAR_H_DEFAULTS],
[
- GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
+ GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC])
+ GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB])
+ GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT])
+ GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC])
+ GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN])
+ GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS])
+ GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
+ GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB])
+ GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS])
+ GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
+ GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
+ HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
+ HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
+ HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
+ HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
+ HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
+ HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
+ HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
+ HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
+ HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
+ REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
+ REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
+ REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
+ REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
+ REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
+ REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
+ REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
+ REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS])
+ REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
+ REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
WCHAR_H=''; AC_SUBST([WCHAR_H])
])
diff --git a/lib/gl/m4/wchar_t.m4 b/lib/gl/m4/wchar_t.m4
index cde2129a97..3c81564adc 100644
--- a/lib/gl/m4/wchar_t.m4
+++ b/lib/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
-# wchar_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# wchar_t.m4 serial 2 (gettext-0.18)
+dnl Copyright (C) 2002-2003, 2008 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,11 +10,11 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WCHAR_T],
[
- AC_CACHE_CHECK([for wchar_t], gt_cv_c_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)])
+ [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.])
+ AC_DEFINE([HAVE_WCHAR_T], 1, [Define if you have the 'wchar_t' type.])
fi
])
diff --git a/lib/gl/m4/wint_t.m4 b/lib/gl/m4/wint_t.m4
index af5ed936cc..0026a13188 100644
--- a/lib/gl/m4/wint_t.m4
+++ b/lib/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 2 (gettext-0.17)
-dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+# wint_t.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2003, 2007-2008 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,7 +10,7 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WINT_T],
[
- AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_TRY_COMPILE([
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
@@ -21,8 +21,8 @@ AC_DEFUN([gt_TYPE_WINT_T],
#include <time.h>
#include <wchar.h>
wint_t foo = (wchar_t)'\0';], ,
- gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+ [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.])
+ AC_DEFINE([HAVE_WINT_T], 1, [Define if you have the 'wint_t' type.])
fi
])
diff --git a/lib/gl/m4/xsize.m4 b/lib/gl/m4/xsize.m4
index 85bb721e43..631893cf59 100644
--- a/lib/gl/m4/xsize.m4
+++ b/lib/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
-# xsize.m4 serial 3
-dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# xsize.m4 serial 4
+dnl Copyright (C) 2003-2004, 2008 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.
@@ -9,5 +9,5 @@ AC_DEFUN([gl_XSIZE],
dnl Prerequisites of lib/xsize.h.
AC_REQUIRE([gl_SIZE_MAX])
AC_REQUIRE([AC_C_INLINE])
- AC_CHECK_HEADERS(stdint.h)
+ AC_CHECK_HEADERS([stdint.h])
])
diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h
index 8d5fdf7dc8..51ac462d95 100644
--- a/lib/gl/stdint.in.h
+++ b/lib/gl/stdint.in.h
@@ -89,15 +89,6 @@
# include <sys/bitypes.h>
#endif
-#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
-/* Get WCHAR_MIN, WCHAR_MAX. */
-# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
-# include <wchar.h>
-# endif
-
-#endif
-
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
/* Minimum and maximum values for a integer type under the usual assumption.
@@ -443,10 +434,20 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
/* ptrdiff_t limits */
#undef PTRDIFF_MIN
#undef PTRDIFF_MAX
-#define PTRDIFF_MIN \
- _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
-#define PTRDIFF_MAX \
- _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+#if @APPLE_UNIVERSAL_BUILD@
+# if _LP64
+# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
+# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
+# else
+# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
+# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
+# endif
+#else
+# define PTRDIFF_MIN \
+ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+# define PTRDIFF_MAX \
+ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+#endif
/* sig_atomic_t limits */
#undef SIG_ATOMIC_MIN
@@ -461,9 +462,24 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
/* size_t limit */
#undef SIZE_MAX
-#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+#if @APPLE_UNIVERSAL_BUILD@
+# if _LP64
+# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
+# else
+# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
+# endif
+#else
+# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+#endif
/* wchar_t limits */
+/* Get WCHAR_MIN, WCHAR_MAX.
+ This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
+ includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
+ <stdint.h> and assumes its types are already defined. */
+#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# include <wchar.h>
+#endif
#undef WCHAR_MIN
#undef WCHAR_MAX
#define WCHAR_MIN \
diff --git a/lib/gl/stdlib.in.h b/lib/gl/stdlib.in.h
index e28c151d22..baf21a4415 100644
--- a/lib/gl/stdlib.in.h
+++ b/lib/gl/stdlib.in.h
@@ -52,8 +52,8 @@ struct random_data
int32_t *rptr; /* Rear pointer. */
int32_t *state; /* Array of state values. */
int rand_type; /* Type of random number generator. */
- int rand_deg; /* Degree of random number generator. */
- int rand_sep; /* Distance between front and rear. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
int32_t *end_ptr; /* Pointer behind state table. */
};
#endif
diff --git a/lib/gl/tests/Makefile.am b/lib/gl/tests/Makefile.am
index 1e29c51fba..5f42c88eea 100644
--- a/lib/gl/tests/Makefile.am
+++ b/lib/gl/tests/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index 8bc3abfbc9..4b6c4b901e 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -35,6 +35,7 @@
#endif
/* mingw fails to declare _exit in <unistd.h>. */
+/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
#include <stdlib.h>
#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
diff --git a/lib/gl/wchar.in.h b/lib/gl/wchar.in.h
index 652ca6e5dc..09fc326905 100644
--- a/lib/gl/wchar.in.h
+++ b/lib/gl/wchar.in.h
@@ -68,6 +68,197 @@ extern "C" {
/* Define wint_t. (Also done in wctype.in.h.) */
#if !@HAVE_WINT_T@ && !defined wint_t
# define wint_t int
+# ifndef WEOF
+# define WEOF -1
+# endif
+#endif
+
+
+/* Override mbstate_t if it is too small.
+ On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
+ implementing mbrtowc for encodings like UTF-8. */
+#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+typedef int rpl_mbstate_t;
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# define GNULIB_defined_mbstate_t 1
+#endif
+
+
+/* Convert a single-byte character to a wide character. */
+#if @GNULIB_BTOWC@
+# if @REPLACE_BTOWC@
+# undef btowc
+# define btowc rpl_btowc
+# endif
+# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
+extern wint_t btowc (int c);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef btowc
+# define btowc(c) \
+ (GL_LINK_WARNING ("btowc is unportable - " \
+ "use gnulib module btowc for portability"), \
+ btowc (c))
+#endif
+
+
+/* Convert a wide character to a single-byte character. */
+#if @GNULIB_WCTOB@
+# if @REPLACE_WCTOB@
+# undef wctob
+# define wctob rpl_wctob
+# endif
+# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
+/* wctob is provided by gnulib, or wctob exists but is not declared. */
+extern int wctob (wint_t wc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctob
+# define wctob(w) \
+ (GL_LINK_WARNING ("wctob is unportable - " \
+ "use gnulib module wctob for portability"), \
+ wctob (w))
+#endif
+
+
+/* Test whether *PS is in the initial state. */
+#if @GNULIB_MBSINIT@
+# if @REPLACE_MBSINIT@
+# undef mbsinit
+# define mbsinit rpl_mbsinit
+# endif
+# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
+extern int mbsinit (const mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsinit
+# define mbsinit(p) \
+ (GL_LINK_WARNING ("mbsinit is unportable - " \
+ "use gnulib module mbsinit for portability"), \
+ mbsinit (p))
+#endif
+
+
+/* Convert a multibyte character to a wide character. */
+#if @GNULIB_MBRTOWC@
+# if @REPLACE_MBRTOWC@
+# undef mbrtowc
+# define mbrtowc rpl_mbrtowc
+# endif
+# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
+extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrtowc
+# define mbrtowc(w,s,n,p) \
+ (GL_LINK_WARNING ("mbrtowc is unportable - " \
+ "use gnulib module mbrtowc for portability"), \
+ mbrtowc (w, s, n, p))
+#endif
+
+
+/* Recognize a multibyte character. */
+#if @GNULIB_MBRLEN@
+# if @REPLACE_MBRLEN@
+# undef mbrlen
+# define mbrlen rpl_mbrlen
+# endif
+# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
+extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrlen
+# define mbrlen(s,n,p) \
+ (GL_LINK_WARNING ("mbrlen is unportable - " \
+ "use gnulib module mbrlen for portability"), \
+ mbrlen (s, n, p))
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSRTOWCS@
+# if @REPLACE_MBSRTOWCS@
+# undef mbsrtowcs
+# define mbsrtowcs rpl_mbsrtowcs
+# endif
+# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
+extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsrtowcs
+# define mbsrtowcs(d,s,l,p) \
+ (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
+ "use gnulib module mbsrtowcs for portability"), \
+ mbsrtowcs (d, s, l, p))
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSNRTOWCS@
+# if @REPLACE_MBSNRTOWCS@
+# undef mbsnrtowcs
+# define mbsnrtowcs rpl_mbsnrtowcs
+# endif
+# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
+extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsnrtowcs
+# define mbsnrtowcs(d,s,n,l,p) \
+ (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
+ "use gnulib module mbsnrtowcs for portability"), \
+ mbsnrtowcs (d, s, n, l, p))
+#endif
+
+
+/* Convert a wide character to a multibyte character. */
+#if @GNULIB_WCRTOMB@
+# if @REPLACE_WCRTOMB@
+# undef wcrtomb
+# define wcrtomb rpl_wcrtomb
+# endif
+# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
+extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcrtomb
+# define wcrtomb(s,w,p) \
+ (GL_LINK_WARNING ("wcrtomb is unportable - " \
+ "use gnulib module wcrtomb for portability"), \
+ wcrtomb (s, w, p))
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSRTOMBS@
+# if @REPLACE_WCSRTOMBS@
+# undef wcsrtombs
+# define wcsrtombs rpl_wcsrtombs
+# endif
+# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
+extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrtombs
+# define wcsrtombs(d,s,l,p) \
+ (GL_LINK_WARNING ("wcsrtombs is unportable - " \
+ "use gnulib module wcsrtombs for portability"), \
+ wcsrtombs (d, s, l, p))
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSNRTOMBS@
+# if !@HAVE_WCSNRTOMBS@
+extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnrtombs
+# define wcsnrtombs(d,s,n,l,p) \
+ (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
+ "use gnulib module wcsnrtombs for portability"), \
+ wcsnrtombs (d, s, n, l, p))
#endif
diff --git a/libextra/gl/Makefile.am b/libextra/gl/Makefile.am
index 4f63b51481..1940eaf441 100644
--- a/libextra/gl/Makefile.am
+++ b/libextra/gl/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/libextra/gl/m4/extensions.m4 b/libextra/gl/m4/extensions.m4
index 917af94805..611fcfdbc4 100644
--- a/libextra/gl/m4/extensions.m4
+++ b/libextra/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 5 -*- Autoconf -*-
+# serial 6 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
@@ -24,6 +24,8 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
@@ -36,6 +38,16 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
[Define to 1 if on MINIX.])
fi
+ dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
+ dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
+ dnl provided.
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_XOPEN_SOURCE], [500],
+ [Define to 500 only on HP-UX.])
+ ;;
+ esac
+
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
diff --git a/libextra/gl/m4/gnulib-cache.m4 b/libextra/gl/m4/gnulib-cache.m4
index 273e603df4..8c2068bf4a 100644
--- a/libextra/gl/m4/gnulib-cache.m4
+++ b/libextra/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/libextra/gl/m4/gnulib-comp.m4 b/libextra/gl/m4/gnulib-comp.m4
index ce0255bfb5..64eec35f50 100644
--- a/libextra/gl/m4/gnulib-comp.m4
+++ b/libextra/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/libextra/gl/m4/lib-link.m4 b/libextra/gl/m4/lib-link.m4
index 7e07a42468..e29eead276 100644
--- a/libextra/gl/m4/lib-link.m4
+++ b/libextra/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 16 (gettext-0.18)
+# lib-link.m4 serial 17 (gettext-0.18)
dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -446,12 +446,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
case "$found_dir" in
*/$acl_libdirstem | */$acl_libdirstem/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
- LIB[]NAME[]_PREFIX="$basedir"
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
additional_includedir="$basedir/include"
;;
*/$acl_libdirstem2 | */$acl_libdirstem2/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
- LIB[]NAME[]_PREFIX="$basedir"
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
additional_includedir="$basedir/include"
;;
esac