There was an implicit dependency between the prerequisites of
install-exec-local, which may have caused error with make -jN.
Use install-exec-hook to remove the dependency.
Reported by Christian Weisgerber in:
<https://lists.gnu.org/archive/html/bug-gettext/2014-07/msg00008.html>.
* Makefile.am (install-exec-local): Remove.
(install-exec-hook): New rule, depend on install-exec-clean.
autopoint: Select macro tracing method by Autoconf version
Reported and analyzed by Pádraig Brady in:
<http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00071.html>.
* autopoint.in (func_trace_autoconf): Rename from func_trace.
($func_trace): Set to func_trace_autoconf if Autoconf >= 2.69 is
availabl, otherwise to func_trace_sed.
* gettextize.in: Likewise.
Problem reported by Bernhard Voelker in:
<http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00059.html>.
* x-c.c (phase5_get): Add missing memory allocation for empty
string literal.
* loadmsgcat.c: Include assert.h.
(_nl_load_domain): Add semicolon to end of line.
(_nl_load_domain)[HAVE_MMAP]: Use MAP_FAILED and assert that
it is (void *) -1.
(_nl_load_domain)[_LIBC]: Call __libc_rwlock_init instead of
gl_rwlock_init.
(_nl_unload_domain): Cast convd->encoding to non-const.
Daiki Ueno [Mon, 16 Jun 2014 08:42:25 +0000 (17:42 +0900)]
tests: Test "make dist" in autopoint test
* autopoint-3: Run "make dist" after "make"; add a workaround for
a bug in 0.19 and 0.19.1, where intl/ChangeLog is required but
missing in the archive.
Daiki Ueno [Mon, 16 Jun 2014 07:48:33 +0000 (16:48 +0900)]
intl: Stop installing ChangeLog.inst
After the git-version-gen migration (commit fbf4e276), the
creation of gettext-tools/intl/ChangeLog.inst in configure.ac was
removed because we lost access to $RELEASE_DATE. Given that
intl/VERSION provides enough information, simply drop the
ChangeLog file.
Problem reported by Bruce Korb in
<https://lists.gnu.org/archive/html/bug-gettext/2014-06/msg00022.html>.
* Makefile.in (install-data): Don't install ChangeLog.inst.
(distclean): Don't remove ChangeLog.inst.
(uninstall): Don't remove ChangeLog under $(gettextsrcdir)/intl.
(dist): Don't include ChangeLog in the distribution.
Daiki Ueno [Thu, 12 Jun 2014 08:56:23 +0000 (17:56 +0900)]
doc: Update licenses from GNU
* gpl.texi, lgpl.texi, fdl.texi: Update from GNU.
* gettext.texi (GNU GPL, GNU LGPL, GNU LGPL): Define nodes here,
instead of in those license documents.
Daiki Ueno [Tue, 10 Jun 2014 01:57:05 +0000 (10:57 +0900)]
Temporarily add Language: field to all PO file headers
Due to a bug in 0.19, the Language: field is considered mandatory.
This was fixed in commit 31744906, but better avoid error when
building with 0.19 at the moment. This should be overwritten with the
next translations update.
Daiki Ueno [Mon, 9 Jun 2014 04:36:18 +0000 (13:36 +0900)]
msgmerge: Disable --color option in --update mode
Suggested by 林V字龍 at:
<https://lists.gnu.org/archive/html/bug-gettext/2014-06/msg00017.html>.
* msgmerge.c (main): Error out when --color and --update are
specified at the same time.
Daiki Ueno [Sat, 7 Jun 2014 01:35:14 +0000 (10:35 +0900)]
xgettext: Fix misrecognition of character literals in C and Vala
Problem reported by Paul Eggert at
<http://lists.gnu.org/archive/html/bug-gettext/2014-06/msg00015.html>.
* x-c.c (phase5_get): Make sure to skip contents of character constant.
* x-vala.c (phase3_get): Likewise.
Daiki Ueno [Tue, 3 Jun 2014 02:05:50 +0000 (11:05 +0900)]
desktop: Read LINGUAS file even if LINGUAS envvar is set
* msgfmt.c (get_languages): If the LINGUAS envvar is set, use it
to restrict the languages list read from the LINGUAS file, not to
extend the list.
(add_languages): Take an optional DESIRED_LANGUAGES argument.
Daiki Ueno [Mon, 2 Jun 2014 09:04:41 +0000 (18:04 +0900)]
msgl-check: Treat missing header errors as warnings
Problem reported by Richard Hughes at
<https://lists.fedoraproject.org/pipermail/devel/2014-June/199539.html>.
After <https://savannah.gnu.org/bugs/?40262>, "msgfmt -c" reports
error on missing PO headers. However, it turned out to be too strict
for the projects using Launchpad Translations. Let's relax the check
for the moment and wait for one or two release cycles.
* gettext-tools/src/msgl-check.c (check_header_entry): Report missing
required headers as warning, instead of error.
Daiki Ueno [Sun, 1 Jun 2014 23:05:19 +0000 (08:05 +0900)]
build: Handle 'environ' global variable differently on cygwin x86_64
Problem reported by Vasyl Khalak in:
<https://cygwin.com/ml/cygwin/2013-06/msg00228.html>.
* lib/execute.c.diff: New file.
* lib/spawn-pipe.c.diff: Likewise.
* Makefile.am (EXTRA_DIST): Add new patches.
Daiki Ueno [Sat, 31 May 2014 06:44:17 +0000 (15:44 +0900)]
msgexec: Pass previous msgid to the child process
Suggested by Pavel Kharitonov in:
<http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00022.html>.
* msgexec.c (process_string): Set MSGEXEC_PREV_* envvar.
Daiki Ueno [Sat, 31 May 2014 02:28:39 +0000 (11:28 +0900)]
msgfilter: Pass previous msgid to the child process
Suggested by Pavel Kharitonov in:
<http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00022.html>.
* msgfilter.c (process_message): Set MSGFILTER_PREV_* envvar.
Daiki Ueno [Tue, 13 May 2014 23:09:41 +0000 (08:09 +0900)]
build: Fallback $docdir to $datarootdir/doc/gettext
Problem reported by Santiago Vila in
<http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00014.html>.
* gettext-runtime/configure.ac: Adjust $docdir assuming that
AC_PACKAGE_TARNAME is set.
* gettext-tools/configure.ac: Likewise.
* gettext-tools/examples/configure.ac: Likewise.
Daiki Ueno [Tue, 13 May 2014 06:16:39 +0000 (15:16 +0900)]
msgfmt: Accumulate errors when parsing the PO header
Problem reported by Peter Eisentraut at
<https://savannah.gnu.org/bugs/?40262>.
* msgl-check.c (check_header_entry): Return the number of errors.
(check_message): Check the return value of check_header_entry.
Daiki Ueno [Mon, 12 May 2014 07:17:03 +0000 (16:17 +0900)]
build: Don't regenerate man.1 if man.1.in does not exist
* Makefile.am (gettext.1 ngettext.1): Don't try to replace
@localedir@ in .1.in if x-to-1 fails; rewrite the target using the
snippet in the Autoconf manual.
Daiki Ueno [Mon, 12 May 2014 06:18:38 +0000 (15:18 +0900)]
build: Fix Woe32 cross build
* msgfmt.c (add_languages): New function split from get_languages.
(get_languages): Use add_languages instead of manually parsing
LINGUAS envvar with strtok_r possibly provided by libgettextlib.
* x-c.h (literalstring_c): Remove unnecessary DLL_VARIABLE.
* xgettext.c (arglist_parser_alloc): Use LET_NONE instead of 0.
(arglist_parser_remember): Likewise.
* xgettext.h (enum literalstring_escape_type): New enum value
LET_NONE.
* woe32dll/gettextsrc-exports.c: Don't export line_comment and
po_lex_iconv if undefined.
Daiki Ueno [Fri, 9 May 2014 08:00:48 +0000 (17:00 +0900)]
vala: Interpret string literals lazily
* x-vala.c (P7_EOF, P7_STRING_END, P7_QUOTES, P7_QUOTE, P7_NEWLINE)
(UNICODE, IS_UNICODE, UNICODE_VALUE): Remove.
(phase7_getc): Remove.
(phase7_ungetc): Remove.
(phase3_get): Use 'phase2_get' directly to extract string
literals; use 'arglist_parser_remember_literal' instead of
'arglist_parser_remember'.
(literalstring_c): Declare external variable.
(extract_balanced): Remove the
'xgettext_current_source_encoding' setting to prevent encoding
conversion around 'arglist_parser_done'.
(token_ty): New field 'escape'.
* x-vala.h (SCANNERS_VALA): Register 'literalstring_c' as a
literalstring_parser.
Daiki Ueno [Wed, 7 May 2014 09:51:14 +0000 (18:51 +0900)]
c: Interpret string literals lazily
* x-c.c (P7_EOF, P7_STRING_END, P7_QUOTES, P7_QUOTE, P7_NEWLINE)
(UNICODE, IS_UNICODE, UNICODE_VALUE): Remove.
(phase7_get): Remove.
(phase7_ungetc): Remove.
(phase5_get): Use 'phase3_get' directly to extract string
literals; use 'arglist_parser_remember_literal' instead of
'arglist_parser_remember'.
(literalstring_parse): New function.
(literalstring_c): New variable.
(extract_parenthesized): Remove the
'xgettext_current_source_encoding' setting to prevent encoding
conversion around 'arglist_parser_done'.
* x-c.h (SCANNERS_C): Register 'literalstring_c' as a
literalstring_parser.
(literalstring_c): New variable declaration.
Daiki Ueno [Wed, 7 May 2014 09:48:25 +0000 (18:48 +0900)]
xgettext: Provide a way to interpret string literals lazily
* xgettext.c (extract_ty): New field 'literalstring_parser'.
(current_literalstring_parser): New variable.
(extract_from_file): Set 'current_literalstring_parser'.
(savable_comment_convert_encoding): New function.
(arglist_parser_remember_literal): New function.
(arglist_parser_remember): Call 'arglist_parser_remember_literal'.
(arglist_parser_done): Call literalstring_parser on msgctxt,
msgid, and msgid_plural before calling 'remember_a_message';
convert encoding of msgid_comment.
* x-*.h: Register 'literalstring_parser' through SCANNER_*.
* xgettext.h (enum literalstring_escape_type): New enum.
(struct literalstring_parser): New struct.
(struct partial_call): New fields 'msgctxt_escape',
'msgid_escape', and 'msgid_plural_escape'.
(arglist_parser_remember_literal): New function declaration.
(savable_comment_convert_encoding): New function declaration.
Reported by Jiang Xin in
<http://article.gmane.org/gmane.comp.version-control.git/246462>.
* xgettext.c (remember_a_message): Discard a string prefixed to the comment
tag from all remaining comment lines.
Daiki Ueno [Fri, 2 May 2014 19:57:37 +0000 (04:57 +0900)]
c: Support C99-style Unicode character escapes
* x-c.c: Include assert.h and po-charset.h.
(P7_QUOTES, P7_QUOTE, P7_NEWLINE): Redefine as a negative integer.
(P7_EOF, P7_STRING_END): New definitions.
(UNICODE): New macro.
(IS_UNICODE): New macro.
(UNICODE_VALUE): New macro.
(phase7_getc): Recognize "\unnnn" and "\Unnnnnnnn".
(phase5_get): Use mixed_string_buffer for parse string literal.