]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
6 years agomsgfmt: fix C&P issue
Pavel Raiskup [Wed, 21 Nov 2018 14:46:29 +0000 (15:46 +0100)] 
msgfmt: fix C&P issue

* gettext-tools/src/msgl-check.c (syntax_check_space_ellipsis):
Use 'end' for buffer size computation, instead of NULL 'ellipsis'.

6 years agoformat-kde-kuit: really use fallback markup
Pavel Raiskup [Wed, 21 Nov 2018 08:53:53 +0000 (09:53 +0100)] 
format-kde-kuit: really use fallback markup

* gettext-tools/src/format-kde-kuit.c (format_parse): Use markup.h
methods when FORMAT_KDE_KUIT_USE_FALLBACK_MARKUP is defined.  Also
free buffer if there's no support for XML.

6 years agomsgmerge must produce output that is stable under msgcat.
Bruno Haible [Sun, 18 Nov 2018 10:41:40 +0000 (11:41 +0100)] 
msgmerge must produce output that is stable under msgcat.

Reported by Ludovic Courtès <ludo@gnu.org>
in <https://savannah.gnu.org/bugs/?51027>.

* gettext-tools/src/write-po.c (message_print_obsolete): Preserve the 'no-wrap'
and '*-format' flags.
* gettext-tools/tests/msgmerge-27: New file.
* gettext-tools/tests/msgmerge-28: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/tests/msgmerge-19: Update expected result.

6 years agogettextize: Give more advice.
Bruno Haible [Sun, 18 Nov 2018 11:36:38 +0000 (12:36 +0100)] 
gettextize: Give more advice.

* gettext-tools/misc/gettextize.in: Tell the user to remove
AM_GNU_GETTEXT_INTL_SUBDIR invocations.

6 years agoSimplify Autoconf macros.
Bruno Haible [Sun, 18 Nov 2018 09:53:00 +0000 (10:53 +0100)] 
Simplify Autoconf macros.

* gettext-runtime/m4/intldir.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove intldir.m4.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Disallow 'no-libtool'
argument. Use libtool always. Remove variables that existed only for backward
compatibility.
* gettext-runtime/m4/intl.m4: Update comments.
* autogen.sh: Ignore gettext.m4 and intl.m4 from gnulib.
* gettext-runtime/intl/Makefile.in: Use libtool always.
(libintl.a, libgnuintl.a): Remove rule.
(.o): Remove suffix rule.
(install-exec, installdirs, uninstall, distclean, dist, distdir): PACKAGE cannot
be anything else than gettext-runtime and gettext-tools any more.
* gettext-tools/configure.ac (intl/Makefile): Update.
* NEWS: Mention that AM_GNU_GETTEXT_INTL_SUBDIR is gone.

6 years agoMake 'make distcheck' work in a VPATH build.
Bruno Haible [Sat, 17 Nov 2018 22:04:17 +0000 (23:04 +0100)] 
Make 'make distcheck' work in a VPATH build.

* Makefile.am (distcheck-hook): Compare files in $(srcdir).
* gettext-tools/examples/po/xsmallpot.sh: Put the resulting POT file in the
source dir, not in the build dir.
* gettext-tools/examples/po/Makefile.am (update-po): Execute sub-make in the
build dir, not in the source dir.
(SMALLPOFILES_FOR_lang): Prefix file names with $(srcdir).
(hello-*/po/*.po): Likewise. Execute mmsmallpo.sh in $(srcdir).

6 years agogettextize: Install also host-cpu-c-abi.m4 (needed since 2018-03-24).
Bruno Haible [Sun, 11 Nov 2018 12:49:30 +0000 (13:49 +0100)] 
gettextize: Install also host-cpu-c-abi.m4 (needed since 2018-03-24).

* gettext-tools/m4/Makefile.am (aclocal_DATA): Install host-cpu-c-abi.m4.
* PACKAGING: Mention host-cpu-c-abi.m4.
* gettext-tools/misc/gettextize.in (m4filelist): Add host-cpu-c-abi.m4.
* gettext-tools/doc/gettext.texi (aclocal): Mention host-cpu-c-abi.m4.

6 years agoUpdate to newest gnulib.
Bruno Haible [Sun, 11 Nov 2018 12:49:03 +0000 (13:49 +0100)] 
Update to newest gnulib.

6 years agoUpdate packaging instructions.
Bruno Haible [Sun, 11 Nov 2018 12:48:58 +0000 (13:48 +0100)] 
Update packaging instructions.

* PACKAGING: Update file list.

6 years agogettextize: Require automake >= 1.9.
Bruno Haible [Sun, 11 Nov 2018 12:48:56 +0000 (13:48 +0100)] 
gettextize: Require automake >= 1.9.

* gettext-tools/misc/gettextize.in: Signal an error if 'aclocal' from
automake >= 1.9 is not found. Stop installing intldir.m4, intl.m4 and its
dependencies.
* gettext-tools/doc/gettext.texi (mkinstalldirs, aclocal): State the requirement
to have automake >= 1.9.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Don't install codeset.m4,
extern-inline.m4, fcntl-o.m4, glibc2.m4, glibc21.m4, intdiv0.m4, intl.m4,
intl-thread-locale.m4, intldir.m4, intmax.m4, inttypes_h.m4, inttypes-pri.m4,
lcmessage.m4, lock.m4, longlong.m4, printf-posix.m4, size_max.m4, stdint_h.m4,
threadlib.m4, uintmax_t.m4, visibility.m4, wchar_t.m4, wint_t.m4, xsize.m4.
* PACKAGING: Remove the *.m4 files that are no longer installed.

6 years agoStop installing the intl/ subdir sources.
Bruno Haible [Sun, 11 Nov 2018 12:48:51 +0000 (13:48 +0100)] 
Stop installing the intl/ subdir sources.

* gettext-runtime/intl/Makefile.in (gettextsrcdir): Remove variable.
(DISTFILES.obsolete): Remove variable.
(install-data): Don't install nor remove anything.
(installdirs): Don't create $(gettextsrcdir).
* gettext-tools/misc/add-to-archive: Don't add the intl directory to the
archive.
* PACKAGING: Remove mention of $prefix/share/gettext/intl/ directory.

6 years agogettextize: Remove --intl option.
Bruno Haible [Sun, 11 Nov 2018 12:48:44 +0000 (13:48 +0100)] 
gettextize: Remove --intl option.

* gettext-tools/misc/gettextize.in (func_usage): Don't mention --intl option.
Signal an error if the --intl option is specified.
Simplify main code accordingly.
* gettext-tools/doc/gettextize.texi: Remove --intl option description.
* gettext-tools/doc/gettext.texi (Prerequisites): Remove mention of intl/
directory.
(configure.ac): Suggest to use AM_GNU_GETTEXT([external]) always. Remove mention
of intl/ directory.
(config.guess): Suggest them always.
(aclocal): Shrink the list of .m4 files.
(acconfig): Remove subsection.
(config.h.in): Remove mention of intl/ directory.
(Makefile, src/Makefile, lib/gettext.h): Likewise.
(AM_GNU_GETTEXT): First argument must be 'external'. Remove third argument.
(AM_GNU_GETTEXT_INTL_SUBDIR): Remove subsection.
(Language Implementors): Remove mention of intl/ directory. Mention that
Solaris 11 gettext works like GNU gettext.
(Maintainers for other Languages): Remove mention of intl/ directory.
* gettext-tools/doc/autopoint.texi: Update explanation of name.
* NEWS: Mention the change.

6 years agoxgettext tests: Rename xgettext-c-18 to xgettext-c-6.
Bruno Haible [Thu, 8 Nov 2018 23:04:19 +0000 (00:04 +0100)] 
xgettext tests: Rename xgettext-c-18 to xgettext-c-6.

* gettext-tools/tests/xgettext-c-6: Renamed from
gettext-tools/tests/xgettext-c-18.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-25 to xgettext-c-5.
Bruno Haible [Thu, 8 Nov 2018 23:03:06 +0000 (00:03 +0100)] 
xgettext tests: Rename xgettext-c-25 to xgettext-c-5.

* gettext-tools/tests/xgettext-c-5: Renamed from
gettext-tools/tests/xgettext-c-25.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-24 to xgettext-c-comment-6.
Bruno Haible [Thu, 8 Nov 2018 22:59:50 +0000 (23:59 +0100)] 
xgettext tests: Rename xgettext-c-24 to xgettext-c-comment-6.

* gettext-tools/tests/xgettext-c-comment-6: Renamed from
gettext-tools/tests/xgettext-c-24.
* gettext-tools/tests/xg-c-comment-6.c: Renamed from
gettext-tools/tests/xg-c-24.c.
* Makefile.am (TESTS, EXTRA_DIST): Update.

6 years agoxgettext tests: Rename xgettext-c-9 to xgettext-c-comment-5.
Bruno Haible [Thu, 8 Nov 2018 22:54:45 +0000 (23:54 +0100)] 
xgettext tests: Rename xgettext-c-9 to xgettext-c-comment-5.

* gettext-tools/tests/xgettext-c-comment-5: Renamed from
gettext-tools/tests/xgettext-c-9.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-6 to xgettext-c-comment-4.
Bruno Haible [Thu, 8 Nov 2018 22:52:55 +0000 (23:52 +0100)] 
xgettext tests: Rename xgettext-c-6 to xgettext-c-comment-4.

* gettext-tools/tests/xgettext-c-comment-4: Renamed from
gettext-tools/tests/xgettext-c-6.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-16 to xgettext-c-comment-3.
Bruno Haible [Thu, 8 Nov 2018 22:50:23 +0000 (23:50 +0100)] 
xgettext tests: Rename xgettext-c-16 to xgettext-c-comment-3.

* gettext-tools/tests/xgettext-c-comment-3: Renamed from
gettext-tools/tests/xgettext-c-16.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-7 to xgettext-c-comment-2.
Bruno Haible [Thu, 8 Nov 2018 22:48:47 +0000 (23:48 +0100)] 
xgettext tests: Rename xgettext-c-7 to xgettext-c-comment-2.

* gettext-tools/tests/xgettext-c-comment-2: Renamed from
gettext-tools/tests/xgettext-c-7.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-5 to xgettext-c-comment-1.
Bruno Haible [Thu, 8 Nov 2018 22:46:49 +0000 (23:46 +0100)] 
xgettext tests: Rename xgettext-c-5 to xgettext-c-comment-1.

* gettext-tools/tests/xgettext-c-comment-1: Renamed from
gettext-tools/tests/xgettext-c-5.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-21 to xgettext-c-escape-3.
Bruno Haible [Thu, 8 Nov 2018 22:40:42 +0000 (23:40 +0100)] 
xgettext tests: Rename xgettext-c-21 to xgettext-c-escape-3.

* gettext-tools/tests/xgettext-c-escape-3: Renamed from
gettext-tools/tests/xgettext-c-21.
* gettext-tools/tests/xg-c-escape-3.c: Renamed from
gettext-tools/tests/xg-c-21.c.
* Makefile.am (TESTS, EXTRA_DIST): Update.

6 years agoxgettext tests: Rename xgettext-c-23 to xgettext-c-escape-2.
Bruno Haible [Thu, 8 Nov 2018 22:37:45 +0000 (23:37 +0100)] 
xgettext tests: Rename xgettext-c-23 to xgettext-c-escape-2.

* gettext-tools/tests/xgettext-c-escape-2: Renamed from
gettext-tools/tests/xgettext-c-23.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-19 to xgettext-c-escape-1.
Bruno Haible [Thu, 8 Nov 2018 22:36:08 +0000 (23:36 +0100)] 
xgettext tests: Rename xgettext-c-19 to xgettext-c-escape-1.

* gettext-tools/tests/xgettext-c-escape-1: Renamed from
gettext-tools/tests/xgettext-c-19.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-14 to xgettext-c-format-5.
Bruno Haible [Thu, 8 Nov 2018 22:30:36 +0000 (23:30 +0100)] 
xgettext tests: Rename xgettext-c-14 to xgettext-c-format-5.

* gettext-tools/tests/xgettext-c-format-5: Renamed from
gettext-tools/tests/xgettext-c-14.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-17 to xgettext-c-format-4.
Bruno Haible [Thu, 8 Nov 2018 22:28:26 +0000 (23:28 +0100)] 
xgettext tests: Rename xgettext-c-17 to xgettext-c-format-4.

* gettext-tools/tests/xgettext-c-format-4: Renamed from
gettext-tools/tests/xgettext-c-17.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-13 to xgettext-c-format-3.
Bruno Haible [Thu, 8 Nov 2018 22:25:17 +0000 (23:25 +0100)] 
xgettext tests: Rename xgettext-c-13 to xgettext-c-format-3.

* gettext-tools/tests/xgettext-c-format-3: Renamed from
gettext-tools/tests/xgettext-c-13.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-8 to xgettext-c-format-2.
Bruno Haible [Thu, 8 Nov 2018 22:23:41 +0000 (23:23 +0100)] 
xgettext tests: Rename xgettext-c-8 to xgettext-c-format-2.

* gettext-tools/tests/xgettext-c-format-2: Renamed from
gettext-tools/tests/xgettext-c-8.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-12 to xgettext-c-format-1.
Bruno Haible [Thu, 8 Nov 2018 22:22:07 +0000 (23:22 +0100)] 
xgettext tests: Rename xgettext-c-12 to xgettext-c-format-1.

* gettext-tools/tests/xgettext-c-format-1: Renamed from
gettext-tools/tests/xgettext-c-12.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-15 to xgettext-c-ctxt-3.
Bruno Haible [Thu, 8 Nov 2018 22:16:42 +0000 (23:16 +0100)] 
xgettext tests: Rename xgettext-c-15 to xgettext-c-ctxt-3.

* gettext-tools/tests/xgettext-c-ctxt-3: Renamed from
gettext-tools/tests/xgettext-c-15.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-11 to xgettext-c-ctxt-2.
Bruno Haible [Thu, 8 Nov 2018 22:14:09 +0000 (23:14 +0100)] 
xgettext tests: Rename xgettext-c-11 to xgettext-c-ctxt-2.

* gettext-tools/tests/xgettext-c-ctxt-2: Renamed from
gettext-tools/tests/xgettext-c-11.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-10 to xgettext-c-ctxt-1.
Bruno Haible [Thu, 8 Nov 2018 22:12:49 +0000 (23:12 +0100)] 
xgettext tests: Rename xgettext-c-10 to xgettext-c-ctxt-1.

* gettext-tools/tests/xgettext-c-ctxt-1: Renamed from
gettext-tools/tests/xgettext-c-10.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-22 to xgettext-c-c++-2.
Bruno Haible [Thu, 8 Nov 2018 22:08:37 +0000 (23:08 +0100)] 
xgettext tests: Rename xgettext-c-22 to xgettext-c-c++-2.

* gettext-tools/tests/xgettext-c-c++-2: Renamed from
gettext-tools/tests/xgettext-c-22.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-20 to xgettext-c-c++-1.
Bruno Haible [Thu, 8 Nov 2018 22:05:00 +0000 (23:05 +0100)] 
xgettext tests: Rename xgettext-c-20 to xgettext-c-c++-1.

* gettext-tools/tests/xgettext-c-c++-1: Renamed from
gettext-tools/tests/xgettext-c-20.
* Makefile.am (TESTS): Update.

6 years agoxgettext: C: Treat invalid escape sequences like GCC does.
Bruno Haible [Sun, 4 Nov 2018 23:21:56 +0000 (00:21 +0100)] 
xgettext: C: Treat invalid escape sequences like GCC does.

* gettext-tools/src/x-c.c (phase7_getc): For invalid escape sequences "\c",
produce c, not a backslash.

6 years agoxgettext: Simplify calling convention of arglist_parser_remember.
Bruno Haible [Sun, 4 Nov 2018 23:02:54 +0000 (00:02 +0100)] 
xgettext: Simplify calling convention of arglist_parser_remember.

* gettext-tools/src/xg-arglist-parser.h (struct partial_call): Add
'msgid_comment_is_utf8' field.
(arglist_parser_remember): Add comment_is_utf8 argument.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_alloc,
arglist_parser_clone): Update.
(arglist_parser_remember): Add comment_is_utf8 argument.
(arglist_parser_done): Pass comment_is_utf8 value down to remember_a_message.
* gettext-tools/src/x-c.c (extract_parenthesized): Update callers. Don't set
xgettext_current_source_encoding around arglist_parser_remember calls.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-perl.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-awk.c (extract_parenthesized): Update callers.
* gettext-tools/src/x-elisp.c (read_object): Likewise.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-sh.c (read_command): Likewise.
* gettext-tools/src/x-tcl.c (read_command): Likewise.

6 years agoxgettext: Delay calls to from_current_source_encoding, part 2.
Bruno Haible [Sun, 4 Nov 2018 22:28:58 +0000 (23:28 +0100)] 
xgettext: Delay calls to from_current_source_encoding, part 2.

* gettext-tools/src/xg-arglist-parser.h: Include xg-mixed-string.h.
(struct partial_call): Change type of fields msgctxt, msgid, msgid_plural to
'mixed_string_ty *'.
(arglist_parser_remember, arglist_parser_remember_msgctxt): Take a
'mixed_string_ty *' argument instead of a 'char *' argument.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_clone): Update
accordingly.
(arglist_parser_remember, arglist_parser_remember_msgctxt): Take a
'mixed_string_ty *' argument.
(arglist_parser_done): Convert the mixed_string to UTF-8 encoded 'char *' here.
This is where from_current_source_encoding gets invoked now: immediately before
invoking remember_a_message, that is, only when we really need to know the
--from-source encoding.
* gettext-tools/src/x-c.c (extract_parenthesized): Pass the mixed_string to
arglist_parser_remember. Don't set xgettext_current_source_encoding around
arglist_parser_done calls.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-lisp.c: Include xg-mixed-string.h.
(read_object): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-awk.c: Include xg-mixed-string.h.
(extract_parenthesized): Convert the string to a mixed_string_ty before passing
it to arglist_parser_remember.
* gettext-tools/src/x-lua.c: Include xg-mixed-string.h.
(extract_balanced): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-php.c: Include xg-mixed-string.h.
(extract_balanced): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-sh.c: Include xg-mixed-string.h.
(read_command): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-tcl.c: Include xg-mixed-string.h.
(read_command): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-perl.c (extract_balanced): Convert the string to a
mixed_string_ty before passing it to arglist_parser_remember. Don't set
xgettext_current_source_encoding around arglist_parser_done calls.

6 years agoxgettext: Simplify calling convention of remember_a_message.
Bruno Haible [Sun, 4 Nov 2018 19:23:36 +0000 (20:23 +0100)] 
xgettext: Simplify calling convention of remember_a_message.

* gettext-tools/src/xg-message.h (remember_a_message,
remember_a_message_plural): Add is_utf8, comment_is_utf8 arguments.
* gettext-tools/src/xg-message.c (remember_a_message,
remember_a_message_plural): Likewise.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update callers.
* gettext-tools/src/x-awk.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-c.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-desktop.c (extract_desktop_handle_pair): Likewise.
* gettext-tools/src/x-elisp.c (read_object): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-perl.c (extract_variable, interpolate_keywords,
extract_balanced): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-sh.c (read_word, read_command): Likewise.
* gettext-tools/src/x-smalltalk.c (extract_smalltalk): Likewise.
* gettext-tools/src/x-tcl.c (read_command): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-ycp.c (extract_parenthesized): Likewise.
* gettext-tools/src/xgettext.c (xgettext_its_extract_callback): Likewise.

6 years agoxgettext: Delay calls to from_current_source_encoding, part 1.
Bruno Haible [Sun, 4 Nov 2018 19:23:31 +0000 (20:23 +0100)] 
xgettext: Delay calls to from_current_source_encoding, part 1.

* xg-mixed-string.h (enum segment_type, struct mixed_string_segment,
struct mixed_string, mixed_string_ty): New types.
(mixed_string_alloc_simple, mixed_string_alloc_utf8, mixed_string_clone,
mixed_string_contents, mixed_string_free, mixed_string_contents_free1,
mixed_string_concat, mixed_string_concat_free1): New declarations.
(struct mixed_string_buffer): Change internal representation to use segments.
(mixed_string_buffer_result): Change return type to 'mixed_string_ty *'.
* xg-mixed-string.c: Include flexmember.h, msgl-ascii.h, po-charset.h.
(segment_alloc, segment_clone, mixed_string_alloc_simple,
mixed_string_alloc_utf8, mixed_string_clone, mixed_string_contents,
mixed_string_free, mixed_string_contents_free1, mixed_string_concat,
mixed_string_concat_free1): New functions.
(mixed_string_buffer_init, mixed_string_buffer_is_empty): Change to match new
internal representation.
(mixed_string_buffer_grow_curr_buffer): New function.
(mixed_string_buffer_grow_utf8_buffer): Remove function.
(mixed_string_buffer_append_to_utf8_buffer): Update accordingly.
(mixed_string_buffer_flush_curr_buffer): Remove function.
(mixed_string_buffer_add_segment, mixed_string_buffer_flush_curr): New
functions.
(mixed_string_buffer_append_char, mixed_string_buffer_append_unicode,
mixed_string_buffer_destroy, mixed_string_buffer_result): Change to match new
internal representation.
* x-c.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get, phase6_get, phase8a_get): For tokens of type
token_type_string_literal, use a mixed_string.
(phase8_get): Use mixed_string_concat_free1.
(struct xgettext_token_ty): New field 'mixed_string'.
(x_c_lex, extract_parenthesized): For tokens of type
xgettext_token_type_string_literal, use a mixed_string.
* x-csharp.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase6_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase7_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-java.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase6_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-javascript.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_javascript_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-python.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_python_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-rst.c (extract_rsj): Update.
* x-vala.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase3_get): For tokens of type token_type_string_literal, use a mixed_string.
For tokens of type token_type_string_template, fix a memory leak.
(x_vala_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string_literal, use a
mixed_string.

6 years agoxgettext: JavaScript: Make more use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:23:25 +0000 (20:23 +0100)] 
xgettext: JavaScript: Make more use of mixed_string_buffer.

* gettext-tools/src/x-javascript.c (struct unicode_string_buffer): Remove type.
(init_unicode_string_buffer, unicode_string_buffer_append_unicode_grow,
unicode_string_buffer_append_unicode, unicode_string_buffer_result,
free_unicode_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.

6 years agoxgettext: Python: Make more use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:23:18 +0000 (20:23 +0100)] 
xgettext: Python: Make more use of mixed_string_buffer.

* gettext-tools/src/x-python.c (struct unicode_string_buffer): Remove type.
(init_unicode_string_buffer, unicode_string_buffer_append_unicode_grow,
unicode_string_buffer_append_unicode, unicode_string_buffer_result,
free_unicode_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.

6 years agoxgettext: Change the C# extractor to make use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:20:44 +0000 (20:20 +0100)] 
xgettext: Change the C# extractor to make use of mixed_string_buffer.

* gettext-tools/src/x-csharp.c (struct string_buffer): Remove type.
(init_string_buffer, string_buffer_append_unicode_grow,
string_buffer_append_unicode, string_buffer_result, free_string_buffer): Remove
functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.
(phase6_get): Likewise.

6 years agoxgettext: Optimize away a memory allocation.
Bruno Haible [Sun, 4 Nov 2018 19:20:37 +0000 (20:20 +0100)] 
xgettext: Optimize away a memory allocation.

* gettext-tools/src/x-c.c (phase5_get): Allocate the mixed_string_buffer on the
stack, not on the heap.
* gettext-tools/src/x-csharp.c (phase6_get): Likewise.
* gettext-tools/src/x-javascript.c (phase5_get): Likewise.
* gettext-tools/src/x-python.c (phase5_get): Likewise.
* gettext-tools/src/x-vala.c (phase3_get): Likewise.
* gettext-tools/src/x-rst.c (stringbuf, parse_string, extract_rsj): Allocate the
mixed_string_buffer statically, not on the heap.
* gettext-tools/src/xg-mixed-string.h (mixed_string_buffer_alloc,
mixed_string_buffer_done): Remove declarations.
* gettext-tools/src/xg-mixed-string.c (mixed_string_buffer_alloc,
mixed_string_buffer_done): Remove functions.

6 years agoxgettext: Change the Java extractor to make use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:20:30 +0000 (20:20 +0100)] 
xgettext: Change the Java extractor to make use of mixed_string_buffer.

* gettext-tools/src/xg-mixed-string.h: Include <stdbool.h>.
(mixed_string_buffer_init, mixed_string_buffer_is_empty,
mixed_string_buffer_destroy, mixed_string_buffer_result): New declarations.
* gettext-tools/src/xg-mixed-string.c: Include xg-pos.h.
(mixed_string_buffer_init): New function.
(mixed_string_buffer_alloc): Invoke it.
(mixed_string_buffer_is_empty): New function, based on comment_at_start in
x-java.c.
(mixed_string_buffer_append_lone_surrogate): New function, based on
string_buffer_append_lone_surrogate in x-java.c.
(mixed_string_buffer_flush_utf16_surr, mixed_string_buffer_append_unicode): Use
it.
(mixed_string_buffer_destroy, mixed_string_buffer_result): New functions.
(mixed_string_buffer_done): Invoke mixed_string_buffer_result.
* gettext-tools/src/x-java.c: Include xg-mixed-string.h.
(struct string_buffer): Remove type.
(init_string_buffer, string_buffer_append_byte,
string_buffer_append_unicode_grow, string_buffer_append_unicode,
string_buffer_append_lone_surrogate, string_buffer_flush_utf16_surr,
string_buffer_flush_curr_buffer): Remove functions.
(mixed_string_buffer_append): Renamed from string_buffer_append. Use
mixed_string_buffer.
(string_buffer_result, free_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.
(accumulate_escaped, phase5_get): Likewise.

6 years agoxgettext: Share some more code among extractors.
Bruno Haible [Sun, 4 Nov 2018 19:20:24 +0000 (20:20 +0100)] 
xgettext: Share some more code among extractors.

* gettext-tools/src/xg-pos.h: New file.
* gettext-tools/src/xg-pos.c: New file.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add xg-pos.h.
(xgettext_SOURCES): Add xg-pos.c.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/x-awk.c: Include xg-pos.h.
(real_file_name, logical_file_name, line_number): Remove variables.
* gettext-tools/src/x-c.c: Likewise.
* gettext-tools/src/x-csharp.c: Likewise.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-java.c: Likewise.
* gettext-tools/src/x-javascript.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-lisp.c: Likewise.
* gettext-tools/src/x-lua.c: Likewise.
* gettext-tools/src/x-perl.c: Likewise.
* gettext-tools/src/x-php.c: Likewise.
* gettext-tools/src/x-python.c: Likewise.
* gettext-tools/src/x-rst.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/src/x-smalltalk.c: Likewise.
* gettext-tools/src/x-tcl.c: Likewise.
* gettext-tools/src/x-vala.c: Likewise.
* gettext-tools/src/x-ycp.c: Likewise.

6 years agoxgettext: Split source code into smaller files.
Bruno Haible [Sun, 4 Nov 2018 19:20:19 +0000 (20:20 +0100)] 
xgettext: Split source code into smaller files.

* gettext-tools/src/rc-str-list.h: New file, extracted from
gettext-tools/src/xgettext.h.
* gettext-tools/src/xg-encoding.h: Likewise.
* gettext-tools/src/xg-mixed-string.h: Likewise.
* gettext-tools/src/xg-arglist-context.h: Likewise.
* gettext-tools/src/xg-arglist-callshape.h: Likewise.
* gettext-tools/src/xg-arglist-parser.h: Likewise.
* gettext-tools/src/xg-message.h: Likewise.
* gettext-tools/src/xg-encoding.c: New file, extracted from
gettext-tools/src/xgettext.c.
* gettext-tools/src/xg-mixed-string.c: Likewise.
* gettext-tools/src/xg-arglist-context.c: Likewise.
* gettext-tools/src/xg-arglist-callshape.c: Likewise.
* gettext-tools/src/xg-arglist-parser.c: Likewise.
* gettext-tools/src/xg-message.c: Likewise.
* gettext-tools/src/xgettext.h: Remove declarations that moved to rc-str-list.h
and xg-*.h.
(add_all_comments, comment_tag, msgstr_prefix, msgstr_suffix,
default_syntax_check, current_formatstring_parser1,
current_formatstring_parser2, current_formatstring_parser3): New declarations.
(xgettext_comment, xgettext_comment_reset, savable_comment_to_xgettext_comment,
recognize_qt_formatstrings): New declarations.
(substring_match): Remove obsolete declaration.
* gettext-tools/src/xgettext.c: Include xgettext.h first.
Include <iconv.h>, rc-str-list.h, xg-encoding.h, xg-arglist-context.h,
xg-message.h. Don't include xsize.h, po-xerror.h, unistr.h.
(add_all_comments, comment_tag, msgstr_prefix, msgstr_suffix,
default_syntax_check): Make global.
(split_keywordspec, insert_keyword_callshape): Moved to xg-arglist-callshape.c.
(null_context, passthrough_context, inherited_context,
null_context_list_iterator, passthrough_context_circular_list,
passthrough_context_list_iterator, flag_context_list_iterator,
flag_context_list_iterator_advance, flag_context_list_table_lookup): Move to
xg-arglist-context.c.
(flag_context_list_table_insert): Move bulk of body to new function
flag_context_list_table_add in xg-arglist-context.c.
(xgettext_comment, xgettext_comment_reset, savable_comment_to_xgettext_comment):
Make global.
(current_formatstring_parser1, current_formatstring_parser2,
current_formatstring_parser3): Make global.
(non_ascii_error_message, from_current_source_encoding): Move to xg-encoding.c.
(CONVERT_STRING, set_format_flags_from_context, warn_format_string,
remember_a_message, remember_a_message_plural): Move to xg-message.c.
(arglist_parser_alloc, arglist_parser_clone, arglist_parser_remember,
arglist_parser_remember_msgctxt, arglist_parser_decidedp, arglist_parser_done):
Move to xg-arglist-parser.c.
(mixed_string_buffer_alloc, mixed_string_buffer_append_to_curr_buffer,
mixed_string_buffer_grow_utf8_buffer, mixed_string_buffer_append_to_utf8_buffer,
mixed_string_buffer_flush_utf16_surr, mixed_string_buffer_flush_curr_buffer,
mixed_string_buffer_append_char, mixed_string_buffer_append_unicode,
mixed_string_buffer_done): Move to xg-mixed-string.c.
(recognize_qt_formatstrings): New function.
* gettext-tools/src/x-*.h: Include xg-arglist-context.h instead of xgettext.h.
* gettext-tools/src/x-*.c: Update include directives.
* gettext-tools/src/its.h: Likewise.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add the new .h files.
(xgettext_SOURCES): Add the new .c files.
* gettext-tools/src/FILES: Update.

6 years agoxgettext: Fix crash when parsing invalid \Uxxxxxxxx escape sequence.
Bruno Haible [Sun, 4 Nov 2018 19:20:10 +0000 (20:20 +0100)] 
xgettext: Fix crash when parsing invalid \Uxxxxxxxx escape sequence.

* gettext-tools/src/x-c.c (phase3_pushback): Increase size to 9 characters.

6 years agoxgettext: Add support for C++11 raw string literals.
Bruno Haible [Sun, 4 Nov 2018 19:20:03 +0000 (20:20 +0100)] 
xgettext: Add support for C++11 raw string literals.

* gettext-tools/src/x-c.c (phase5_get): Recognize the R"..." syntax and its variants.
* gettext-tools/tests/xgettext-c-20: Change expected error message.

6 years agoxgettext: Add support for C11 string literals.
Bruno Haible [Sun, 4 Nov 2018 19:19:56 +0000 (20:19 +0100)] 
xgettext: Add support for C11 string literals.

* gettext-tools/src/x-c.c (phase5_get): Recognize the u8"..." syntax.
* gettext-tools/tests/xgettext-c-25: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

6 years agoxgettext: Vala: Improve parsing of escape sequences.
Bruno Haible [Sun, 4 Nov 2018 19:19:49 +0000 (20:19 +0100)] 
xgettext: Vala: Improve parsing of escape sequences.

* gettext-tools/src/x-vala.c (phase7_getc): Don't recognize \?, \a, \1...\7, \U.
Do recognize \$.
* gettext-tools/tests/xgettext-vala-1: Test \t in verbatim strings literals.
* NEWS: Mention the change.

6 years agoxgettext: Fix result for concatenation of strings with escape sequences.
Bruno Haible [Sun, 4 Nov 2018 19:09:47 +0000 (20:09 +0100)] 
xgettext: Fix result for concatenation of strings with escape sequences.

Reported by Morten Welinder <mwelinder@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2015-12/msg00017.html>
and <https://savannah.gnu.org/bugs/?46756>.

Revert commits from
2014-05-07 xgettext: Provide a way to interpret string literals lazily
2014-05-07 c: Interpret string literals lazily
2014-05-09 vala: Interpret string literals lazily
2014-12-02 c: Support C++11 string literals
and subsequent fixes of these.

* gettext-tools/src/xgettext.h (savable_comment_convert_encoding): Remove
declaration.
(enum literalstring_escape_type, struct literalstring_parser): Remove types.
(struct partial_call): Update.
(arglist_parser_remember_literal): Remove declaration.
* gettext-tools/src/xgettext.c (struct extractor_ty): Remove
'literalstring_parser' field.
(savable_comment_convert_encoding): Remove function.
(current_literalstring_parser): Remove variable.
(extract_from_file, arglist_parser_alloc, arglist_parser_clone): Update.
(arglist_parser_remember_literal): Remove function.
(arglist_parser_remember_msgctxt): Simplify accordingly.
* gettext-tools/src/x-*.h (SCANNERS_*): Remove literalstring_parser initializer.
* gettext-tools/src/x-c.h (literalstring_c): Remove declaration.
* gettext-tools/src/x-c.c: Remove all traces of literalstring_escape_type and
literalstring_parser.
(phase7_getc, phase7_ungetc): Reinstantiate functions.
(phase5_get): Simplify. Use phase7_getc.
* gettext-tools/src/x-vala.c: Remove all traces of literalstring_escape_type and
literalstring_parser.
(phase7_getc, phase7_ungetc): Reinstantiate functions.
(phase3_get): Simplify. Use phase7_getc.
(extract_balanced): Simplify.

6 years agoxgettext: New tests for non-ASCII extracted comments.
Bruno Haible [Sun, 4 Nov 2018 18:59:31 +0000 (19:59 +0100)] 
xgettext: New tests for non-ASCII extracted comments.

* gettext-tools/tests/xgettext-c-24: New file.
* gettext-tools/tests/xg-c-24.c: New file.
* gettext-tools/tests/xgettext-vala-2: New file.
* gettext-tools/tests/xg-vala-2.vala: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add xgettext-c-24, xgettext-vala-2.
(EXTRA_DIST): Add xg-c-24.c, xg-vala-2.vala.

6 years agoxgettext: Enhance test for NUL byte handling.
Bruno Haible [Sun, 4 Nov 2018 18:42:32 +0000 (19:42 +0100)] 
xgettext: Enhance test for NUL byte handling.

* gettext-tools/tests/xg-c-21.c: Add some more test cases.
* gettext-tools/tests/xgettext-c-21: Update expected result accordingly. Change
expected result for backslash-NUL.

6 years agoxgettext: New test of concatenation of strings with escape sequences.
Bruno Haible [Sun, 4 Nov 2018 18:41:53 +0000 (19:41 +0100)] 
xgettext: New test of concatenation of strings with escape sequences.

Reported by Morten Welinder <mwelinder@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2015-12/msg00017.html>
and <https://savannah.gnu.org/bugs/?46756>.

* gettext-tools/tests/xgettext-c-23: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

6 years agoxgettext: JavaScript: Fix a memory leak.
Bruno Haible [Sun, 4 Nov 2018 18:31:19 +0000 (19:31 +0100)] 
xgettext: JavaScript: Fix a memory leak.

* gettext-tools/src/x-javascript.c (free_token): Free tp->string also for
token_type_keyword.

6 years agoWhitespace changes.
Bruno Haible [Sun, 4 Nov 2018 18:29:29 +0000 (19:29 +0100)] 
Whitespace changes.

* gettext-tools/src/cldr-plural-exp.h: Add a blank line.
* gettext-tools/src/locating-rule.h: Correct indentation.

6 years agoFix test failure with valgrind.
Bruno Haible [Sun, 4 Nov 2018 18:29:21 +0000 (19:29 +0100)] 
Fix test failure with valgrind.

* gettext-tools/tests/msgcmp-4: Filter out valgrind's messages from the output.

6 years agoMake test files executable.
Bruno Haible [Sun, 28 Oct 2018 13:50:39 +0000 (14:50 +0100)] 
Make test files executable.

* gettext-tools/tests/xgettext-c-22: Make executable.
* gettext-tools/tests/xgettext-properties-[234]: Likewise.
* gettext-tools/tests/xgettext-rst-[12]: Likewise.

6 years agoMake it easier to build the code when the documentation tools don't work.
Bruno Haible [Sun, 28 Oct 2018 13:38:27 +0000 (14:38 +0100)] 
Make it easier to build the code when the documentation tools don't work.

* gettext-tools/Makefile.am (SUBDIRS): Move 'doc' to the end. Move 'its' to the
middle.

6 years agotests: Improve reliability.
Bruno Haible [Sun, 28 Oct 2018 10:52:43 +0000 (11:52 +0100)] 
tests: Improve reliability.

* xgettext-3: Verify the exit code of the xgettext invocation.
* xgettext-4: Likewise.
* xgettext-appdata-1: Likewise.
* xgettext-c-19: Likewise.
* xgettext-c-20: Likewise.
* xgettext-c-21: Likewise.
* xgettext-csharp-2: Likewise.
* xgettext-csharp-3: Likewise.
* xgettext-csharp-8: Likewise.
* xgettext-desktop-1: Likewise.
* xgettext-glade-1: Likewise.
* xgettext-glade-6: Likewise.
* xgettext-glade-7: Likewise.
* xgettext-gsettings-1: Likewise.
* xgettext-perl-2: Likewise.
* xgettext-perl-3: Likewise.

6 years agopo, examples: Change .po -> .gmo rules to consider the newest changes to the POT...
Bruno Haible [Wed, 24 Oct 2018 23:41:42 +0000 (01:41 +0200)] 
po, examples: Change .po -> .gmo rules to consider the newest changes to the POT file.

Reported by Claude Paroz <claude@2xlibre.net>
in <https://savannah.gnu.org/bugs/?50910>.

* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Set MSGMERGE_FOR_MSGFMT_OPTION.
* gettext-runtime/po/Makefile.in.in (MSGMERGE): Use GNU msgmerge, even if not
first in $PATH.
(MSGMERGE_FOR_MSGFMT_OPTION): New variable.
(.po.gmo): Depend on the POT file. Use msgmerge on the fly, to take into
account the most recent POT file changes.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm,
update-properties, update-classes targets.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
(MSGMERGE_FOR_MSGFMT_OPTION): New variable.
($(STRINGSFILES)): Depend on the POT file. Use msgmerge on the fly, to take
into account the most recent POT file changes.

6 years agomsgmerge: New option --for-msgfmt.
Bruno Haible [Wed, 24 Oct 2018 23:09:38 +0000 (01:09 +0200)] 
msgmerge: New option --for-msgfmt.

* gettext-tools/src/msgmerge.c (for_msgfmt): New variable.
(long_options): Add option --for-msgfmt.
(main): Handle option --for-msgfmt.
(usage): Document option --for-msgfmt.
(match_domain): When --for-msgfmt is given, omit untranslated and fuzzy messages
from the result.
(merge): When --for-msgfmt is given, don't add obsolete messages to the result.
* gettext-tools/tests/msgmerge-26: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/msgmerge.texi: Mention the option --for-msgfmt.
* NEWS: Mention the change.

6 years agoAdd ability to write PO files without translator comment lines.
Bruno Haible [Wed, 24 Oct 2018 23:03:32 +0000 (01:03 +0200)] 
Add ability to write PO files without translator comment lines.

* gettext-tools/src/write-po.h (message_print_style_comment): New declaration.
* gettext-tools/src/write-po.c (print_comment): New variable.
(message_print_style_comment): New function.
(message_print_comment): Output nothing if print_comment is false.

6 years agoImprove reliability of 'make dist'.
Bruno Haible [Wed, 24 Oct 2018 21:14:41 +0000 (23:14 +0200)] 
Improve reliability of 'make dist'.

* gettext-tools/examples/po/Makefile.am (distdir1): Depend on the .pot file.

6 years agopo, examples: Put stamp-po in the source directory.
Bruno Haible [Wed, 24 Oct 2018 21:13:36 +0000 (23:13 +0200)] 
po, examples: Put stamp-po in the source directory.

Rationale: <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>.

* gettext-runtime/po/Makefile.in.in: Use $(srcdir)/stamp-po instead of stamp-po.
Talk about "version control system", not CVS.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise.
* gettext-tools/examples/po/Makefile.am: Likewise.
* gettext-tools/examples/check-examples (func_check_dist_vpath): Verify the
stamp-po file does not exist in the build dir, except when using the older
Makefile.in.in infrastructure.

6 years agopo: Make "make maintainer-clean" erase the .pot file.
Bruno Haible [Wed, 24 Oct 2018 20:08:10 +0000 (22:08 +0200)] 
po: Make "make maintainer-clean" erase the .pot file.

Rationale:
<https://www.gnu.org/prep/standards/html_node/Standard-Targets.html>
<https://www.gnu.org/software/automake/manual/html_node/Clean.html>

* NEWS: Mention the change.
* gettext-runtime/po/Makefile.in.in (maintainer-clean): Remove the .pot file.
* gettext-tools/examples/hello-*/po/Makefile.am (MAINTAINERCLEANFILES): Add
the .pot file.
* gettext-tools/examples/po/Makefile.am (MAINTAINERCLEANFILES): Likewise.
* gettext-tools/examples/check-examples (func_check_maintainerclean,
func_check_maintainerclean_vpath): Verify the .pot file is removed after
'make maintainer-clean', except when using the older Makefile.in.in
infrastructure.

6 years agopo, examples: Use case-insensitive search for "GNU <PACKAGE_NAME>".
Bruno Haible [Wed, 24 Oct 2018 16:45:36 +0000 (18:45 +0200)] 
po, examples: Use case-insensitive search for "GNU <PACKAGE_NAME>".

Reported by Akim Demaille <akim@lrde.epita.fr> in
<https://lists.gnu.org/archive/html/bug-gettext/2018-10/msg00020.html>.

* gettext-runtime/po/Makefile.in.in ($(DOMAIN).pot-update): Use a
case-insensitive search for "GNU <PACKAGE_NAME>".
* gettext-tools/examples/hello-*/po/Makefile.am ($(DOMAIN).pot-update):
Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
($(DOMAIN).pot-update): Likewise.

6 years agopo: Remove obsolete Makefile rules for .mo files.
Bruno Haible [Wed, 24 Oct 2018 16:33:23 +0000 (18:33 +0200)] 
po: Remove obsolete Makefile rules for .mo files.

* gettext-runtime/po/Makefile.in.in (MSGFMT*): Remove variables.
(.SUFFIXES): Remove .mo.
(.po.mo): Remove rule.
(distclean): Don't remove *.mo files.
* gettext-tools/examples/hello-*/po/Makefile.am (.SUFFIXES): Remove .mo.
(.po.mo): Remove rule.
(DISTCLEANFILES): Remove *.mo.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (.SUFFIXES):
Remove .mo.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Don't set MSGFMT_015.

6 years agoRemove outdated DJGPP build infrastructure.
Bruno Haible [Wed, 24 Oct 2018 02:41:02 +0000 (04:41 +0200)] 
Remove outdated DJGPP build infrastructure.

Approved by Juan Manuel Guerrero <juan.guerrero@gmx.de>.

* djgpp: Remove directory.
* Makefile.am (EXTRA_DIST): Remove the djgpp files.

6 years agoexamples: Add support for msgmerge --previous.
Bruno Haible [Tue, 23 Oct 2018 22:46:52 +0000 (00:46 +0200)] 
examples: Add support for msgmerge --previous.

This mirrors the Makefile.in.in change from 2016-07-01.

* gettext-tools/examples/hello-*/po/Makefile.am ($(POFILES), update-po): Use
option --previous when the msgmerge program supports it.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.

6 years agoexamples: Support reading header comments from file.
Bruno Haible [Tue, 23 Oct 2018 22:45:52 +0000 (00:45 +0200)] 
examples: Support reading header comments from file.

This mirrors the Makefile.in.in change from 2015-09-01 with the amendment
from today.

* gettext-tools/examples/hello-*/po/Makefile.am ($(DOMAIN).pot-update):
Replace header entry with the content of $(DOMAIN).pot-header, if exists.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.

6 years agoexamples: Make it possible to pass custom options to msginit.
Bruno Haible [Tue, 23 Oct 2018 22:43:32 +0000 (00:43 +0200)] 
examples: Make it possible to pass custom options to msginit.

This mirrors the Makevars change from 2014-10-08.

* gettext-tools/examples/hello-*/po/Makefile.am (MSGINIT_OPTIONS): New variable.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.

6 years agoexamples: Add an option to claim the package as GNU/non-GNU.
Bruno Haible [Tue, 23 Oct 2018 22:42:20 +0000 (00:42 +0200)] 
examples: Add an option to claim the package as GNU/non-GNU.

This mirrors the Makefile.in.in and Makevars change from 2014-05-01.

Reported by David Shea at <https://savannah.gnu.org/bugs/?40520>.

* gettext-runtime/po/Makefile.in.in ($(DOMAIN).pot-update): Tweak whitespace.
* gettext-tools/examples/hello-*/po/Makefile.am (PACKAGE_GNU): New variable.
($(DOMAIN).pot-update): Don't search for "GNU packagename" if $(PACKAGE_GNU) is
set.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.

6 years agoexamples: Upgrade to newest Makevars.
Bruno Haible [Tue, 23 Oct 2018 22:41:09 +0000 (00:41 +0200)] 
examples: Upgrade to newest Makevars.

* gettext-tools/examples/hello-*/po/Makevars (PACKAGE_GNU, MSGINIT_OPTIONS,
PO_DEPENDS_ON_POT, DIST_DEPENDS_ON_UPDATE_PO): New variables.
* gettext-tools/examples/hello-*/configure.* (AM_GNU_GETTEXT_VERSION): Require
version 0.19.8.
* gettext-tools/examples/po/xsmallpot.sh (hello-c++-kde): Likewise.
* gettext-tools/examples/hello-*/m4/Makefile.am (EXTRA_DIST): Update list of .m4
files.
* gettext-tools/examples/hello-*/autoclean.sh: Likewise.
* gettext-tools/examples/check-examples (func_check_maintainerclean,
func_check_maintainerclean_vpath): Allow left-over .po~ files.

6 years agoexamples: Avoid grepping through monster files.
Bruno Haible [Tue, 23 Oct 2018 22:31:23 +0000 (00:31 +0200)] 
examples: Avoid grepping through monster files.

This mirrors the Makefile.in.in change from 2010-06-12.

Reported by Jim Meyering <jim@meyering.net>.

* gettext-tools/examples/hello-*/po/Makefile.am (($(DOMAIN).pot-update): When
GNU find is available, avoid grepping through monster files.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.

6 years agoexamples: Don't create unnecessary installation directories.
Bruno Haible [Tue, 23 Oct 2018 22:28:21 +0000 (00:28 +0200)] 
examples: Don't create unnecessary installation directories.

This mirrors the Makefile.in.in change from 2009-06-09.

Reported by Serge Pavlovsky <pal666@gmail.com>.

* gettext-tools/examples/hello-*/po/Makefile.am (install-data-local-yes,
installdirs-local-yes): Remove unnecessary MKDIR_P invocations.

6 years agopo: Make the insertion of the .pot-header file more robust.
Bruno Haible [Tue, 23 Oct 2018 22:22:37 +0000 (00:22 +0200)] 
po: Make the insertion of the .pot-header file more robust.

This improves on the 2015-09-01 patch.

* gettext-runtime/po/Makefile.in.in ($(DOMAIN).pot-update): Fail if the 'cat'
command fails.

6 years agopo: When doing msgmerge --version, use the correct msgmerge program.
Bruno Haible [Tue, 23 Oct 2018 22:21:31 +0000 (00:21 +0200)] 
po: When doing msgmerge --version, use the correct msgmerge program.

This reverts the patch from
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00000.html>.
Rationale:
<https://lists.gnu.org/archive/html/bug-gettext/2018-10/msg00000.html>.

* gettext-runtime/po/Makefile.in.in ($(POFILES)): Use $(MSGMERGE_UPDATE),
not $(MSGMERGE).

6 years agopo: Make $(POFILES) target more robust.
Bruno Haible [Tue, 23 Oct 2018 22:19:53 +0000 (00:19 +0200)] 
po: Make $(POFILES) target more robust.

It was introduced on 2014-05-01.

* gettext-runtime/po/Makefile.in.in ($(POFILES)): Create POT file also when the
PO file does not yet exist. Fail if creation of the POT file fails.

6 years agoUpdate list of files to check with gnulib.
Bruno Haible [Tue, 23 Oct 2018 20:52:36 +0000 (22:52 +0200)] 
Update list of files to check with gnulib.

* Makefile.am (distcheck): Check also localename-table.h and localename-table.c.

6 years agointl: Improve support for per-thread locales on Solaris 11.4.
Bruno Haible [Tue, 23 Oct 2018 20:48:46 +0000 (22:48 +0200)] 
intl: Improve support for per-thread locales on Solaris 11.4.

* gettext-runtime/intl/localename.c: Update from gnulib:
Handle HAVE_SOLARIS114_LOCALES through Solaris specific code.
* gettext-runtime/intl/localename-table.in.h: Update from gnulib's
localename-table.h.
* gettext-runtime/intl/localename-table.c: Update from gnulib.
* gettext-runtime/m4/intl-thread-locale.m4: Renamed from
gettext-runtime/m4/intlsolaris.m4.
(gt_INTL_THREAD_LOCALE_NAME): Renamed from gt_INTL_SOLARIS. Define
HAVE_SOLARIS114_LOCALES instead of HAVE_NAMELESS_LOCALES.
* gettext-runtime/m4/intl.m4: Update from gnulib:
(AM_INTL_SUBDIR): Require gt_INTL_THREAD_LOCALE_NAME. Test for 'uselocale'. Set
HAVE_NAMELESS_LOCALES.
(gt_INTL_SUBDIR_CORE): Don't invoke gt_INTL_SOLARIS. Don't set
HAVE_NAMELESS_LOCALES here.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): List intl-thread-locale.m4, not
intlsolaris.m4.
* gettext-tools/m4/Makefile.am (aclocal_DATA): List intl-thread-locale.m4, not
intlsolaris.m4.
* gettext-tools/misc/gettextize.in (m4filelist): List intl-thread-locale.m4, not
intlsolaris.m4.
* Makefile.am (distcheck-hook): Check intl-thread-locale.m4, not intlsolaris.m4.
* gettext-tools/doc/gettext.texi (aclocal): List intl-thread-locale.m4, not
intlsolaris.m4.
* PACKAGING: List intl-thread-locale.m4, not intlsolaris.m4.

6 years agoUpdate to newest gnulib.
Bruno Haible [Tue, 23 Oct 2018 20:34:42 +0000 (22:34 +0200)] 
Update to newest gnulib.

6 years agointl: Fix support for per-thread locales on Solaris 11.4.
Bruno Haible [Tue, 23 Oct 2018 18:29:48 +0000 (20:29 +0200)] 
intl: Fix support for per-thread locales on Solaris 11.4.

* gettext-runtime/intl/localename-table.in.h: Renamed from
gettext-runtime/intl/localename-table.h.
* gettext-runtime/intl/Makefile.in (HEADERS): Add localename-table.in.h. Remove
localename-table.h.
(localename-table.h): New target.
(localename.$lo, localename-table.$lo): Update dependencies.
(mostlyclean): Remove localename-table.h.

6 years agoxgettext: Fix compiler warning
Daiki Ueno [Sun, 21 Oct 2018 06:35:32 +0000 (08:35 +0200)] 
xgettext: Fix compiler warning

* gettext-tools/src/x-javascript.c (phase5_scan_regexp): Remove
implicit argument.  Reported in:
<https://savannah.gnu.org/bugs/?48404>.

6 years agoUpdate after gnulib changed.
Bruno Haible [Tue, 23 Oct 2018 01:07:36 +0000 (03:07 +0200)] 
Update after gnulib changed.

* configure.ac: Require Autoconf >= 2.63.
* gettext-runtime/configure.ac: Likewise.
* gettext-runtime/libasprintf/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.

6 years agoUpdate from gnulib: Assume Autoconf >= 2.63.
Bruno Haible [Tue, 23 Oct 2018 01:07:31 +0000 (03:07 +0200)] 
Update from gnulib: Assume Autoconf >= 2.63.

* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Don't set localedir.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Update comment.
* gettext-runtime/m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Assume
AC_USE_SYSTEM_EXTENSIONS exists.
* gettext-runtime/m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Likewise,
* gettext-runtime/m4/longlong.m4: Require Autoconf >= 2.62. Update comments.
* gettext-runtime/m4/size_max.m4 (AC_COMPUTE_INT): Remove fallback for
Autoconf < 2.61.

6 years agoUpdate from gnulib: Assume Automake >= 1.11.
Bruno Haible [Tue, 23 Oct 2018 01:07:25 +0000 (03:07 +0200)] 
Update from gnulib: Assume Automake >= 1.11.

* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS, AM_POSTPROCESS_PO_MAKEFILE):
Eliminate uses of 'eval'.

