summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/ChangeLog4
-rw-r--r--build-aux/texinfo.tex44
-rw-r--r--lib/ChangeLog10
-rw-r--r--lib/allocsa.h17
-rwxr-xr-xlib/config.charset44
-rw-r--r--lib/error.c113
-rw-r--r--lib/error.h4
-rw-r--r--lib/exitfail.c2
-rw-r--r--lib/full-write.c2
-rw-r--r--lib/getaddrinfo.c14
-rw-r--r--lib/getaddrinfo.h134
-rw-r--r--lib/gettext.h166
-rw-r--r--lib/localcharset.c81
-rw-r--r--lib/mbchar.h121
-rw-r--r--lib/mbswidth.c2
-rw-r--r--lib/mkstemp-safer.c6
-rw-r--r--lib/pipe-safer.c11
-rw-r--r--lib/printf-args.c29
-rw-r--r--lib/quote.c2
-rw-r--r--lib/readlink.c2
-rw-r--r--lib/regex_internal.h3
-rw-r--r--lib/setenv.c6
-rw-r--r--lib/stdint_.h4
-rw-r--r--lib/stdio--.h5
-rw-r--r--lib/stdio-safer.h3
-rw-r--r--lib/stpcpy.c5
-rw-r--r--lib/strcspn.c7
-rw-r--r--lib/strtoimax.c8
-rw-r--r--lib/vasprintf.h4
-rw-r--r--lib/version-etc.c6
-rw-r--r--lib/wcwidth.h9
-rw-r--r--m4/ChangeLog10
-rw-r--r--m4/getline.m417
-rw-r--r--m4/gettext.m4196
-rw-r--r--m4/inttypes-pri.m48
-rw-r--r--m4/lib-link.m480
-rw-r--r--m4/localcharset.m43
-rw-r--r--m4/mbchar.m46
-rw-r--r--m4/nls.m424
-rw-r--r--m4/po.m483
-rw-r--r--m4/prereq.m45
-rw-r--r--m4/stdarg.m440
-rw-r--r--m4/stdint.m427
-rw-r--r--m4/stdio-safer.m412
-rw-r--r--m4/unistd-safer.m45
-rw-r--r--m4/wcwidth.m46
-rw-r--r--po/ChangeLog2
-rw-r--r--po/Makefile.in.in39
48 files changed, 1069 insertions, 362 deletions
diff --git a/build-aux/ChangeLog b/build-aux/ChangeLog
index 281057a70..5b67a0989 100644
--- a/build-aux/ChangeLog
+++ b/build-aux/ChangeLog
@@ -1,3 +1,7 @@
+2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * texinfo.tex: Update from gnulib.
+
2006-07-25 Jim Meyering <jim@meyering.net>
* vc-list-files: Handle git repositories, too.
diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex
index d41d40084..36c1acad9 100644
--- a/build-aux/texinfo.tex
+++ b/build-aux/texinfo.tex
@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2006-06-19.13}
+\def\texinfoversion{2006-07-17.16}
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
@@ -327,9 +327,9 @@
\pagebody{#1}%
\ifdim\ht\footlinebox > 0pt
% Only leave this space if the footline is nonempty.
- % (We lessened \vsize for it in \oddfootingxxx.)
+ % (We lessened \vsize for it in \oddfootingyyy.)
% The \baselineskip=24pt in plain's \makefootline has no effect.
- \vskip 2\baselineskip
+ \vskip 24pt
\unvbox\footlinebox
\fi
%
@@ -2051,11 +2051,11 @@ where each line of input produces a line of output.}
% and arrange explicitly to hyphenate at a dash.
% -- rms.
{
- \catcode`\-=\active
- \catcode`\_=\active
+ \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active
%
\global\def\code{\begingroup
- \catcode`\-=\active \catcode`\_=\active
+ \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active
+ \let'\singlequotechar
\ifallowcodebreaks
\let-\codedash
\let_\codeunder
@@ -2472,8 +2472,8 @@ where each line of input produces a line of output.}
%
% Leave some space for the footline. Hopefully ok to assume
% @evenfooting will not be used by itself.
- \global\advance\pageheight by -\baselineskip
- \global\advance\vsize by -\baselineskip
+ \global\advance\pageheight by -12pt
+ \global\advance\vsize by -12pt
}
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
@@ -5042,7 +5042,7 @@ where each line of input produces a line of output.}
{\tentt \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
%
\setbox\errorbox=\hbox to \dimen0{\hfil
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -5265,11 +5265,10 @@ where each line of input produces a line of output.}
%
\maketwodispenvs {lisp}{example}{%
\nonfillstart
- \tt
+ \tt\quoteexpand
\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
\gobble % eat return
}
-
% @display/@smalldisplay: same as @lisp except keep current font.
%
\makedispenv {display}{%
@@ -5397,6 +5396,22 @@ where each line of input produces a line of output.}
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
\def\starttabbox{\setbox0=\hbox\bgroup}
+
+% Allow an option to not replace quotes with a regular directed right
+% quote/apostrophe (char 0x27), but instead use the undirected quote
+% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
+% the default, but it works for pasting with more pdf viewers (at least
+% evince), the lilypond developers report. xpdf does work with the
+% regular 0x27.
+%
+\def\singlequotechar{%
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else
+ \char'15
+ \fi
+}
+%
\begingroup
\catcode`\^^I=\active
\gdef\tabexpand{%
@@ -5409,7 +5424,13 @@ where each line of input produces a line of output.}
\wd0=\dimen0 \box0 \starttabbox
}%
}
+ \catcode`\'=\active
+ \gdef\quoteexpand{%
+ \catcode`\'=\active
+ \def'{\singlequotechar}
+ }%
\endgroup
+%
\def\setupverbatim{%
\let\nonarrowing = t%
\nonfillstart
@@ -5418,6 +5439,7 @@ where each line of input produces a line of output.}
\def\par{\leavevmode\egroup\box0\endgraf}%
\catcode`\`=\active
\tabexpand
+ \quoteexpand
% Respect line breaks,
% print special symbols as themselves, and
% make each space count
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 2f5dd5c92..71fc71572 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,13 @@
+2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * allocsa.h, config.charset, error.c, error.h, exitfail.c, full-write.c:
+ * getaddrinfo.c, getaddrinfo.h, gettext.h, localcharset.c, mbchar.h:
+ * mbswidth.c, mkstemp-safer.c, pipe-safer.c, printf-args.c, quote.c:
+ * readlink.c, regex_internal.h, setenv.c, stdint_.h, stdio--.h:
+ * stdio-safer.h, stpcpy.c, strcspn.c, strtoimax.c, vasnprintf.h:
+ * version-etc.c, wcwidth.h:
+ Update from gnulib.
+
2006-08-09 Jim Meyering <jim@meyering.net>
* rand-isaac.c: Include <config.h>.
diff --git a/lib/allocsa.h b/lib/allocsa.h
index cb6893ad1..f8c0bc0bd 100644
--- a/lib/allocsa.h
+++ b/lib/allocsa.h
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003-2004 Free Software Foundation, Inc.
+ Copyright (C) 2003-2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,12 @@
#include <stddef.h>
#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
alloca(N); otherwise it returns NULL. It either returns N bytes of
memory allocated on the stack, that lasts until the function returns,
@@ -69,6 +75,11 @@ extern void freesa (void *p);
If this would be useful in your application. please speak up. */
+#ifdef __cplusplus
+}
+#endif
+
+
/* ------------------- Auxiliary, non-public definitions ------------------- */
/* Determine the alignment of a type at compile time. */
@@ -81,6 +92,10 @@ extern void freesa (void *p);
/* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
values. */
# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#elif defined _AIX
+ /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
#else
# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
#endif
diff --git a/lib/config.charset b/lib/config.charset
index 98294583d..148ea441f 100755
--- a/lib/config.charset
+++ b/lib/config.charset
@@ -1,7 +1,7 @@
#! /bin/sh
# Output a system dependent table of character encoding aliases.
#
-# Copyright (C) 2000-2004 Free Software Foundation, Inc.
+# Copyright (C) 2000-2004, 2006 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
@@ -30,21 +30,21 @@
# The current list of GNU canonical charset names is as follows.
#
# name MIME? used by which systems
-# ASCII, ANSI_X3.4-1968 glibc solaris freebsd darwin
-# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd darwin
-# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd darwin
+# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin
+# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
+# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
# ISO-8859-3 Y glibc solaris
-# ISO-8859-4 Y osf solaris freebsd darwin
-# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd darwin
+# ISO-8859-4 Y osf solaris freebsd netbsd darwin
+# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
# ISO-8859-6 Y glibc aix hpux solaris
-# ISO-8859-7 Y glibc aix hpux irix osf solaris darwin
+# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin
# ISO-8859-8 Y glibc aix hpux osf solaris
# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin
-# ISO-8859-13 glibc darwin
+# ISO-8859-13 glibc netbsd darwin
# ISO-8859-14 glibc
# ISO-8859-15 glibc aix osf solaris freebsd darwin
-# KOI8-R Y glibc solaris freebsd darwin
-# KOI8-U Y glibc freebsd darwin
+# KOI8-R Y glibc solaris freebsd netbsd darwin
+# KOI8-U Y glibc freebsd netbsd darwin
# KOI8-T glibc
# CP437 dos
# CP775 dos
@@ -57,7 +57,7 @@
# CP862 dos
# CP864 dos
# CP865 dos
-# CP866 freebsd darwin dos
+# CP866 freebsd netbsd darwin dos
# CP869 dos
# CP874 woe32 dos
# CP922 aix
@@ -70,22 +70,22 @@
# CP1125 dos
# CP1129 aix
# CP1250 woe32
-# CP1251 glibc solaris darwin woe32
+# CP1251 glibc solaris netbsd darwin woe32
# CP1252 aix woe32
# CP1253 woe32
# CP1254 woe32
# CP1255 glibc woe32
# CP1256 woe32
# CP1257 woe32
-# GB2312 Y glibc aix hpux irix solaris freebsd darwin
-# EUC-JP Y glibc aix hpux irix osf solaris freebsd darwin
-# EUC-KR Y glibc aix hpux irix osf solaris freebsd darwin
-# EUC-TW glibc aix hpux irix osf solaris
-# BIG5 Y glibc aix hpux osf solaris freebsd darwin
+# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
+# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
+# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin
+# EUC-TW glibc aix hpux irix osf solaris netbsd
+# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin
# BIG5-HKSCS glibc solaris
# GBK glibc aix osf solaris woe32 dos
-# GB18030 glibc solaris
-# SHIFT_JIS Y hpux osf solaris freebsd darwin
+# GB18030 glibc solaris netbsd
+# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
# JOHAB glibc solaris woe32
# TIS-620 glibc aix hpux osf solaris
# VISCII Y glibc
@@ -99,7 +99,7 @@
# HP-KANA8 hpux
# DEC-KANJI osf
# DEC-HANYU osf
-# UTF-8 Y glibc aix hpux osf solaris darwin
+# UTF-8 Y glibc aix hpux osf solaris netbsd darwin
#
# Note: Names which are not marked as being a MIME name should not be used in
# Internet protocols for information interchange (mail, news, etc.).
@@ -387,6 +387,8 @@ case "$os" in
echo "ISO8859-2 ISO-8859-2"
echo "ISO8859-4 ISO-8859-4"
echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-13 ISO-8859-13"
echo "ISO8859-15 ISO-8859-15"
echo "eucCN GB2312"
echo "eucJP EUC-JP"
@@ -479,7 +481,7 @@ case "$os" in
echo "# If you find that the encoding given for your language and"
echo "# country is not the one your DOS machine actually uses, just"
echo "# correct it in this file, and send a mail to"
- echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
+ echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
echo "# and Bruno Haible <bruno@clisp.org>."
echo "#"
echo "C ASCII"
diff --git a/lib/error.c b/lib/error.c
index 45698be8d..34e836552 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -34,6 +34,9 @@
#endif
#ifdef _LIBC
+# include <libintl.h>
+# include <stdbool.h>
+# include <stdint.h>
# include <wchar.h>
# define mbsrtowcs __mbsrtowcs
#endif
@@ -59,6 +62,7 @@ unsigned int error_message_count;
# define program_name program_invocation_name
# include <errno.h>
+# include <limits.h>
# include <libio/libioP.h>
/* In GNU libc we want do not want to use the common name `error' directly.
@@ -122,14 +126,10 @@ print_errno_message (int errnum)
#endif
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- {
- __fwprintf (stderr, L": %s", s);
- return;
- }
-#endif
-
+ __fxprintf (NULL, ": %s", s);
+#else
fprintf (stderr, ": %s", s);
+#endif
}
static void
@@ -140,26 +140,65 @@ error_tail (int status, int errnum, const char *message, va_list args)
{
# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
- const wchar_t *wmessage = L"out of memory";
- wchar_t *wbuf = (len < ALLOCA_LIMIT
- ? alloca (len * sizeof *wbuf)
- : len <= SIZE_MAX / sizeof *wbuf
- ? malloc (len * sizeof *wbuf)
- : NULL);
-
- if (wbuf)
+ wchar_t *wmessage = NULL;
+ mbstate_t st;
+ size_t res;
+ const char *tmp;
+ bool use_malloc = false;
+
+ while (1)
{
- size_t res;
- mbstate_t st;
- const char *tmp = message;
+ if (__libc_use_alloca (len * sizeof (wchar_t)))
+ wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
+ else
+ {
+ if (!use_malloc)
+ wmessage = NULL;
+
+ wchar_t *p = (wchar_t *) realloc (wmessage,
+ len * sizeof (wchar_t));
+ if (p == NULL)
+ {
+ free (wmessage);
+ fputws_unlocked (L"out of memory\n", stderr);
+ return;
+ }
+ wmessage = p;
+ use_malloc = true;
+ }
+
memset (&st, '\0', sizeof (st));
- res = mbsrtowcs (wbuf, &tmp, len, &st);
- wmessage = res == (size_t) -1 ? L"???" : wbuf;
+ tmp = message;
+
+ res = mbsrtowcs (wmessage, &tmp, len, &st);
+ if (res != len)
+ break;
+
+ if (__builtin_expect (len >= SIZE_MAX / 2, 0))
+ {
+ /* This really should not happen if everything is fine. */
+ res = (size_t) -1;
+ break;
+ }
+
+ len *= 2;
+ }
+
+ if (res == (size_t) -1)
+ {
+ /* The string cannot be converted. */
+ if (use_malloc)
+ {
+ free (wmessage);
+ use_malloc = false;
+ }
+ wmessage = (wchar_t *) L"???";
}
__vfwprintf (stderr, wmessage, args);
- if (! (len < ALLOCA_LIMIT))
- free (wbuf);
+
+ if (use_malloc)
+ free (wmessage);
}
else
#endif
@@ -170,11 +209,10 @@ error_tail (int status, int errnum, const char *message, va_list args)
if (errnum)
print_errno_message (errnum);
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- putwc (L'\n', stderr);
- else
+ __fxprintf (NULL, "\n");
+#else
+ putc ('\n', stderr);
#endif
- putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
@@ -207,11 +245,10 @@ error (int status, int errnum, const char *message, ...)
else
{
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s: ", program_name);
- else
+ __fxprintf (NULL, "%s: ", program_name);
+#else
+ fprintf (stderr, "%s: ", program_name);
#endif
- fprintf (stderr, "%s: ", program_name);
}
va_start (args, message);
@@ -267,21 +304,19 @@ error_at_line (int status, int errnum, const char *file_name,
else
{
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s: ", program_name);
- else
+ __fxprintf (NULL, "%s:", program_name);
+#else
+ fprintf (stderr, "%s:", program_name);
#endif
- fprintf (stderr, "%s:", program_name);
}
if (file_name != NULL)
{
#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s:%d: ", file_name, line_number);
- else
+ __fxprintf (NULL, "%s:%d: ", file_name, line_number);
+#else
+ fprintf (stderr, "%s:%d: ", file_name, line_number);
#endif
- fprintf (stderr, "%s:%d: ", file_name, line_number);
}
va_start (args, message);
diff --git a/lib/error.h b/lib/error.h
index e5220a2f1..5a5f24765 100644
--- a/lib/error.h
+++ b/lib/error.h
@@ -1,5 +1,5 @@
/* Declaration for error-reporting function
- Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
diff --git a/lib/exitfail.c b/lib/exitfail.c
index 27d38c32a..24df22851 100644
--- a/lib/exitfail.c
+++ b/lib/exitfail.c
@@ -1,6 +1,6 @@
/* Failure exit status
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005 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
diff --git a/lib/full-write.c b/lib/full-write.c
index 106f3c7e5..c4624e5dc 100644
--- a/lib/full-write.c
+++ b/lib/full-write.c
@@ -1,7 +1,7 @@
/* An interface to read and write that retries (if necessary) until complete.
Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 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
diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c
index e6bad1103..9003abf60 100644
--- a/lib/getaddrinfo.c
+++ b/lib/getaddrinfo.c
@@ -140,7 +140,7 @@ getaddrinfo (const char *restrict nodename,
return getaddrinfo_ptr (nodename, servname, hints, res);
#endif
- if (hints && (hints->ai_flags & ~AI_CANONNAME))
+ if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
/* FIXME: Support more flags. */
return EAI_BADFLAGS;
@@ -153,8 +153,16 @@ getaddrinfo (const char *restrict nodename,
return EAI_SOCKTYPE; /* FIXME: Better return code? */
if (!nodename)
- /* FIXME: Support server bind mode. */
- return EAI_NONAME;
+ {
+ if (!(hints->ai_flags & AI_PASSIVE))
+ return EAI_NONAME;
+
+#ifdef HAVE_IPV6
+ nodename = (hint->ai_family == AF_INET6) ? "::" : "0.0.0.0";
+#else
+ nodename = "0.0.0.0";
+#endif
+ }
if (servname)
{
diff --git a/lib/getaddrinfo.h b/lib/getaddrinfo.h
index d87485ef8..b4ef242cf 100644
--- a/lib/getaddrinfo.h
+++ b/lib/getaddrinfo.h
@@ -1,5 +1,6 @@
/* Get address information.
- Copyright (C) 1996-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify
@@ -17,20 +18,20 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef GETADDRINFO_H
-# define GETADDRINFO_H
+#define GETADDRINFO_H
/* sys/socket.h in i386-unknown-freebsd4.10 and
powerpc-apple-darwin5.5 require sys/types.h, so include it first.
Then we'll also get 'socklen_t' and 'struct sockaddr' which are
used below. */
-# include <sys/types.h>
+#include <sys/types.h>
/* Get all getaddrinfo related declarations, if available. */
-# include <sys/socket.h>
+#include <sys/socket.h>
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
-# ifndef HAVE_STRUCT_ADDRINFO
+#ifndef HAVE_STRUCT_ADDRINFO
/* Structure to contain information about address of a service provider. */
struct addrinfo
@@ -44,69 +45,70 @@ struct addrinfo
char *ai_canonname; /* Canonical name for service location. */
struct addrinfo *ai_next; /* Pointer to next in list. */
};
-# endif
+#endif
/* Possible values for `ai_flags' field in `addrinfo' structure. */
-# ifndef AI_PASSIVE
-# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
-# endif
-# ifndef AI_CANONNAME
-# define AI_CANONNAME 0x0002 /* Request for canonical name. */
-# endif
-# ifndef AI_NUMERICHOST
-# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
-# endif
-# ifndef AI_V4MAPPED
-# define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
-# endif
-# ifndef AI_ALL
-# define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
-# endif
-# ifndef AI_ADDRCONFIG
-# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
- returned address type.. */
+#ifndef AI_PASSIVE
+# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
+#endif
+#ifndef AI_CANONNAME
+# define AI_CANONNAME 0x0002 /* Request for canonical name. */
#endif
#ifndef AI_NUMERICSERV
-# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
-# endif
+# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
+#endif
+
+#if 0
+/* The commented out definitions below are not yet implemented in the
+ GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
+ cause conflicts on systems with a getaddrinfo() function which does not
+ define them.
+
+ If they are restored, be sure to protect the definitions with #ifndef. */
+#define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
+#define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
+#define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
+#define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
+ returned address type.. */
+#endif /* 0 */
/* Error values for `getaddrinfo' function. */
-# ifndef EAI_BADFLAGS
-# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
-# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
-# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
-# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
-# define EAI_NODATA -5 /* No address associated with NAME. */
-# define EAI_FAMILY -6 /* `ai_family' not supported. */
-# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
-# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
-# define EAI_MEMORY -10 /* Memory allocation failure. */
+#ifndef EAI_BADFLAGS
+# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
+# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
+# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
+# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+# define EAI_NODATA -5 /* No address associated with NAME. */
+# define EAI_FAMILY -6 /* `ai_family' not supported. */
+# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
+# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
+# define EAI_MEMORY -10 /* Memory allocation failure. */
#endif
#ifndef EAI_OVERFLOW
/* Not defined on mingw32. */
-# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
+# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
#endif
-# ifndef EAI_ADDRFAMILY
+#ifndef EAI_ADDRFAMILY
/* Not defined on mingw32. */
-# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
-# endif
-# ifndef EAI_SYSTEM
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
+#endif
+#ifndef EAI_SYSTEM
/* Not defined on mingw32. */
-# define EAI_SYSTEM -11 /* System error returned in `errno'. */
-# endif
+# define EAI_SYSTEM -11 /* System error returned in `errno'. */
+#endif
-# ifdef __USE_GNU
-# ifndef EAI_INPROGRESS
-# define EAI_INPROGRESS -100 /* Processing request in progress. */
-# define EAI_CANCELED -101 /* Request canceled. */
-# define EAI_NOTCANCELED -102 /* Request not canceled. */
-# define EAI_ALLDONE -103 /* All requests done. */
-# define EAI_INTR -104 /* Interrupted by a signal. */
-# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
-# endif
+#ifdef __USE_GNU
+# ifndef EAI_INPROGRESS
+# define EAI_INPROGRESS -100 /* Processing request in progress. */
+# define EAI_CANCELED -101 /* Request canceled. */
+# define EAI_NOTCANCELED -102 /* Request not canceled. */
+# define EAI_ALLDONE -103 /* All requests done. */
+# define EAI_INTR -104 /* Interrupted by a signal. */
+# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
# endif
+#endif
-# if !HAVE_DECL_GETADDRINFO
+#if !HAVE_DECL_GETADDRINFO
/* Translate name of a service location and/or a service name to set of
socket addresses.
For more details, see the POSIX:2001 specification
@@ -115,23 +117,23 @@ extern int getaddrinfo (const char *restrict nodename,
const char *restrict servname,
const struct addrinfo *restrict hints,
struct addrinfo **restrict res);
-# endif
+#endif
-# if !HAVE_DECL_FREEADDRINFO
+#if !HAVE_DECL_FREEADDRINFO
/* Free `addrinfo' structure AI including associated storage.
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
extern void freeaddrinfo (struct addrinfo *ai);
-# endif
+#endif
-# if !HAVE_DECL_GAI_STRERROR
+#if !HAVE_DECL_GAI_STRERROR
/* Convert error return from getaddrinfo() to a string.
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/gai_strerror.html>. */
extern const char *gai_strerror (int ecode);
-# endif
+#endif
-# if !HAVE_DECL_GETNAMEINFO
+#if !HAVE_DECL_GETNAMEINFO
/* Convert socket address to printable node and service names.
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/getnameinfo.html>. */
@@ -140,14 +142,14 @@ extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
char *restrict service, socklen_t servicelen,
int flags);
-# endif
+#endif
/* Possible flags for getnameinfo. */
-# ifndef NI_NUMERICHOST
-# define NI_NUMERICHOST 1
-# endif
-# ifndef NI_NUMERICSERV
-# define NI_NUMERICSERV 2
-# endif
+#ifndef NI_NUMERICHOST
+# define NI_NUMERICHOST 1
+#endif
+#ifndef NI_NUMERICSERV
+# define NI_NUMERICSERV 2
+#endif
#endif /* GETADDRINFO_H */
diff --git a/lib/gettext.h b/lib/gettext.h
index 285cb314c..deeaf7931 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006 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
@@ -75,4 +75,168 @@
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
+/* The separator between msgctxt and msgid in a .mo file. */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
+ short and rarely need to change.
+ The letter 'p' stands for 'particular' or 'special'. */
+#define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ int category)
+{
+ const char *translation = dcgettext (domain, msg_ctxt_id, category);
+ if (translation == msg_ctxt_id)
+ return msgid;
+ else
+ return translation;
+}
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ const char *translation =
+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ if (translation == msg_ctxt_id || translation == msgid_plural)
+ return (n == 1 ? msgid : msgid_plural);
+ else
+ return translation;
+}
+
+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
+ can be arbitrary expressions. But for string literals these macros are
+ less efficient than those above. */
+
+#include <string.h>
+
+#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
+ (__GNUC__ >= 3 || defined __cplusplus)
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcgettext (domain, msg_ctxt_id, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (translation != msg_ctxt_id)
+ return translation;
+ }
+ return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (!(translation == msg_ctxt_id || translation == msgid_plural))
+ return translation;
+ }
+ return (n == 1 ? msgid : msgid_plural);
+}
+
#endif /* _LIBGETTEXT_H */
diff --git a/lib/localcharset.c b/lib/localcharset.c
index d03ab79d0..cd44ca658 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -25,23 +25,13 @@
/* Specification. */
#include "localcharset.h"
-#if HAVE_STDDEF_H
-# include <stddef.h>
-#endif
-
+#include <stddef.h>
#include <stdio.h>
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <string.h>
+#include <stdlib.h>
#if defined _WIN32 || defined __WIN32__
-# undef WIN32 /* avoid warning on mingw32 */
-# define WIN32
+# define WIN32_NATIVE
#endif
#if defined __EMX__
@@ -49,7 +39,7 @@
# define OS2
#endif
-#if !defined WIN32
+#if !defined WIN32_NATIVE
# if HAVE_LANGINFO_CODESET
# include <langinfo.h>
# else
@@ -57,7 +47,11 @@
# include <locale.h>
# endif
# endif
-#elif defined WIN32
+# ifdef __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# endif
+#elif defined WIN32_NATIVE
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
@@ -113,7 +107,7 @@ get_charset_aliases (void)
cp = charset_aliases;
if (cp == NULL)
{
-#if !(defined VMS || defined WIN32)
+#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
FILE *fp;
const char *dir;
const char *base = "charset.alias";
@@ -239,7 +233,7 @@ get_charset_aliases (void)
"DECKOREAN" "\0" "EUC-KR" "\0";
# endif
-# if defined WIN32
+# if defined WIN32_NATIVE || defined __CYGWIN__
/* To avoid the troubles of installing a separate file in the same
directory as the DLL and of retrieving the DLL's directory at
runtime, simply inline the aliases here. */
@@ -291,13 +285,60 @@ locale_charset (void)
const char *codeset;
const char *aliases;
-#if !(defined WIN32 || defined OS2)
+#if !(defined WIN32_NATIVE || defined OS2)
# if HAVE_LANGINFO_CODESET
/* Most systems support nl_langinfo (CODESET) nowadays. */
codeset = nl_langinfo (CODESET);
+# ifdef __CYGWIN__
+ /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always
+ returns "US-ASCII". As long as this is not fixed, return the suffix
+ of the locale name from the environment variables (if present) or
+ the codepage as a number. */
+ if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+ {
+ const char *locale;
+ static char buf[2 + 10 + 1];
+
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return
+ it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
+ }
+
+ /* Woe32 has a function returning the locale's codepage as a number. */
+ sprintf (buf, "CP%u", GetACP ());
+ codeset = buf;
+ }
+# endif
+
# else
/* On old systems which lack it, use setlocale or getenv. */
@@ -328,7 +369,7 @@ locale_charset (void)
# endif
-#elif defined WIN32
+#elif defined WIN32_NATIVE
static char buf[2 + 10 + 1];
diff --git a/lib/mbchar.h b/lib/mbchar.h
index 738efd948..52b107578 100644
--- a/lib/mbchar.h
+++ b/lib/mbchar.h
@@ -157,6 +157,127 @@
#include <wchar.h>
#include <wctype.h>
+/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
+ Assume all 12 functions are implemented the same way, or not at all. */
+#if !defined iswalnum && !HAVE_ISWCNTRL
+static inline int
+iswalnum (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')
+ : 0);
+}
+# define iswalnum iswalnum
+#endif
+#if !defined iswalpha && !HAVE_ISWCNTRL
+static inline int
+iswalpha (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'
+ : 0);
+}
+# define iswalpha iswalpha
+#endif
+#if !defined iswblank && !HAVE_ISWCNTRL
+static inline int
+iswblank (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc == ' ' || wc == '\t'
+ : 0);
+}
+# define iswblank iswblank
+#endif
+#if !defined iswcntrl && !HAVE_ISWCNTRL
+static inline int
+iswcntrl (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? (wc & ~0x1f) == 0 || wc == 0x7f
+ : 0);
+}
+# define iswcntrl iswcntrl
+#endif
+#if !defined iswdigit && !HAVE_ISWCNTRL
+static inline int
+iswdigit (wint_t wc)
+{
+ return (wc >= '0' && wc <= '9');
+}
+# define iswdigit iswdigit
+#endif
+#if !defined iswgraph && !HAVE_ISWCNTRL
+static inline int
+iswgraph (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= '!' && wc <= '~'
+ : 1);
+}
+# define iswgraph iswgraph
+#endif
+#if !defined iswlower && !HAVE_ISWCNTRL
+static inline int
+iswlower (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= 'a' && wc <= 'z'
+ : 0);
+}
+# define iswlower iswlower
+#endif
+#if !defined iswprint && !HAVE_ISWCNTRL
+static inline int
+iswprint (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= ' ' && wc <= '~'
+ : 1);
+}
+# define iswprint iswprint
+#endif
+#if !defined iswpunct && !HAVE_ISWCNTRL
+static inline int
+iswpunct (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= '!' && wc <= '~'
+ && !((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'))
+ : 1);
+}
+# define iswpunct iswpunct
+#endif
+#if !defined iswspace && !HAVE_ISWCNTRL
+static inline int
+iswspace (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc == ' ' || wc == '\t'
+ || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'
+ : 0);
+}
+# define iswspace iswspace
+#endif
+#if !defined iswupper && !HAVE_ISWCNTRL
+static inline int
+iswupper (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= 'A' && wc <= 'Z'
+ : 0);
+}
+# define iswupper iswupper
+#endif
+#if !defined iswxdigit && !HAVE_ISWCNTRL
+static inline int
+iswxdigit (wint_t wc)
+{
+ return (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F');
+}
+# define iswxdigit iswxdigit
+#endif
#include "wcwidth.h"
diff --git a/lib/mbswidth.c b/lib/mbswidth.c
index 48da6639d..072695172 100644
--- a/lib/mbswidth.c
+++ b/lib/mbswidth.c
@@ -51,7 +51,7 @@
# include <wctype.h>
#endif
#if !defined iswcntrl && !HAVE_ISWCNTRL
-# define iswcntrl(wc) 0
+# define iswcntrl(wc) (((wc) & ~0x1f) == 0 || (wc) == 0x7f)
#endif
#ifndef mbsinit
diff --git a/lib/mkstemp-safer.c b/lib/mkstemp-safer.c
index 5ae3413f0..315385da0 100644
--- a/lib/mkstemp-safer.c
+++ b/lib/mkstemp-safer.c
@@ -1,6 +1,6 @@
/* Invoke mkstemp, but avoid some glitches.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 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
@@ -27,6 +27,10 @@
#include <stdlib.h>
#include "unistd-safer.h"
+#if ! HAVE_MKSTEMP
+int mkstemp (char *);
+#endif
+
/* Like mkstemp, but do not return STDIN_FILENO, STDOUT_FILENO, or
STDERR_FILENO. */
diff --git a/lib/pipe-safer.c b/lib/pipe-safer.c
index fb02d7217..646cd5dab 100644
--- a/lib/pipe-safer.c
+++ b/lib/pipe-safer.c
@@ -1,5 +1,5 @@
/* Invoke pipe, but avoid some glitches.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 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
@@ -24,13 +24,16 @@
#include "unistd-safer.h"
#include <unistd.h>
+#include <errno.h>
/* Like pipe, but ensure that neither of the file descriptors is
- STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. */
+ STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. Fail with ENOSYS on
+ platforms that lack pipe. */
int
pipe_safer (int fd[2])
{
+#if HAVE_FUNC_PIPE
int fail = pipe (fd);
if (fail)
return fail;
@@ -47,4 +50,8 @@ pipe_safer (int fd[2])
}
return 0;
+#else /* ! HAVE_FUNC_PIPE */
+ errno = ENOSYS;
+ return -1;
+#endif
}
diff --git a/lib/printf-args.c b/lib/printf-args.c
index 0ed1acbb8..761345622 100644
--- a/lib/printf-args.c
+++ b/lib/printf-args.c
@@ -1,5 +1,5 @@
/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2003, 2005-2006 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
@@ -79,15 +79,40 @@ printf_fetchargs (va_list args, arguments *a)
break;
#ifdef HAVE_WINT_T
case TYPE_WIDE_CHAR:
- ap->a.a_wide_char = va_arg (args, wint_t);
+ /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
+ default argument promotions", this is not the case in mingw32,
+ where wint_t is 'unsigned short'. */
+ ap->a.a_wide_char =
+ (sizeof (wint_t) < sizeof (int)
+ ? va_arg (args, int)
+ : va_arg (args, wint_t));
break;
#endif
case TYPE_STRING:
ap->a.a_string = va_arg (args, const char *);
+ /* A null pointer is an invalid argument for "%s", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_string == NULL)
+ ap->a.a_string = "(NULL)";
break;
#ifdef HAVE_WCHAR_T
case TYPE_WIDE_STRING:
ap->a.a_wide_string = va_arg (args, const wchar_t *);
+ /* A null pointer is an invalid argument for "%ls", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_wide_string == NULL)
+ {
+ static const wchar_t wide_null_string[] =
+ {
+ (wchar_t)'(',
+ (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+ (wchar_t)')',
+ (wchar_t)0
+ };
+ ap->a.a_wide_string = wide_null_string;
+ }
break;
#endif
case TYPE_POINTER:
diff --git a/lib/quote.c b/lib/quote.c
index 16cc939c1..70f1d1d75 100644
--- a/lib/quote.c
+++ b/lib/quote.c
@@ -1,5 +1,5 @@
/* quote.c - quote arguments for output
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 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
diff --git a/lib/readlink.c b/lib/readlink.c
index 3196aecb0..875cc9736 100644
--- a/lib/readlink.c
+++ b/lib/readlink.c
@@ -1,5 +1,5 @@
/* Stub for readlink().
- Copyright (C) 2003-2004 Free Software Foundation, Inc.
+ Copyright (C) 2003-2005 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
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 993c9923e..06f89a47f 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -49,7 +49,6 @@
#if defined _LIBC
# include <bits/libc-lock.h>
#else
-# define __libc_lock_define(CLASS,NAME)
# define __libc_lock_init(NAME) do { } while (0)
# define __libc_lock_lock(NAME) do { } while (0)
# define __libc_lock_unlock(NAME) do { } while (0)
@@ -711,7 +710,9 @@ struct re_dfa_t
#ifdef DEBUG
char* re_str;
#endif
+#ifdef _LIBC
__libc_lock_define (, lock)
+#endif
};
#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
diff --git a/lib/setenv.c b/lib/setenv.c
index 1cbe1a25b..335d1d2f9 100644
--- a/lib/setenv.c
+++ b/lib/setenv.c
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -27,7 +27,9 @@
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+#if _LIBC || HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#if !_LIBC
# include "allocsa.h"
diff --git a/lib/stdint_.h b/lib/stdint_.h
index adab4d7c2..44eca933c 100644
--- a/lib/stdint_.h
+++ b/lib/stdint_.h
@@ -394,8 +394,12 @@
#define WINT_MAX \
_STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
+
/* 7.18.4. Macros for integer constants */
+#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
+
/* 7.18.4.1. Macros for minimum-width integer constants */
/* According to ISO C 99 Technical Corrigendum 1 */
diff --git a/lib/stdio--.h b/lib/stdio--.h
index b2765fd52..2385e626f 100644
--- a/lib/stdio--.h
+++ b/lib/stdio--.h
@@ -1,6 +1,6 @@
/* Like stdio.h, but redefine some names to avoid glitches.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 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
@@ -23,3 +23,6 @@
#undef fopen
#define fopen fopen_safer
+
+#undef tmpfile
+#define tmpfile tmpfile_safer
diff --git a/lib/stdio-safer.h b/lib/stdio-safer.h
index 0b9a9ab80..8329a1a09 100644
--- a/lib/stdio-safer.h
+++ b/lib/stdio-safer.h
@@ -1,6 +1,6 @@
/* Invoke stdio functions, but avoid some glitches.
- Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2006 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
@@ -21,3 +21,4 @@
#include <stdio.h>
FILE *fopen_safer (char const *, char const *);
+FILE *tmpfile_safer (void);
diff --git a/lib/stpcpy.c b/lib/stpcpy.c
index acda21a26..bb667a05e 100644
--- a/lib/stpcpy.c
+++ b/lib/stpcpy.c
@@ -15,9 +15,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
diff --git a/lib/strcspn.c b/lib/strcspn.c
index 9fbc5de49..46d7d36ca 100644
--- a/lib/strcspn.c
+++ b/lib/strcspn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1996-1997, 2002-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1996-1997, 2002-2003, 2005 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
@@ -14,9 +14,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
index a15b84af3..098cfa966 100644
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -23,12 +23,8 @@
# include <config.h>
#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#if HAVE_STDINT_H
-# include <stdint.h>
-#endif
+/* Verify interface. */
+#include <inttypes.h>
#include <stdlib.h>
diff --git a/lib/vasprintf.h b/lib/vasprintf.h
index d02f15451..ab5515ce7 100644
--- a/lib/vasprintf.h
+++ b/lib/vasprintf.h
@@ -11,8 +11,8 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _VASPRINTF_H
diff --git a/lib/version-etc.c b/lib/version-etc.c
index cb9e4c2f0..7887c26e2 100644
--- a/lib/version-etc.c
+++ b/lib/version-etc.c
@@ -50,11 +50,7 @@ version_etc_va (FILE *stream,
{
va_list tmp_authors;
-#ifdef __va_copy
- __va_copy (tmp_authors, authors);
-#else
- tmp_authors = authors;
-#endif
+ va_copy (tmp_authors, authors);
n_authors = 0;
while (va_arg (tmp_authors, const char *) != NULL)
diff --git a/lib/wcwidth.h b/lib/wcwidth.h
index 9af75e0a7..37b83cb82 100644
--- a/lib/wcwidth.h
+++ b/lib/wcwidth.h
@@ -36,7 +36,14 @@
# include <wctype.h>
# endif
# if !defined iswprint && !HAVE_ISWPRINT
-# define iswprint(wc) 1
+static inline int
+iswprint (wint_t wc)
+{
+ return (wc >= 0 && wc < 128
+ ? wc >= ' ' && wc <= '~'
+ : 1);
+}
+# define iswprint iswprint
# endif
# ifndef HAVE_DECL_WCWIDTH
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 6f51015a3..18939a551 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,13 @@
+2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * inttypes-h.m4, stdarg.m4: New files, from gnulib.
+ * prereq.m4 (gl_PREREQ): Require gl_STDARG_H.
+ Require gl_FOPEN_SAFER rather than gl_STDIO_SAFER (due to renaming).
+ * getline.m4, gettext.m4, inttypes-pri.m4, lib-link.m4, localcharset.m4:
+ * mbchar.m4, nls.m4, po.m4, stdint.m4, stdio-safer.m4, unistd-safer.m4:
+ * wcwidth.m4:
+ Update from gnulib.
+
2006-08-08 Paul Eggert <eggert@cs.ucla.edu>
* memxfrm.m4, randint.m4, randperm.m4, randread.m4: New files.
diff --git a/m4/getline.m4 b/m4/getline.m4
index ff255a366..f49c50eed 100644
--- a/m4/getline.m4
+++ b/m4/getline.m4
@@ -1,6 +1,6 @@
-# getline.m4 serial 13
+# getline.m4 serial 14
-dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software
+dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software
dnl Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
@@ -47,7 +47,18 @@ AC_DEFUN([gl_FUNC_GETLINE],
}
], am_cv_func_working_getline=yes dnl The library version works.
, am_cv_func_working_getline=no dnl The library version does NOT work.
- , am_cv_func_working_getline=no dnl We're cross compiling.
+ , dnl We're cross compiling. Assume it works on glibc2 systems.
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ [am_cv_func_working_getline=yes],
+ [am_cv_func_working_getline=no])]
)])
fi
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index 624a80785..dae3d81e7 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -1,5 +1,5 @@
-# gettext.m4 serial 37 (gettext-0.14.4)
-dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
+# gettext.m4 serial 53 (gettext-0.15)
+dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,7 @@ dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2005.
dnl Macro to add for using GNU gettext.
@@ -94,7 +94,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
gt_INTL_MACOSX
dnl Set USE_NLS.
- AM_NLS
+ AC_REQUIRE([AM_NLS])
ifelse(gt_included_intl, yes, [
BUILD_INCLUDED_LIBINTL=no
@@ -130,13 +130,11 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
-changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+]], [])[extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;],
[bindtextdomain ("", "");
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
@@ -162,13 +160,11 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
-changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+]], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
@@ -183,13 +179,11 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
-changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+]], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
@@ -234,8 +228,8 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
dnl Mark actions used to generate GNU NLS library.
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
- LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
- LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
@@ -359,33 +353,22 @@ dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
AC_DEFUN([AM_INTL_SUBDIR],
[
AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([gt_GLIBC2])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
- AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([gl_VISIBILITY])dnl
+ AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
AC_REQUIRE([bh_C_SIGNED])dnl
- AC_REQUIRE([AC_C_INLINE])dnl
- AC_REQUIRE([AC_TYPE_OFF_T])dnl
- AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
AC_REQUIRE([gt_TYPE_WINT_T])dnl
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
AC_REQUIRE([gt_TYPE_INTMAX_T])
AC_REQUIRE([gt_PRINTF_POSIX])
- AC_REQUIRE([AC_FUNC_ALLOCA])dnl
- AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_REQUIRE([gl_GLIBC21])dnl
- AC_REQUIRE([gt_INTDIV0])dnl
- AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
- AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
- AC_REQUIRE([gt_INTTYPES_PRI])dnl
AC_REQUIRE([gl_XSIZE])dnl
AC_REQUIRE([gt_INTL_MACOSX])dnl
@@ -393,12 +376,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
[AC_DEFINE([ptrdiff_t], [long],
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
])
- AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h])
- AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
-mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
-strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
-__fsetlocking])
+ AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
+ AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
@@ -410,8 +389,6 @@ __fsetlocking])
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
dnl on Solaris 2.5.1 to run on Solaris 2.6).
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
- gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
- gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
case $gt_cv_func_printf_posix in
@@ -438,14 +415,125 @@ __fsetlocking])
fi
AC_SUBST([HAVE_WPRINTF])
- AM_ICONV
AM_LANGINFO_CODESET
- if test $ac_cv_header_locale_h = yes; then
- gt_LC_MESSAGES
+ gt_LC_MESSAGES
+
+ dnl Compilation on mingw and Cygwin needs special Makefile rules, because
+ dnl 1. when we install a shared library, we must arrange to export
+ dnl auxiliary pointer variables for every exported variable,
+ dnl 2. when we install a shared library and a static library simultaneously,
+ dnl the include file specifies __declspec(dllimport) and therefore we
+ dnl must arrange to define the auxiliary pointer variables for the
+ dnl exported variables _also_ in the static library.
+ if test "$enable_shared" = yes; then
+ case "$host_os" in
+ cygwin*) is_woe32dll=yes ;;
+ *) is_woe32dll=no ;;
+ esac
+ else
+ is_woe32dll=no
fi
+ WOE32DLL=$is_woe32dll
+ AC_SUBST([WOE32DLL])
+
+ dnl Rename some macros and functions used for locking.
+ AH_BOTTOM([
+#define __libc_lock_t gl_lock_t
+#define __libc_lock_define gl_lock_define
+#define __libc_lock_define_initialized gl_lock_define_initialized
+#define __libc_lock_init gl_lock_init
+#define __libc_lock_lock gl_lock_lock
+#define __libc_lock_unlock gl_lock_unlock
+#define __libc_lock_recursive_t gl_recursive_lock_t
+#define __libc_lock_define_recursive gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive gl_recursive_lock_init
+#define __libc_lock_lock_recursive gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
+#define glthread_in_use libintl_thread_in_use
+#define glthread_lock_init libintl_lock_init
+#define glthread_lock_lock libintl_lock_lock
+#define glthread_lock_unlock libintl_lock_unlock
+#define glthread_lock_destroy libintl_lock_destroy
+#define glthread_rwlock_init libintl_rwlock_init
+#define glthread_rwlock_rdlock libintl_rwlock_rdlock
+#define glthread_rwlock_wrlock libintl_rwlock_wrlock
+#define glthread_rwlock_unlock libintl_rwlock_unlock
+#define glthread_rwlock_destroy libintl_rwlock_destroy
+#define glthread_recursive_lock_init libintl_recursive_lock_init
+#define glthread_recursive_lock_lock libintl_recursive_lock_lock
+#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
+#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
+#define glthread_once libintl_once
+#define glthread_once_call libintl_once_call
+#define glthread_once_singlethreaded libintl_once_singlethreaded
+])
+])
+
+
+dnl Checks for the core files of the intl subdirectory:
+dnl dcigettext.c
+dnl eval-plural.h
+dnl explodename.c
+dnl finddomain.c
+dnl gettextP.h
+dnl gmo.h
+dnl hash-string.h hash-string.c
+dnl l10nflist.c
+dnl libgnuintl.h.in (except the *printf stuff)
+dnl loadinfo.h
+dnl loadmsgcat.c
+dnl localealias.c
+dnl log.c
+dnl plural-exp.h plural-exp.c
+dnl plural.y
+dnl Used by libglocale.
+AC_DEFUN([gt_INTL_SUBDIR_CORE],
+[
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+ AC_REQUIRE([gt_INTDIV0])dnl
+ AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
+ AC_REQUIRE([gl_HEADER_INTTYPES_H])dnl
+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
+ AC_REQUIRE([gl_LOCK])dnl
+
+ AC_TRY_LINK(
+ [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
+ [],
+ [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
+ [Define to 1 if the compiler understands __builtin_expect.])])
- if test -n "$INTL_MACOSX_LIBS"; then
- CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
+ AC_CHECK_HEADERS([argz.h limits.h unistd.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
+ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
+ argz_next __fsetlocking])
+
+ dnl Use the *_unlocked functions only if they are declared.
+ dnl (because some of them were defined without being declared in Solaris
+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+ gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
+ gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+
+ AM_ICONV
+
+ dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
+ dnl and a _NL_LOCALE_NAME macro always.
+ AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
+ [AC_TRY_LINK([#include <langinfo.h>
+#include <locale.h>],
+ [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
+ gt_cv_nl_locale_name=yes,
+ gt_cv_nl_locale_name=no)
+ ])
+ if test $gt_cv_nl_locale_name = yes; then
+ AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
+ [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
fi
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
@@ -488,15 +576,12 @@ 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_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
- gt_save_LIBS="$LIBS"
- LIBS="$LIBS -framework CoreFoundation"
- AC_TRY_LINK([#include <CFPreferences.h>],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
[CFPreferencesCopyAppValue(NULL, NULL)],
[gt_cv_func_CFPreferencesCopyAppValue=yes],
[gt_cv_func_CFPreferencesCopyAppValue=no])
- CPPFLAGS="$gt_save_CPPFLAGS"
LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
@@ -504,14 +589,11 @@ AC_DEFUN([gt_INTL_MACOSX],
fi
dnl Check for API introduced in MacOS X 10.3.
AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
- [gt_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
- gt_save_LIBS="$LIBS"
- LIBS="$LIBS -framework CoreFoundation"
- AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
[gt_cv_func_CFLocaleCopyCurrent=yes],
[gt_cv_func_CFLocaleCopyCurrent=no])
- CPPFLAGS="$gt_save_CPPFLAGS"
LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
index 4d56a9ad3..ef00da742 100644
--- a/m4/inttypes-pri.m4
+++ b/m4/inttypes-pri.m4
@@ -1,5 +1,5 @@
-# inttypes-pri.m4 serial 1 (gettext-0.11.4)
-dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+# inttypes-pri.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 1997-2002, 2006 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,8 +11,8 @@ dnl From Bruno Haible.
AC_DEFUN([gt_INTTYPES_PRI],
[
- AC_REQUIRE([gt_HEADER_INTTYPES_H])
- if test $gt_cv_header_inttypes_h = yes; then
+ AC_REQUIRE([gl_HEADER_INTTYPES_H])
+ if test $gl_cv_header_inttypes_h = yes; then
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
gt_cv_inttypes_pri_broken,
[
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index 244a77911..92929193f 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,5 +1,5 @@
-# lib-link.m4 serial 7 (gettext-0.15)
-dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+# lib-link.m4 serial 8 (gettext-0.15)
+dnl Copyright (C) 2001-2006 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.
@@ -552,3 +552,79 @@ AC_DEFUN([AC_LIB_APPENDTOVAR],
fi
done
])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
index 6863d3225..c0396356c 100644
--- a/m4/localcharset.m4
+++ b/m4/localcharset.m4
@@ -1,4 +1,4 @@
-# localcharset.m4 serial 3
+# localcharset.m4 serial 4
dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_LOCALCHARSET],
[
dnl Prerequisites of lib/localcharset.c.
- AC_CHECK_HEADERS_ONCE(stddef.h stdlib.h string.h)
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CHECK_DECLS_ONCE(getc_unlocked)
AC_CHECK_FUNCS_ONCE(setlocale)
diff --git a/m4/mbchar.m4 b/m4/mbchar.m4
index df351a6eb..ec4cbab11 100644
--- a/m4/mbchar.m4
+++ b/m4/mbchar.m4
@@ -1,5 +1,5 @@
-# mbchar.m4 serial 2
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# mbchar.m4 serial 3
+dnl Copyright (C) 2005-2006 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,5 +16,7 @@ AC_DEFUN([gl_MBCHAR],
dnl Compile mbchar.c only if HAVE_WCHAR_H && HAVE_WCTYPE_H.
if test $ac_cv_header_wchar_h = yes && test $ac_cv_header_wctype_h = yes; then
AC_LIBOBJ([mbchar])
+ dnl Prerequisites of mbchar.h and mbchar.c.
+ AC_CHECK_FUNCS([iswcntrl])
fi
])
diff --git a/m4/nls.m4 b/m4/nls.m4
index 2082c3b24..7967cc2f9 100644
--- a/m4/nls.m4
+++ b/m4/nls.m4
@@ -1,5 +1,5 @@
-# nls.m4 serial 2 (gettext-0.14.3)
-dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc.
+# nls.m4 serial 3 (gettext-0.15)
+dnl Copyright (C) 1995-2003, 2005-2006 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.
@@ -29,23 +29,3 @@ AC_DEFUN([AM_NLS],
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
])
-
-AC_DEFUN([AM_MKINSTALLDIRS],
-[
- dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing.
- m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])])
- dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
- dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
- dnl Try to locate it.
- MKINSTALLDIRS=
- if test -n "$ac_aux_dir"; then
- case "$ac_aux_dir" in
- /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
- *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
- esac
- fi
- if test -z "$MKINSTALLDIRS"; then
- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
- fi
- AC_SUBST(MKINSTALLDIRS)
-])
diff --git a/m4/po.m4 b/m4/po.m4
index f2795eea0..00133ef36 100644
--- a/m4/po.m4
+++ b/m4/po.m4
@@ -1,5 +1,5 @@
-# po.m4 serial 7 (gettext-0.14.3)
-dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
+# po.m4 serial 13 (gettext-0.15)
+dnl Copyright (C) 1995-2006 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.
@@ -24,7 +24,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
[
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
AC_REQUIRE([AM_NLS])dnl
dnl Perform the following tests also if --disable-nls has been given,
@@ -39,6 +39,22 @@ AC_DEFUN([AM_PO_SUBDIRS],
:)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
dnl Search for GNU xgettext 0.12 or newer in the PATH.
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
dnl The second test excludes FreeBSD xgettext.
@@ -49,44 +65,26 @@ AC_DEFUN([AM_PO_SUBDIRS],
dnl Remove leftover from FreeBSD xgettext call.
rm -f messages.po
+ dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
- dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
- dnl Test whether we really found GNU msgfmt.
- if test "$GMSGFMT" != ":"; then
- dnl If it is no GNU msgfmt we define it as : so that the
- dnl Makefiles still can work.
- if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
- (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- : ;
- else
- GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
- AC_MSG_RESULT(
- [found $GMSGFMT program is not GNU msgfmt; ignore it])
- GMSGFMT=":"
- fi
- fi
-
- dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
- dnl Test whether we really found GNU xgettext.
- if test "$XGETTEXT" != ":"; then
- dnl If it is no GNU xgettext we define it as : so that the
- dnl Makefiles still can work.
- if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
- (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- : ;
- else
- AC_MSG_RESULT(
- [found xgettext program is not GNU xgettext; ignore it])
- XGETTEXT=":"
- fi
- dnl Remove leftover from FreeBSD xgettext call.
- rm -f messages.po
- fi
+ dnl Installation directories.
+ dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+ dnl have to define it here, so that it can be used in po/Makefile.
+ test -n "$localedir" || localedir='${datadir}/locale'
+ AC_SUBST([localedir])
- AC_OUTPUT_COMMANDS([
+ AC_CONFIG_COMMANDS([po-directories], [[
for ac_file in $CONFIG_FILES; do
# Support "outfile[:infile[:infile...]]"
case "$ac_file" in
@@ -123,11 +121,12 @@ AC_DEFUN([AM_PO_SUBDIRS],
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
fi
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
- # Hide the ALL_LINGUAS assigment from automake.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
else
# The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
fi
# Compute POFILES
@@ -197,10 +196,10 @@ AC_DEFUN([AM_PO_SUBDIRS],
fi
;;
esac
- done],
+ done]],
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
- # from automake.
+ # from automake < 1.5.
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
# Capture the value of LINGUAS because we need it to compute CATALOGS.
LINGUAS="${LINGUAS-%UNSET%}"
@@ -286,7 +285,7 @@ x
changequote([,])dnl
# Set POTFILES to the value of the Makefile variable POTFILES.
- sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
# Compute POTFILES_DEPS as
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
@@ -305,10 +304,10 @@ changequote([,])dnl
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
else
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
- sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
fi
- # Hide the ALL_LINGUAS assigment from automake.
+ # Hide the ALL_LINGUAS assigment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
# Compute POFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
diff --git a/m4/prereq.m4 b/m4/prereq.m4
index 9d445e690..816f1fe42 100644
--- a/m4/prereq.m4
+++ b/m4/prereq.m4
@@ -1,4 +1,4 @@
-#serial 69
+#serial 71
dnl We use gl_ for non Autoconf macros.
m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
@@ -53,6 +53,7 @@ AC_DEFUN([gl_PREREQ],
AC_REQUIRE([gl_FILE_NAME_CONCAT])
AC_REQUIRE([gl_FILE_TYPE])
AC_REQUIRE([gl_FSUSAGE])
+ AC_REQUIRE([gl_FOPEN_SAFER])
AC_REQUIRE([gl_FUNC_ALLOCA])
AC_REQUIRE([gl_FUNC_ATEXIT])
AC_REQUIRE([gl_FUNC_DUP2])
@@ -147,8 +148,8 @@ AC_DEFUN([gl_PREREQ],
AC_REQUIRE([gl_SHA512])
AC_REQUIRE([gl_STAT_MACROS])
AC_REQUIRE([gl_STAT_TIME])
+ AC_REQUIRE([gl_STDARG_H])
AC_REQUIRE([gl_STDINT_H])
- AC_REQUIRE([gl_STDIO_SAFER])
AC_REQUIRE([gl_STDLIB_SAFER])
AC_REQUIRE([gl_STRCASE])
AC_REQUIRE([gl_STRINTCMP])
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
new file mode 100644
index 000000000..e8e680a5c
--- /dev/null
+++ b/m4/stdarg.m4
@@ -0,0 +1,40 @@
+# stdarg.m4 serial 1
+dnl Copyright (C) 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Provide a working va_copy in combination with <stdarg.h>.
+
+AC_DEFUN([gl_STDARG_H],
+[
+ AC_MSG_CHECKING([for va_copy])
+ AC_CACHE_VAL([gl_cv_func_va_copy], [
+ AC_TRY_COMPILE([#include <stdarg.h>], [
+#ifndef va_copy
+void (*func) (va_list, va_list) = va_copy;
+#endif
+],
+ [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])])
+ AC_MSG_RESULT([$gl_cv_func_va_copy])
+ if test $gl_cv_func_va_copy = no; then
+ # Provide a substitute, either __va_copy or as a simple assignment.
+ AC_CACHE_VAL([gl_cv_func___va_copy], [
+ AC_TRY_COMPILE([#include <stdarg.h>], [
+#ifndef __va_copy
+error, bail out
+#endif
+],
+ [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])])
+ if test $gl_cv_func___va_copy = yes; then
+ AC_DEFINE([va_copy], [__va_copy],
+ [Define as a macro for copying va_list variables.])
+ else
+ AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
+#define gl_va_copy(a,b) ((a) = (b))])
+ AC_DEFINE([va_copy], [gl_va_copy],
+ [Define as a macro for copying va_list variables.])
+ fi
+ fi
+])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index fa073cd19..48748c613 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 15
+# stdint.m4 serial 18
dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -71,18 +71,23 @@ AC_DEFUN([gl_STDINT_H],
AC_LANG_PROGRAM([[
#include <stddef.h>
#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
+#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
#include ABSOLUTE_STDINT_H
#ifdef INT8_MAX
int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
#endif
#ifdef INT16_MAX
int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
#endif
#ifdef INT32_MAX
int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
#endif
#ifdef INT64_MAX
int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
#endif
#ifdef UINT8_MAX
uint8_t b1 = UINT8_MAX;
@@ -99,23 +104,40 @@ uint32_t b3 = UINT32_MAX;
uint64_t b4 = UINT64_MAX;
#endif
int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
uint_fast8_t f1 = UINT_FAST8_MAX;
uint_fast16_t f2 = UINT_FAST16_MAX;
uint_fast32_t f3 = UINT_FAST32_MAX;
uint_fast64_t f4 = UINT_FAST64_MAX;
#ifdef INTPTR_MAX
intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
#endif
#ifdef UINTPTR_MAX
uintptr_t h = UINTPTR_MAX;
@@ -296,7 +318,8 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
extern $gltype foo;
extern $gltype1 foo;])],
[eval gl_cv_type_${gltype}_suffix=\$glsuf])
- eval test \"\$gl_cv_type_${gltype}_suffix\" != no && break
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
done])
GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
eval result=\$gl_cv_type_${gltype}_suffix
diff --git a/m4/stdio-safer.m4 b/m4/stdio-safer.m4
index cb60acb1e..40be1ad47 100644
--- a/m4/stdio-safer.m4
+++ b/m4/stdio-safer.m4
@@ -1,11 +1,17 @@
-#serial 5
-dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+#serial 7
+dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_STDIO_SAFER],
+AC_DEFUN([gl_FOPEN_SAFER],
[
AC_LIBSOURCES([fopen-safer.c, stdio-safer.h, stdio--.h])
AC_LIBOBJ([fopen-safer])
])
+
+AC_DEFUN([gl_TMPFILE_SAFER],
+[
+ AC_LIBSOURCES([tmpfile-safer.c, stdio-safer.h, stdio--.h])
+ AC_LIBOBJ([tmpfile-safer])
+])
diff --git a/m4/unistd-safer.m4 b/m4/unistd-safer.m4
index 6fbe4c6fb..30526405d 100644
--- a/m4/unistd-safer.m4
+++ b/m4/unistd-safer.m4
@@ -1,11 +1,12 @@
-#serial 7
-dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+#serial 8
+dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_UNISTD_SAFER],
[
+ AC_CHECK_FUNCS_ONCE([pipe])
AC_LIBSOURCES([dup-safer.c, fd-safer.c, pipe-safer.c, unistd-safer.h, unistd--.h])
AC_LIBOBJ([dup-safer])
AC_LIBOBJ([fd-safer])
diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4
index 09cf55a0e..06a12a1b2 100644
--- a/m4/wcwidth.m4
+++ b/m4/wcwidth.m4
@@ -1,4 +1,4 @@
-# wcwidth.m4 serial 3
+# wcwidth.m4 serial 4
dnl Copyright (C) 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,9 +17,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
AC_CHECK_DECLS([wcwidth], [], [], [
/* AIX 3.2.5 declares wcwidth in <string.h>. */
-#if HAVE_STRING_H
-# include <string.h>
-#endif
+#include <string.h>
#if HAVE_WCHAR_H
# include <wchar.h>
#endif
diff --git a/po/ChangeLog b/po/ChangeLog
index 046e6527f..ebc0cefc3 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,5 +1,7 @@
2006-08-09 Paul Eggert <eggert@cs.ucla.edu>
+ * Makefile.in.in: Sync from gettext 0.15.
+
* LINGUAS: Add ro, sr, uk, wa.
* ro.po, sr.po, uk,po, wa.po: New files,
gotten from the following files relative to
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 12b73cfee..2ed49e62d 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -1,5 +1,5 @@
# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU General Public
@@ -25,17 +25,26 @@ prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
-localedir = $(datadir)/locale
+localedir = @localedir@
gettextsrcdir = $(datadir)/gettext/po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
-
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
+mkinstalldirs = $(SHELL) @install_sh@ -d
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
MSGMERGE = msgmerge
MSGMERGE_UPDATE = @MSGMERGE@ --update
MSGINIT = msginit
@@ -159,7 +168,7 @@ install: install-exec install-data
install-exec:
install-data: install-data-@USE_NLS@
if test "$(PACKAGE)" = "gettext-tools"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
for file in $(DISTFILES.common) Makevars.template; do \
$(INSTALL_DATA) $(srcdir)/$$file \
$(DESTDIR)$(gettextsrcdir)/$$file; \
@@ -172,13 +181,13 @@ install-data: install-data-@USE_NLS@
fi
install-data-no: all
install-data-yes: all
- $(mkinstalldirs) $(DESTDIR)$(datadir)
+ $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
@@ -218,19 +227,19 @@ installdirs: installdirs-exec installdirs-data
installdirs-exec:
installdirs-data: installdirs-data-@USE_NLS@
if test "$(PACKAGE)" = "gettext-tools"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
else \
: ; \
fi
installdirs-data-no:
installdirs-data-yes:
- $(mkinstalldirs) $(DESTDIR)$(datadir)
+ $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
if test -n "$$lc"; then \
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
@@ -375,7 +384,7 @@ update-gmo: Makefile $(GMOFILES)
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
cd $(top_builddir) \
- && $(SHELL) ./config.status $(subdir)/$@.in
+ && $(SHELL) ./config.status $(subdir)/$@.in po-directories
force: