Akim Demaille [Fri, 1 May 2020 10:40:43 +0000 (12:40 +0200)]
Solidify remapping of function names of bison-generated parsers.
* gettext-tools/src/po-gram-gen.y: Use Bison's api.prefix (introduced in Bison
2.6) instead of handling renaming by hand. New symbols would have been not
renamed.
Akim Demaille [Fri, 1 May 2020 10:40:42 +0000 (12:40 +0200)]
intl: Fix grammar conflicts instead of accepting them.
The seven conflicts are related to "a ? b : c <op> d". In all the
cases we left the S/R conflict be resolved as a shift, i.e., "a ? b
: (c <op> d)". To make this explicit, give the rule of the ternary
operator a very low precedence. In fact give it the same precedence
as "?". Now, to resolve the conflict in "a ? b : c ? d : e" be parsed
as "a ? b : (c ? d : e)", make them right-associative.
* gettext-runtime/intl/plural.y: Require Bison 3.0, to use %precedence
instead of useless associativities such as %right.
Make '?' and ':' of the same precedence, right associative.
Bruno Haible [Fri, 1 May 2020 19:35:43 +0000 (21:35 +0200)]
build: Fix VPATH build failures with old bison when the *.y files are modified.
* gettext-runtime/intl/Makefile.am (BISON): New variable.
(YACC): Use it.
(plural.c): Don't do the post-processing if a suitable version of bison was not
found.
* gettext-tools/src/Makefile.am (BISON): New variable.
(po-gram-gen.c, cldr-plural.c): Don't do the post-processing if a suitable
version of bison was not found.
Bruno Haible [Sun, 26 Apr 2020 21:51:23 +0000 (23:51 +0200)]
xgettext: Define alternate parser signature for the Ruby support.
* gettext-tools/src/xgettext.c (extract_from_stream_func): Renamed from
extractor_func.
(extract_from_file_func): New type.
(struct extractor_ty): Rename field func to extract_from_stream. New field
extract_from_file.
(main): Consider both fields.
(xgettext_find_file): New function.
(extract_from_file): Add alternative code for when the other extraction function
is defined.
(language_to_extractor): In the table, rename field func to extract_from_stream,
and add new field extract_from_file.
* gettext-tools/src/x-*.h (SCANNERS_*): Update.
Bruno Haible [Sun, 26 Apr 2020 14:48:46 +0000 (16:48 +0200)]
Add support for Ruby format strings.
* gettext-tools/src/message.h (enum format_type): Add format_ruby.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_ruby.
(NFORMATS): Increment.
* gettext-tools/src/format.h (formatstring_ruby): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add an entry for
format_ruby.
* gettext-tools/src/format-ruby.c: New file, based on
gettext-tools/src/format-python.c.
* gettext-tools/src/FILES: Mention it.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-ruby.c.
* gettext-tools/doc/gettext.texi (PO Files): Mention ruby-format.
(ruby-format): New section.
Bruno Haible [Sun, 19 Apr 2020 22:46:44 +0000 (00:46 +0200)]
intl: Support any Unicode characters in the locale dir on native Windows.
Reported at <https://savannah.gnu.org/bugs/?57714>.
* gettext-runtime/intl/libgnuintl.in.h (libintl_wbindtextdomain): New
declaration.
(wbindtextdomain): New redirect.
* gettext-runtime/intl/bindtextdom.c (set_binding_values): Accept a wdirnamep
argument. Set not only binding->dirname but also binding->wdirname.
(BINDTEXTDOMAIN, BIND_TEXTDOMAIN_CODESET): Pass NULL as wdirnamep.
(libintl_wbindtextdomain): New function.
* gettext-runtime/intl/loadinfo.h (struct loaded_l10nfile): Add a wfilename
field.
(_nl_make_l10nflist): On native Windows, accept wdirlist, wdirlist_len
parameters.
* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): On native Windows, use
_wopen() instead of open() to open a file with a name given as wchar_t[].
* gettext-runtime/intl/l10nflist.c: Include <wchar.h>.
(_nl_make_l10nflist): On native Windows, accept wdirlist, wdirlist_len
parameters. Construct abs_wfilename and use in the search for existing
'struct loaded_l10nfile' and when allocating a fresh 'struct loaded_l10nfile'.
* gettext-runtime/intl/gettextP.h (struct binding): Add a wdirname field.
(_nl_find_domain): On native Windows, accept a wdirname parameter.
* gettext-runtime/intl/finddomain.c (_nl_find_domain): On native Windows, accept
a wdirname parameter. Pass it to _nl_make_l10nflist.
* gettext-runtime/intl/dcigettext.c (DCIGETTEXT): Consider not only
binding->dirname but also binding->wdirname. On native Windows, use _wgetcwd
instead of getcwd. Pass also wdirname to _nl_find_domain.
* gettext-tools/tests/intl-6: New file, based on gettext-tools/tests/intl-1.
* gettext-tools/tests/intl-6-prg.c: New file, based on
gettext-tools/tests/intl-1-prg.c.
* gettext-tools/tests/Makefile.am (TESTS): Add intl-6.
(check_PROGRAMS): Add intl-6-prg.
(intl_6_prg_SOURCES, intl_6_prg_LDADD): New variables.
* gettext-tools/doc/gettext.texi (Ambiguities, src/Makefile,
Language Implementors, C): Document wbindtextdomain.
* gettext-runtime/NEWS: Mention the change.
* NEWS: Likewise.
Bruno Haible [Mon, 13 Apr 2020 20:41:54 +0000 (22:41 +0200)]
Merge from 0.20.x branch: examples: Use infrastructure from gettext version 0.20.2.
* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.20.2.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
Bruno Haible [Sat, 11 Apr 2020 21:00:21 +0000 (23:00 +0200)]
po: Emit a warning when creating a tarball without POT file.
* gettext-runtime/po/Makefile.in.in (dist2): Emit a warning when the POT file
does not exist.
* gettext-tools/examples/hello-*/po/Makefile.am (distdir1): Likewise.
Bruno Haible [Mon, 6 Apr 2020 21:29:56 +0000 (23:29 +0200)]
xgettext: Improve JSX support in JavaScript.
Reported by Vaclav Slavik <vaclav@slavik.io> in
<https://savannah.gnu.org/bugs/?57927>.
* gettext-tools/src/x-javascript.c (enum token_type_ty): Add some more types.
(is_after_expression): New function.
(phase5_get): Distinguish the "other" tokens in more detail. Use
'is_after_expression ()' when interpreting a '<' or '/' character.
(extract_balanced): Don't let commas in braced expressions and in XML elements
disturb the argument processing outside.
(extract_javascript): Update.
* gettext-tools/tests/xgettext-javascript-6: Enhance the test.
* NEWS: Mention the change.
Bruno Haible [Sun, 5 Apr 2020 13:08:34 +0000 (15:08 +0200)]
po, examples: In the .po -> .gmo rules, really consider the newest changes to the POT file.
Reported by Petr Ovtchenkov <ptr@void-ptr.info> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00000.html>.
Helped by Paul Smith.
* gettext-runtime/po/Makefile.in.in (.po.gmo): Write dependency on the POT file
as a target rule, since inference rules don't support prerequisites.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm
rule.
* NEWS: Mention the fix.
Bruno Haible [Mon, 24 Feb 2020 11:31:21 +0000 (12:31 +0100)]
urlget: Follow the "privacy by design" principle.
* gettext-tools/src/urlget.c (fetch): Override the User-Agent string, so as not
to reveal the program version to the server. For wget, use long options.
Dmitry V. Levin [Fri, 3 Jan 2020 12:08:20 +0000 (13:08 +0100)]
libtextstyle: Enable large files and, on Linux, 64-bit inodes support.
* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'largefile' to enable
large files support on systems where this is not the default and 64-bit
inodes in 32-bit applications on Linux.
Bruno Haible [Tue, 24 Dec 2019 16:37:04 +0000 (17:37 +0100)]
build: Fix build failures on HP-UX 11.31/hppa with cc.
* gnulib-local/lib/libxml/parser.c (struct _xmlDefAttrs): Don't use ISO C 99
syntax with this compiler.
* gettext-runtime/intl/plural-exp.h (HAVE_STRUCT_INITIALIZER): Set to 0 with
this compiler.
Bruno Haible [Tue, 24 Dec 2019 16:37:00 +0000 (17:37 +0100)]
libtextstyle: Don't erase the .sym.in file if 'sed' is not GNU sed.
* libtextstyle/lib/Makefile.am (libtextstyle.sym.in): Test the exit status of
the declared.sh command. Preserve the existing libunistring.sym if it failed.
Bruno Haible [Sun, 24 Nov 2019 23:40:08 +0000 (00:40 +0100)]
libcroco: Improve copyright headers.
The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.
* libtextstyle/gnulib-local/lib/libcroco/*: Inline the COPYRIGHT file where
applicable. Add copyright header.
* libtextstyle/gnulib-local/lib/libcroco/libcroco-config.h: Add copyright header.
Bruno Haible [Sun, 24 Nov 2019 18:57:37 +0000 (19:57 +0100)]
libxml: Improve copyright headers.
The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.
* gnulib-local/lib/libxml/*: Inline this directory's COPYING file where
applicable. Add FSF copyright header.
* gnulib-local/lib/libxml/trionan.c: Add copyright header.
Bruno Haible [Sun, 24 Nov 2019 18:53:45 +0000 (19:53 +0100)]
glib: Improve copyright headers.
The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.
Bruno Haible [Fri, 4 Oct 2019 15:59:22 +0000 (17:59 +0200)]
build: Fix the build error in gettext-tools/examples/po.
Reported by Nick Alcock <nix@esperi.org.uk>
at <https://savannah.gnu.org/bugs/?56529>.
* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): New variable.
(hello-*.pot): Use it.
($(srcdir)/../hello-*/po/$(LL).po): Likewise.
* HACKING: Remove the workaround.
Bruno Haible [Fri, 4 Oct 2019 11:20:12 +0000 (13:20 +0200)]
libxml: Simplify autoconf macro.
* gnulib-local/m4/libxml.m4 (gl_LIBXML): Don't test for dlopen and shlload.
The test for dlopen failed, because it would require linking with '-ldl'.
The test for shlload failed, because the function on HP-UX is called 'shl_load'
and it would require linking with '-ldld'.
Bruno Haible [Fri, 4 Oct 2019 09:47:18 +0000 (11:47 +0200)]
build: Don't fetch gnulib a second time in libtextstyle.
* autogen.sh: Set GNULIB_SRCDIR when invoking libtextstyle/autogen.sh.
* libtextstyle/autogen.sh: Remove all git operations. Look at the GNULIB_SRCDIR
environment variable. Ignore the GNULIB_TOOL environment variable.