6 years agoUpdate from gnulib: Make better use of Autoconf.
Bruno Haible [Tue, 23 Oct 2018 01:07:20 +0000 (03:07 +0200)] 
Update from gnulib: Make better use of Autoconf.

* gettext-runtime/m4/visibility.m4: Use AC_CACHE_CHECK where possible.

6 years agointl: Add support for per-thread locales on Solaris 11.4.
Bruno Haible [Mon, 22 Oct 2018 23:02:02 +0000 (01:02 +0200)] 
intl: Add support for per-thread locales on Solaris 11.4.

Relies on the recent changes to the 'localename' module in gnulib.

* gettext-runtime/intl/localename.c: Apply changes from gnulib.
* gettext-runtime/intl/localename-table.h: New file, from gnulib.
* gettext-runtime/intl/localename-table.c: New file, from gnulib.
* gettext-runtime/intl/libgnuintl.in.h (newlocale, duplocale, freelocale): New
overriding declarations.
* gettext-runtime/intl/Makefile.in (HEADERS): Add localename-table.h.
(SOURCES): Add localename-table.c.
(OBJECTS): Add localename-table.$lo.
(localename-table.lo): New target.
(libgnuintl.h, libintl.h): Substitute also HAVE_NAMELESS_LOCALES.
* gettext-runtime/m4/intl.m4: Apply changes from gnulib:
(gt_INTL_SUBDIR_CORE): Don't test for 'uselocale' and 'getlocalename_l'.
Instead, invoke gt_INTL_SOLARIS. Set HAVE_NAMELESS_LOCALES.
* gettext-runtime/m4/intlsolaris.m4: New file, from gnulib.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Add it.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Add intlsolaris.m4.
* gettext-tools/misc/gettextize.in (m4filelist): Add intlsolaris.m4.
* Makefile.am (distcheck-hook): Verify that intlsolaris.m4 is consistent with
gnulib.
* gettext-tools/doc/gettext.texi (aclocal): Add intlsolaris.m4 to the file list.
* PACKAGING: Add intlsolaris.m4 to the list of installed files.
* NEWS: Mention the change.

