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.
Daiki Ueno [Fri, 2 May 2014 06:58:04 +0000 (15:58 +0900)]
xgettext: Factor out commonly used mixed_string_buffer
* x-python.c (init_mixed_string_buffer)
(mixed_string_buffer_append_byte)
(mixed_string_buffer_append_unicode_grow)
(mixed_string_buffer_append_unicode)
(mixed_string_buffer_flush_utf16_surr)
(mixed_string_buffer_flush_curr_buffer)
(mixed_string_buffer_append, mixed_string_buffer_result)
(free_mixed_string_buffer): Move to...
* xgettext.c: ...here.
(mixed_string_buffer_alloc): Rename from init_mixed_string_buffer.
(mixed_string_buffer_append_to_curr_buffer): Rename from
mixed_string_buffer_append_byte.
(mixed_string_buffer_append_to_utf8_buffer): Rename from
mixed_string_buffer_append_unicode.
(mixed_string_buffer_grow_utf8_buffer): Rename from
mixed_string_buffer_append_unicode_grow.
(mixed_string_buffer_append_char): Split from
mixed_string_buffer_append.
(mixed_string_buffer_append_unicode): Split from
mixed_string_buffer_append.
(mixed_string_buffer_done): New function merging
mixed_string_buffer_result and free_mixed_string_buffer.
* xgettext.h (mixed_string_buffer): New struct moved from
x-python.c; add logical_file_name and line_number fields.
(mixed_string_buffer_alloc): New function declaration.
(mixed_string_buffer_append_char): New function declaration.
(mixed_string_buffer_append_unicode): New function declaration.
(mixed_string_buffer_done): New function declaration.
* x-javascript.c (init_mixed_string_buffer)
(mixed_string_buffer_append_byte)
(mixed_string_buffer_append_unicode_grow)
(mixed_string_buffer_append_unicode)
(mixed_string_buffer_flush_utf16_surr)
(mixed_string_buffer_flush_curr_buffer)
(mixed_string_buffer_append, mixed_string_buffer_result)
(free_mixed_string_buffer): Remove.
Daiki Ueno [Thu, 1 May 2014 23:43:17 +0000 (08:43 +0900)]
Makefile.in.in: Turn {POFILES,DISTFILES}DEPS into yes/no options
Preserve the previous behavior even if a user forgot to update
Makevars, after calling autopoint.
* Makevars (PO_DEPENDS_ON_POT): Rename from POFILESDEPS and turn
it into a yes/no option.
(DIST_DEPENDS_ON_POT): Rename from DISTFILESDEPS and turn it into
a yes/no option.
Daiki Ueno [Thu, 1 May 2014 09:26:33 +0000 (18:26 +0900)]
Makefile.in.in: Add an option to claim the package as GNU/non-GNU
Reporeted by David Shea at:
<https://savannah.gnu.org/bugs/?40520>.
* Makevars (PACKAGE_GNU): New variable.
* Makefile.in.in ($(DOMAIN).pot-update): Don't search for "GNU
packagename" if $(PACKAGE_GNU) is set.
Daiki Ueno [Thu, 1 May 2014 04:39:23 +0000 (13:39 +0900)]
Makefile.in.in: Make dependencies of a PO file and 'dist' customizable
* Makevars (POFILESDEPS): New variable.
(DISTFILESDEPS): New variable.
* Makefile.in.in ($(POFILES)): Depend on $(POFILESDEPS) instead of
$(srcdir)/$(DOMAIN).pot.
(dist distdir): Run $(DISTFILEDEPS) instead of 'update-po'.
Suggested by Andreas Stricker in:
<https://lists.gnu.org/archive/html/bug-gettext/2014-04/msg00020.html>.
* configure.ac (maintainer-update-po): New recursive rule.
* update-po.sh: Remove.
* autogen.sh: Don't mention update-po.sh.
* Makefile.am (maintainer-update-po-local): New rule.
* gettext-runtime/Makefile.am (maintainer-update-po): New rule.
* gettext-runtime/man/Makefile.am (update-man1): Remove; add explicit
dependency on the executable to each .1 rule.
* gettext-tools/man/Makefile.am (update-man1): Remove; add explicit
dependency on the executable to each .1 rule.
* gettext-tools/examples/hello-c-gnome3/hello.gresource.xml: Rename
from org.gnu.gettext.examples.hello.gresource.xml.
* gettext-tools/examples/hello-c-gnome3/hello-gschema.xml: Rename
from org.gnu.gettext.examples.hello.gschema.xml.
* gettext-tools/examples/hello-c-gnome3/po/POTFILES.in: Adjust the
file name change.
* gettext-tools/examples/hello-c-gnome3/po/Makefile.am: Adjust the
file name change.
* gettext-tools/examples/Makefile.am: Adjust the file name change.
* gettext-tools/examples/po/Makefile.am: Adjust the file name change.
* gettext-runtime/intl/plural.y: Don't use removed YYLEX_PARAM and
YYPARSE_PARAM macros; replace deprecated %pure_parser with
'%define api.pure full'; adjust yylex/yyerror arglist.
* gettext-runtime/intl/plural-exp.h (PLURAL_PARSE): Use explicit type
'struct parse_args *arg' for ARG.
autopoint: Unset variables known to interfere with common tools
Reported by Jan Cholasta at:
<https://bugzilla.redhat.com/show_bug.cgi?id=801374>.
* autopoint.in: Unset CDPATH, CLICOLOR_FORCE, and GREP_OPTIONS.
* gettextize.in: Unset CLICOLOR_FORCE and GREP_OPTIONS.
2013-04-28 Peter Rosin <peda@lysator.liu.se>
libtool: break all the way out when a good nm is found
* m4/libtool.m4 (LT_PATH_NM): Break all the way out on a good
match.
Reported by Benjamin Gilbert at:
<https://savannah.gnu.org/bugs/?41203>
With recent libtool, this patch did nothing but fixing the output
message of configure.
* m4/libtool.m4: Remove the special handling of NM detection when
cross-compiling mingw32 on cygwin.
examples: Quote shell variables in hello-java*/configure
When running from xsmallpot.sh, embedded shell-script snippets are
stripped off from configure.ac and some variables are not set.
Make sure to quote them to avoid error.
* hello-java/configure.ac: Quote $BUILDJAVA.
* hello-java-awt/configure.ac: Quote $BUILDJAVAEXE and $BUILDJAVA.
* hello-java-qtjambi/configure.ac: Likewise.
* hello-java-swing/configure.ac: Likewise.
autogen.sh: Use included gettext-tools for bootstrap
To regenerate POT files, autogen.sh had an implicit dependency on
gettext-tools installed on system. This prohibited to use any new
features in our examples. Let autogen.sh use included version of
gettext-tools, by prepending $builddir to the PATH.
examples: Don't error out from configure in hello-c-gnome3
The configure script shouldn't fail even if there is a fatal
error, to allow the toplevel autogen.sh to regenerate POT files.
* hello-c-gnome3/configure.ac: Don't error out, but warn user.