Bruno Haible [Sun, 21 Oct 2018 08:35:25 +0000 (10:35 +0200)]
New subdirectory system-tests.
* gettext-tools/system-tests/Makefile.am: New file.
* gettext-tools/system-tests/README: New file.
* gettext-tools/system-tests/run-test: New file.
* gettext-tools/system-tests/testlocale.c: New file.
* gettext-tools/system-tests/intl-1-prg.c: New file.
* gettext-tools/system-tests/intl-3-prg.c: New file.
* gettext-tools/system-tests/intl-4-prg.c: New file.
* gettext-tools/system-tests/intl-5-prg.c: New file.
* gettext-tools/system-tests/intl-setlocale-1-prg.c: New file.
* gettext-tools/system-tests/intl-setlocale-2-prg.c: New file.
* gettext-tools/system-tests/intl-thread-1-prg.c: New file.
* gettext-tools/system-tests/intl-thread-2-prg.c: New file.
* gettext-tools/system-tests/intl-thread-3-prg.c: New file.
* gettext-tools/system-tests/format-c-3-prg.c: New file.
* gettext-tools/system-tests/format-c-4-prg.c: New file.
* gettext-tools/system-tests/format-c-5-prg.c: New file.
* gettext-tools/system-tests/plural-1-prg.c: New file.
* gettext-tools/Makefile.am (SUBDIRS): Add system-tests.
* gettext-tools/configure.ac (TEST_SYSTEM_LIBINTL): New conditional.
(AC_CONFIG_FILES): Add system-tests/Makefile.
* gettext-tools/tests/init.cfg: Include init-env from the tests/ directory.
* gettext-tools/tests/intl-5-prg.c: When USE_SYSTEM_LIBINTL is defined, use the
system's <libintl.h>.
* gettext-tools/tests/intl-setlocale-1-prg.c: Likewise.
* gettext-tools/tests/intl-setlocale-2-prg.c: Likewise.
* gettext-tools/tests/intl-thread-1-prg.c: Likewise.
* gettext-tools/tests/intl-thread-2-prg.c: Likewise.
* gettext-tools/tests/intl-thread-3-prg.c: Likewise.
* gettext-tools/tests/intl-1-prg.c: When USE_SYSTEM_LIBINTL is defined, use the
system's <libintl.h>.
* gettext-tools/tests/intl-3-prg.c: Likewise.
* gettext-tools/tests/intl-4-prg.c: Likewise.
* gettext-tools/tests/format-c-3-prg.c: Likewise.
* gettext-tools/tests/format-c-4-prg.c: Likewise.
* gettext-tools/tests/plural-1-prg.c: Likewise.
* gettext-tools/tests/format-c-5-prg.c: When USE_SYSTEM_LIBINTL is defined, use
the system's <libintl.h> and setenv instead of xsetenv, and no fake setlocale.
* gettext-tools/tests/format-c-3: When USE_SYSTEM_LIBINTL is defined, try
$LOCALE_FR and $LOCALE_FR_UTF8.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/plural-1: Likewise.
* gettext-tools/tests/format-c-5: When USE_SYSTEM_LIBINTL is defined, try fa_IR
and fa_IR.UTF-8.
Bruno Haible [Sat, 20 Oct 2018 15:54:03 +0000 (17:54 +0200)]
Rename test gettext-7 to intl-thread-3 and support more platforms.
* gettext-tools/tests/intl-thread-3: Renamed from gettext-tools/tests/gettext-7.
Don't limit to fixed set of platforms.
* gettext-tools/tests/intl-thread-3-prg.c: Renamed from
gettext-tools/tests/gettext-7-prg.c. Expect locale names as arguments.
* gettext-tools/tests/intl-thread-3.po: Renamed from
gettext-tools/tests/gettext-7.po.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sun, 21 Oct 2018 17:59:28 +0000 (19:59 +0200)]
Make the intl-thread-2 test effective on Solaris 11.
* gettext-tools/m4/locale-de.m4: New file, based on locale-fr.m4 from gnulib.
* gettext-tools/m4/Makefile.am (EXTRA_DIST): Add it.
* gettext-tools/configure.ac: Invoke gt_LOCALE_DE_UTF8.
* gettext-tools/tests/init-env.in: Set LOCALE_DE_UTF8.
* gettext-tools/tests/intl-thread-2: Use a German instead of a Turkish locale.
Bruno Haible [Sat, 20 Oct 2018 15:34:23 +0000 (17:34 +0200)]
Rename test gettext-6 to intl-thread-2 and support more platforms.
* gettext-tools/tests/intl-thread-2: Renamed from gettext-tools/tests/gettext-6.
Don't limit to fixed set of platforms.
* gettext-tools/tests/intl-thread-2-prg.c: Renamed from
gettext-tools/tests/gettext-6-prg.c. Expect locale names as arguments.
* gettext-tools/tests/intl-thread-2-1.po: Renamed from
gettext-tools/tests/gettext-6-2.po. Convert to UTF-8.
* gettext-tools/tests/intl-thread-2-2.po: Renamed from
gettext-tools/tests/gettext-6-1.po. Convert to UTF-8.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sat, 20 Oct 2018 14:58:33 +0000 (16:58 +0200)]
New test intl-thread-1.
* gettext-tools/tests/intl-thread-1: New file.
* gettext-tools/tests/intl-thread-1-prg.c: New file.
* gettext-tools/tests/intl-thread-1.po: New file.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sat, 20 Oct 2018 12:21:39 +0000 (14:21 +0200)]
New test intl-2.
* gettext-tools/tests/intl-2: New file.
* gettext-tools/tests/intl-2-1.po: New file.
* gettext-tools/tests/intl-2-2.po: New file.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sat, 20 Oct 2018 11:53:09 +0000 (13:53 +0200)]
New test intl-1.
* gettext-tools/tests/intl-1: New file.
* gettext-tools/tests/intl-1-prg.c: New file.
* gettext-tools/tests/intl-1.po: New file.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Thu, 18 Oct 2018 18:46:29 +0000 (20:46 +0200)]
examples: hello-pascal: Fix 'make distcheck'.
* gettext-tools/examples/hello-pascal/Makefile.am (hello$(EXEEXT)): Move
hello.rsj into $(srcdir) only if the new contents differs from the old contents.
Bruno Haible [Thu, 18 Oct 2018 19:35:12 +0000 (21:35 +0200)]
examples: hello-java*: Fix 'make distcheck'.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties): Create
the new .properties files in the build dir and move them to $(srcdir) only if
the new contents differs from the old contents.
(update-classes): Likewise, also for .class files.
* gettext-tools/examples/hello-csharp*/po/Makefile.am (MAINTAINERCLEANFILES):
Don't list the $(RESOURCESDLLFILES) here.
(maintainer-clean-local): Instead, remove them and their parent directories
here.
Bruno Haible [Wed, 17 Oct 2018 20:03:55 +0000 (22:03 +0200)]
examples: hello-java*: Fix "make dist".
* gettext-runtime/m4/po.m4 (AM_POSTPROCESS_PO_MAKEFILE): Change PROPERTIESFILES
and CLASSFILES to contain files in $(srcdir), not in $(top_srcdir).
* gettext-tools/examples/hello-java*/Makefile.am (hello.jar): Fetch the catalogs
from the po/ directory.
* gettext-tools/examples/hello-java*/po/Makefile.am (MAINTAINERCLEANFILES):
Add the .properties and the .class files.
(EXTRA_DIST): Add the .properties files.
(update-properties, update-classes): Generate the .properties and .class files
in the po/ directory, not in the top-level directory.
* gettext-tools/examples/hello-java*/autoclean.sh: Remove the catalogs in
the po/ directory, not in the top-level directory.
Bruno Haible [Wed, 17 Oct 2018 12:55:58 +0000 (14:55 +0200)]
examples: Fix 'make' failures in VPATH builds.
* gettext-tools/examples/hello-java*/Makefile.am (hello_RESOURCES,
MAINTAINERCLEANFILES): Remove variables.
(hello.jar): Use two jar commands, to combine .class files from the build dir
with .properties files from the source dir.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties,
update-classes): Reference the .pot file in the source dir, not in the build
dir.
(echo-catalogs): Include the fallback catalog.
* gettext-tools/examples/hello-pascal/Makefile.am (hello_SOURCES): Add $(srcdir)
prefix.
(hello$(EXEEXT)): Use -o option to specify where the object file and the
executable file shall be created.
Bruno Haible [Tue, 16 Oct 2018 01:14:41 +0000 (03:14 +0200)]
examples: hello-pascal: Update.
* gettext-tools/examples/hello-pascal/configure.ac (PPC): Test for ppcx64 if
ppc386 is not found.
* gettext-tools/examples/hello-pascal/hello.rst: Remove file.
* gettext-tools/examples/hello-pascal/Makefile.am: hello.rsj replaces hello.rst.
(SUBDIRS): Proceed in current directory before recursing into po/.
* gettext-tools/examples/hello-pascal/po/Makefile.am (POTFILES): hello.rsj
replaces hello.rst.
* gettext-tools/examples/hello-pascal/autoclean.sh: Remove hello.rsj.
* gettext-tools/examples/hello-c++-widgets/autogen.sh: Pull in some more .m4
files.
* gettext-tools/examples/hello-c++-widgets/autoclean.sh: Remove them.
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.