6 years agoUpdate to newest gnulib.
Bruno Haible [Mon, 22 Oct 2018 22:27:22 +0000 (00:27 +0200)] 
Update to newest gnulib.

6 years agoexamples: Fix another build failure.
Bruno Haible [Mon, 22 Oct 2018 22:35:58 +0000 (00:35 +0200)] 
examples: Fix another build failure.

* gettext-tools/examples/po/xsmallpot.sh: In hello-pascal, make sure to build
hello.rsj.

6 years agoNew subdirectory system-tests.
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.

6 years agoUpdate comments.
Bruno Haible [Sat, 20 Oct 2018 22:01:22 +0000 (00:01 +0200)] 
Update comments.

* gettext-tools/tests/Makefile.am: Update comments.

6 years agoRename test gettext-8 to intl-5.
Bruno Haible [Sat, 20 Oct 2018 16:01:27 +0000 (18:01 +0200)] 
Rename test gettext-8 to intl-5.

* gettext-tools/tests/intl-5: Renamed from gettext-tools/tests/gettext-8.
* gettext-tools/tests/intl-5-prg.c: Renamed from
gettext-tools/tests/gettext-8-prg.c.
* gettext-tools/tests/Makefile.am: Update.

6 years agoRename test gettext-7 to intl-thread-3 and support more platforms.
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.

