Bruno Haible [Sun, 20 Jun 2021 01:43:54 +0000 (03:43 +0200)]
intl: Assume strtoul exists.
* gettext-runtime/intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Assume
HAVE_STRTOUL to be 1.
* gettext-runtime/m4/intl.m4 (gt_INTL_SUBDIR_CORE): Don't test for strtoul.
Bruno Haible [Sun, 20 Jun 2021 01:42:49 +0000 (03:42 +0200)]
build: Add a separate configure.ac in gettext-runtime/intl/.
* autogen.sh (GNULIB_MODULES_RUNTIME_OTHER): Remove bison. Instead, copy
bison.m4 explicitly.
Generate configure file also in gettext-runtime/intl/.
Do automake invocations top-down, not bottom-up.
* gettext-runtime/intl/Makefile.am (ACLOCAL_AMFLAGS, SUBDIRS): New variables.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Allow 'here' as INTLSYMBOL
argument.
* gettext-runtime/intl/configure.ac: New file, based on
gettext-runtime/configure.ac.
* gettext-runtime/intl/AUTHORS: New file.
* gettext-runtime/intl/NEWS: New file.
* gettext-runtime/intl/README: New file.
* gettext-runtime/intl/ABOUT-NLS: New file, copied from
gettext-runtime/ABOUT-NLS.
* gettext-runtime/intl/INSTALL: New file, copied from gettext-runtime/INSTALL.
* gettext-runtime/configure.ac: Define WINDRES. Pass third argument to
AM_GNU_GETTEXT. Remove conditionals USE_INCLUDED_LIBINTL,
BUILD_INCLUDED_LIBINTL, PRELOADABLE_LIBINTL. Invoke AC_CONFIG_SUBDIRS([intl]).
Don't create intl/Makefile from here.
* gettext-tools/configure.ac: Define WINDRES. Redefine __libc_lock_*, for use
in localealias.c. Invoke gt_GLIBC2.
Bruno Haible [Tue, 6 Apr 2021 23:37:51 +0000 (01:37 +0200)]
libtextstyle: Fix the set of exported symbols on Alpine Linux.
* libtextstyle/build-aux/join-v-1: New file, from GNU libunistring.
* libtextstyle/Makefile.am (EXTRA_DIST): Add it.
* libtextstyle/lib/Makefile.am (config.h): Use it instead of 'join -v 1'.
Bruno Haible [Sun, 4 Apr 2021 17:23:47 +0000 (19:23 +0200)]
msgcat: Handle protected file names with spaces.
* gettext-tools/src/msgl-cat.c: Include msgl-ofn.h.
(catenate_msgdomain_list): Handle references that contain file names with
spaces.
* gettext-tools/tests/msgcat-22: New file, based on
gettext-tools/tests/msgconv-8.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 4 Apr 2021 16:26:57 +0000 (18:26 +0200)]
msgconv: Handle protected file names with spaces.
* gettext-tools/src/po-charset.h (po_lex_isolate_start, po_lex_isolate_end): New
declarations.
* gettext-tools/src/po-charset.c (po_lex_isolate_start, po_lex_isolate_end): New
variables.
(po_lex_charset_init, po_lex_charset_set, po_lex_charset_close): Initialize
them.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export also po_lex_isolate_start,
po_lex_isolate_end.
* gettext-tools/src/read-catalog-abstract.c: Include <stdbool.h>, po-charset.h.
(po_parse_comment_filepos): Parse the syntax of file names surrounded by control
characters.
* gettext-tools/src/msgl-iconv.c: Include msgl-ofn.h.
(iconv_msgdomain_list): Signal error if the target encoding does not contain the
control characters needed for escaping file names with spaces.
* gettext-tools/tests/msgconv-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 4 Apr 2021 14:19:11 +0000 (16:19 +0200)]
xgettext: Protect file names with spaces through Unicode U+2068, U+2069.
* gettext-tools/src/pos.h: Include <stdbool.h>.
(pos_filename_has_spaces): New declaration.
* gettext-tools/src/pos.c: New file.
* gettext-tools/src/msgl-ofn.h: New file.
* gettext-tools/src/msgl-ofn.c: New file.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add msgl-ofn.h.
(COMMON_SOURCE): Add pos.c.
(libgettextsrc_la_SOURCES): Add msgl-ofn.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise.
* gettext-tools/src/write-catalog.h (struct catalog_output_format): Add field
requires_utf8_for_filenames_with_spaces.
* gettext-tools/src/xgettext.c: Include pos.h, msgl-ofn.h.
(finalize_header): Convert the message domain to UTF-8 also when some message
has file names with spaces.
* gettext-tools/src/write-po.h (message_print_comment_filepos): Add charset
parameter.
* gettext-tools/src/write-po.c: Include pos.h.
(message_print_comment_filepos): Add charset parameter. If a file name has
spaces, enclose it in U+2068 and U+2069 characters.
(message_print, message_print_obsolete, output_format_po): Update.
* gettext-tools/src/write-properties.c (write_message,
output_format_properties): Update.
* gettext-tools/src/write-stringtable.c (output_format_stringtable): Update.
* gettext-tools/tests/xgettext-17: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 28 Feb 2021 23:14:46 +0000 (00:14 +0100)]
Update DEPENDENCIES.
* DEPENDENCIES: Update info regarding libiconv. List pre-built package names.
Add awk as a normal dependency of a package with an Autoconf-generated configure
file.
* libtextstyle/DEPENDENCIES: Likewise.
Bruno Haible [Thu, 7 Jan 2021 22:15:05 +0000 (23:15 +0100)]
Update after gnulib changed.
* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Test
gt_localename_enhances_locale_funcs instead of gt_nameless_locales. Set
ENHANCE_LOCALE_FUNCS, not HAVE_NAMELESS_LOCALES.
* gettext-runtime/intl/Makefile.am (libgnuintl.h, libintl.h): Substitute
ENHANCE_LOCALE_FUNCS, not HAVE_NAMELESS_LOCALES.
* gettext-runtime/intl/libgnuintl.in.h: Test ENHANCE_LOCALE_FUNCS, not
HAVE_NAMELESS_LOCALES.
* gettext-runtime/intl/localename.c: Update from gnulib.
* gettext-runtime/m4/iconv.m4: Likewise.
Bruno Haible [Mon, 28 Dec 2020 13:05:05 +0000 (14:05 +0100)]
Update after gnulib changed: Fix link errors on native Windows.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC, GNULIB_MODULES_LIBGETTEXTPO): Add
strdup-posix.
Avoid the *-list-tests, since they reference a variable, leading to a problem
with --enable-shared.
* gettext-tools/libgettextpo/Makefile.am (config.h): Undefine GNULIB_GETCWD and
REPLACE_FCHDIR that are defined in the parent config.h.
Bruno Haible [Mon, 14 Dec 2020 22:31:41 +0000 (23:31 +0100)]
libtextstyle: Add is_instance_of_* predicates.
* libtextstyle/gnulib-local/lib/fd-ostream.oo.h (is_instance_of_fd_ostream): New
declaration.
* libtextstyle/gnulib-local/lib/fd-ostream.oo.c (is_instance_of_fd_ostream): New
function.
* libtextstyle/gnulib-local/lib/file-ostream.oo.h (is_instance_of_file_ostream):
New declaration.
* libtextstyle/gnulib-local/lib/file-ostream.oo.c (is_instance_of_file_ostream):
New function.
* libtextstyle/gnulib-local/lib/html-ostream.oo.h (is_instance_of_html_ostream):
New declaration.
* libtextstyle/gnulib-local/lib/html-ostream.oo.c (is_instance_of_html_ostream):
New function.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.h
(is_instance_of_html_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.c
(is_instance_of_html_styled_ostream): New function.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.h
(is_instance_of_iconv_ostream): New declaration.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c
(is_instance_of_iconv_ostream): New function.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.h
(is_instance_of_memory_ostream): New declaration.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.c
(is_instance_of_memory_ostream): New function.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.h
(is_instance_of_noop_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.c
(is_instance_of_noop_styled_ostream): New function.
* libtextstyle/gnulib-local/lib/styled-ostream.oo.h
(is_instance_of_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/styled-ostream.oo.c
(is_instance_of_styled_ostream): New function.
* libtextstyle/gnulib-local/lib/term-ostream.oo.h (is_instance_of_term_ostream):
New declaration.
* libtextstyle/gnulib-local/lib/term-ostream.oo.c (is_instance_of_term_ostream):
New function.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.h
(is_instance_of_term_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.c
(is_instance_of_term_styled_ostream): New function.
* libtextstyle/lib/textstyle.h (is_instance_of_styled_ostream,
is_instance_of_file_ostream, is_instance_of_fd_ostream,
is_instance_of_term_ostream, is_instance_of_memory_ostream,
is_instance_of_iconv_ostream, is_instance_of_html_ostream,
is_instance_of_term_styled_ostream, is_instance_of_html_styled_ostream,
is_instance_of_noop_styled_ostream): New declarations.
* libtextstyle/tests/test-instanceof.c: New file.
* libtextstyle/tests/Makefile.am: Arrange to compile it.
* libtextstyle/doc/libtextstyle.texi (The output stream hierarchy): Mention the
is_instance_of_* predicates.
* libtextstyle/NEWS: Mention the new functions.
Bruno Haible [Thu, 10 Dec 2020 16:01:43 +0000 (17:01 +0100)]
intl: Support the AIX 7 locale names.
* gettext-runtime/intl/explodename.c (_nl_find_language): Remove function.
(_nl_explode_name): Inline it here. On AIX, lowercase the language and map a
script identifier to a modifier.
* NEWS: Mention it.
Bruno Haible [Fri, 4 Dec 2020 21:49:27 +0000 (22:49 +0100)]
xgettext: Make --directory option work right with Ruby input files.
* gettext-tools/src/xgettext.c (extract_from_file_func): Add found_in_dir
argument.
(xgettext_find_file): Return also the directory that was used to find the file.
(extract_from_file): Pass the directory to the extractor.
* gettext-tools/src/x-ruby.h (extract_ruby): Add found_in_dir argument.
* gettext-tools/src/x-ruby.c (extract_ruby): Add found_in_dir argument. Pass the
logical_filename to rxgettext, and run rxgettext in the given directory.
* gettext-tools/tests/xgettext-16: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sat, 14 Nov 2020 17:55:17 +0000 (18:55 +0100)]
xgettext: Add support for gettext-like functions with wide string argument.
Reported by Érico Nogueira <ericonr@disroot.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-11/msg00013.html>.
* gettext-tools/src/x-c.c (phase5_get): Recognize also the string-literal
prefixes 'u', 'U', 'L'. Consider all types of C++ raw strings as relevant.
* gettext-tools/tests/xgettext-c-5: Add more test cases.
* gettext-tools/tests/xgettext-c-c++-1: Likewise.
* NEWS: Mention it.
Bruno Haible [Sat, 14 Nov 2020 13:53:19 +0000 (14:53 +0100)]
build: Fix warnings emitted by autoconf-2.69d.
* gettext-tools/configure.ac: Use AC_LINK_IFELSE instead of AC_TRY_LINK. Don't
invoke AC_FUNC_VFORK.
* gettext-tools/m4/exported.m4 (gt_GLOBAL_SYMBOL_PIPE): Require LT_PATH_NM
instead of AC_PROG_NM.
* gnulib-local/m4/libxml.m4 (gl_LIBXML): Use AC_LINK_IFELSE instead of
AC_TRY_LINK. Use AC_PREPROC_IFELSE instead of AC_TRY_CPP.
* libtextstyle/configure.ac: Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER.
* libtextstyle/gnulib-local/m4/libcroco.m4 (gl_LIBCROCO): Use AC_LINK_IFELSE
instead of AC_TRY_LINK.
* libtextstyle/gnulib-local/m4/libglib.m4 (gl_LIBGLIB): Use AC_LINK_IFELSE
instead of AC_TRY_LINK. Require AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE.
* libtextstyle/gnulib-local/m4/termcap.m4 (gl_TERMCAP_BODY): Use AC_LINK_IFELSE
instead of AC_TRY_LINK.
* libtextstyle/gnulib-local/m4/terminfo.m4 (gl_TERMINFO_BODY): Use
AC_LINK_IFELSE instead of AC_TRY_LINK.
* m4/woe32-dll.m4 (gl_WOE32_DLL): Use AC_LINK_IFELSE instead of AC_TRY_LINK.
Bruno Haible [Sun, 6 Sep 2020 19:28:50 +0000 (21:28 +0200)]
Fix matching of languages in the LINGUAS environment variable.
Setting LINGUAS e.g. to "frs" should not cause fr.mo to get installed,
because Frisian is not a variant of French.
Reported by <arfrever.fta@gmail.com> in <https://savannah.gnu.org/bugs/?59062>.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS, AM_POSTPROCESS_PO_MAKEFILE): Don't
consider $desiredlang a variant of $presentlang unless it has the syntax of a
variant.