Bruno Haible [Tue, 2 Oct 2018 13:25:53 +0000 (15:25 +0200)]
Fix conflict between different uses of GETTEXTLIBDIR.
Rationale: The programs installed in $(prefix)/lib/gettext/ are at different
locations before installation: some are in the source tree, some are in the
build tree.
* gettext-tools/src/msginit.c (project_id, project_id_version): Test
GETTEXTLIBDIR_SRCDIR, not GETTEXTLIBDIR.
(plural_forms): Test GETTEXTLIBDIR_BUILDDIR, not GETTEXTLIBDIR.
* gettext-tools/tests/msginit-3: Set GETTEXTLIBDIR_SRCDIR, not GETTEXTLIBDIR.
* gettext-tools/tests/msginit-4: Set both GETTEXTLIBDIR_SRCDIR and
GETTEXTLIBDIR_BUILDDIR.
Bruno Haible [Tue, 2 Oct 2018 12:57:22 +0000 (14:57 +0200)]
Fix conflict between different uses of GETTEXTDATADIR.
* gettext-tools/src/read-tcl.c (msgdomain_read_tcl): Test GETTEXTTCLDIR, not
GETTEXTDATADIR.
* gettext-tools/tests/msgunfmt-tcl-1: Set GETTEXTTCLDIR, not GETTEXTDATADIR.
Bruno Haible [Tue, 18 Sep 2018 07:28:11 +0000 (09:28 +0200)]
Fix link error when building with --disable-shared on Cygwin and mingw.
* gettext-tools/configure.ac (LIBXML_STATIC): Define to 1 when using the
included libxml and building with --disable-shared.
* gnulib-local/lib/libxml/libxml.h (LIBXML_STATIC): Define to 1, not empty.
Bruno Haible [Sun, 16 Sep 2018 17:09:41 +0000 (19:09 +0200)]
libintl: Improve locale handling on macOS 10.12 or newer.
* gettext-runtime/intl/langprefs.c (_nl_language_preferences_default): Make the
logic also work in locales such as "zh-Hans-DE".
* gettext-runtime/intl/setlocale.c: Include header files for CoreFoundation.
(libintl_setlocale): Try harder to set a locale for categories LC_CTYPE and
LC_MESSAGES.
Bruno Haible [Sun, 16 Sep 2018 12:43:20 +0000 (14:43 +0200)]
Use newer macOS APIs when possible.
* gettext-runtime/m4/intlmacosx.m4 (gt_INTL_MACOSX): Check for
CFLocaleCopyPreferredLanguages.
* gettext-runtime/intl/langprefs.c (_nl_language_preferences_default): Use
CFLocaleCopyPreferredLanguages when it exists.
Bruno Haible [Sun, 16 Sep 2018 02:50:22 +0000 (04:50 +0200)]
libintl: Fix language preferences on macOS 10.12 or newer.
Reported by Kristian Rietveld <kris@loopnest.org> at
<https://savannah.gnu.org/bugs/?49560>.
* gettext-runtime/intl/langprefs.c (_nl_language_preferences_default): Handle
preferences elements of the form "ll-CC" in a reasonable way.
* NEWS: Mention the change.
Bruno Haible [Sun, 16 Sep 2018 01:09:06 +0000 (03:09 +0200)]
setlocale: Improve support for locales not supported by libc.
Reported by Dapeng Gao <peter@dpgao.cc> at
<https://savannah.gnu.org/bugs/?54479>.
* gettext-runtime/intl/setlocale.c: Include <stdio.h>.
(libintl_setlocale): Use a more error-tolerant strategy when the locale to be
set is not supported by libc: Emit warnings instead of failing.
Bruno Haible [Sat, 15 Sep 2018 22:26:26 +0000 (00:26 +0200)]
Reduce "make dist" time by 7 minutes.
* configure.ac (AM_INIT_AUTOMAKE): Remove dist-xz and dist-lzip options.
* Admin/release-steps: Mention how to create the tarballs with higher
compression after "make dist".
Bruno Haible [Tue, 24 Jul 2018 22:56:02 +0000 (00:56 +0200)]
Upgrade to newer help2man.
Reported by Bernhard M. Wiedemann in <https://savannah.gnu.org/bugs/?54367>.
* gettext-runtime/man/help2man: Upgrade to version 1.47.6, with one change:
$source ||= "$program $version";
replaced by
$source ||= "$package $version";
* gettext-tools/man/help2man: Likewise.
Bruno Haible [Tue, 24 Jul 2018 22:25:09 +0000 (00:25 +0200)]
Make it possible to copy&paste strings from the HTML-formatted man pages.
* gettext-runtime/man/Makefile.am (MAN2HTML_POSTPROCESS): New variable.
(gt_man2html): Use it.
* gettext-tools/man/Makefile.am (MAN2HTML_POSTPROCESS): New variable.
(gt_man2html): Use it.
Bruno Haible [Mon, 14 May 2018 18:57:34 +0000 (20:57 +0200)]
xgettext: Improve support for specialized vector syntax in Scheme.
Reported by Florent Angly <Florent.Angly@cslbehring.com>.
* gettext-tools/src/x-scheme.c (read_object): Don't call free_token on an
uninitialized token. Support recent syntax for homogeneous vector types (SRFI-4)
and byte vectors as well.
* NEWS: Mention the change.
Bruno Haible [Sat, 12 May 2018 17:58:49 +0000 (19:58 +0200)]
libintl: Ensure the *printf function overrides are POSIX compatible.
Reported by Eli Zaretskii <eliz@gnu.org>.
* gettext-runtime/intl/printf.c (USE_REPLACEMENT_CODE_ALWAYS): New macro.
(libintl_vfprintf, libintl_vsprintf, libintl_vsnprintf, libintl_vfwprintf,
libintl_vswprintf): Use it.
* NEWS: Mention the change.
Bruno Haible [Sat, 24 Mar 2018 15:20:03 +0000 (16:20 +0100)]
Add support for recent Java versions.
Reported by Emmanuel Bourg <ebourg@apache.org>
at <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892733>
via Santiago Vila.
* gettext-runtime/configure.ac: Require a Java compiler that supports
source-version 1.5 and target-version 1.6 (such as Java 6 or newer, or
GCJ 4.3 or newer).
* gettext-tools/src/write-java.c (msgdomain_write_java): Likewise
* gettext-tools/examples/hello-java-qtjambi/configure.ac: Likewise.
* gettext-tools/configure.ac: Require a Java compiler that supports
source-version 1.5 (such as Java 5 or newer, or GCJ 4.3 or newer).
* gettext-tools/examples/hello-java/configure.ac: Likewise.
* gettext-tools/examples/hello-java-awt/configure.ac: Likewise.
* gettext-tools/examples/hello-java-swing/configure.ac: Likewise.
* NEWS: Mention the change.
Bruno Haible [Sat, 6 Jan 2018 17:45:22 +0000 (18:45 +0100)]
Add support for new C++ preprocessing number tokens.
Reported by Moritz Bunkus <moritz@bunkus.org>
at <https://savannah.gnu.org/bugs/?50117>.
* gettext-tools/src/x-c.c (phase5_get): Recognize C++14 and C++17 extensions of
preprocessing number tokens.
* gettext-tools/tests/xgettext-c-22: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.
Bruno Haible [Sat, 6 Jan 2018 02:10:47 +0000 (03:10 +0100)]
xgettext: Add support for .properties files in UTF-8 encoding.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add read-file, unistr/u8-check.
* gettext-tools/src/read-properties: Read the file into memory, then find out
about its encoding, then start parsing it.
* gettext-tools/tests/xgettext-properties-2: New file.
* gettext-tools/tests/xgettext-properties-3: New file.
* gettext-tools/tests/xgettext-properties-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* NEWS: Mention the change.
Bruno Haible [Fri, 5 Jan 2018 22:42:46 +0000 (23:42 +0100)]
Add support for .rsj files.
* gettext-tools/src/x-rst.h (EXTENSIONS_RST, SCANNERS_RST): Add RSJ scanner.
(extract_rsj): New declaration.
* gettext-tools/src/x-rst.c: Implement extraction from .rsj files.
* gettext-tools/src/xgettext.c (usage): Mention RSJ along with RST.
* gettext-tools/tests/xgettext-rst-1: New file.
* gettext-tools/tests/xgettext-rst-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/tests/lang-pascal: Extract from .rsj file, if the compiler
generated it.
* gettext-tools/doc/gettext.texi (RST): Mention that .rsj files are supported
as well.
* gettext-tools/doc/xgettext.texi (Choice of input file language): Mention RSJ
along with RST.
* NEWS: Mention the change.
Bruno Haible [Thu, 4 Jan 2018 09:52:13 +0000 (10:52 +0100)]
Use locales with the customary names.
On glibc systems, nowadays, the German and French locales are named
'de_DE.UTF-8' and 'fr_FR.UTF-8', respectively. This change avoids the need
to install similar locales with different names.
* gettext-tools/tests/gettext-3: Use locales with '.UTF-8' suffix.
* gettext-tools/tests/gettext-3-prg.c (lang): Likewise.
Bruno Haible [Wed, 3 Jan 2018 01:32:55 +0000 (02:32 +0100)]
Fix "make dist" of modified git checkouts.
This fixes error messages such as
tar: gettext-0.19.8.1.74-72e49-dirty/gettext-tools/gnulib-tests/test-term-ostream-xterm-linux-mandriva.out: file name is too long (max 99); not dumped
tar: gettext-0.19.8.1.74-72e49-dirty/gettext-runtime/intl-csharp/doc/GNU_Gettext_GettextResourceManager.html: file name is too long (max 99); not dumped
* configure.ac: Pass option 'tar-ustar' to AM_INIT_AUTOMAKE.
(am__tar): Use 'tar' option --format=ustar.
Bruno Haible [Tue, 2 Jan 2018 18:38:43 +0000 (19:38 +0100)]
Fix 'ar' invocation when cross-compiling and in 64-bit mode on AIX.
Reported by Benedikt Morbach <bmorbach@redhat.com>
at <https://savannah.gnu.org/bugs/?43037>.
* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Require gl_PROG_AR_RANLIB if
available. Otherwise, use AC_PROG_RANLIB and set AR and ARFLAGS.
* gettext-runtime/intl/Makefile.in (AR): Use the value determined through
autoconf.
(ARFLAGS): New variable.
(libintl.a, libgnuintl.a): Use it.
* gettext-runtime/configure.ac: Invoke gl_PROG_AR_RANLIB.
* gettext-runtime/libasprintf/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
Bruno Haible [Sun, 24 Sep 2017 12:25:53 +0000 (14:25 +0200)]
Verify that system dependent strings in .mo files are NUL terminated.
Reported by Jakub Wilk <jwilk@jwilk.net> in
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876498>.
* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): Bail out if some of the
system-dependent strings has a last static segment that is not NUL terminated.
* gettext-tools/src/read-mo.c (get_sysdep_string): Likewise.