6 years agoMake the intl-thread-2 test effective on Solaris 11.
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.

6 years agoRename test gettext-6 to intl-thread-2 and support more platforms.
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.

6 years agoNew test intl-thread-1.
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.

6 years agoRename test gettext-5 to intl-setlocale-2.
Bruno Haible [Sat, 20 Oct 2018 13:16:54 +0000 (15:16 +0200)] 
Rename test gettext-5 to intl-setlocale-2.

* gettext-tools/tests/intl-setlocale-2: Renamed from
gettext-tools/tests/gettext-5.
* gettext-tools/tests/intl-setlocale-2-prg.c: Renamed from
gettext-tools/tests/gettext-5-prg.c.
* gettext-tools/tests/intl-setlocale-2.po: Renamed from
gettext-tools/tests/gettext-5.po.
* gettext-tools/tests/Makefile.am: Update.

6 years agoRename test gettext-4 to intl-4.
Bruno Haible [Sat, 20 Oct 2018 12:52:24 +0000 (14:52 +0200)] 
Rename test gettext-4 to intl-4.

* gettext-tools/tests/intl-4: Renamed from gettext-tools/tests/gettext-4.
* gettext-tools/tests/intl-4-prg.c: Renamed from
gettext-tools/tests/gettext-4-prg.c.
* gettext-tools/tests/intl-4.po: Renamed from gettext-tools/tests/gettext-4.po.
* gettext-tools/tests/Makefile.am: Update.

6 years agoNew test intl-3.
Bruno Haible [Sat, 20 Oct 2018 12:29:29 +0000 (14:29 +0200)] 
New test intl-3.

* gettext-tools/tests/intl-3: New file.
* gettext-tools/tests/intl-3-prg.c: New file.
* gettext-tools/tests/Makefile.amL Update.