]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
2 years agointl: Avoid compiler warning from previous commit.
Bruno Haible [Sat, 30 Sep 2023 19:09:28 +0000 (21:09 +0200)] 
intl: Avoid compiler warning from previous commit.

* gettext-runtime/intl/localealias.c (__libc_localealias_freemem): Don't define
outside of _LIBC.

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 19:07:15 +0000 (21:07 +0200)] 
intl: Merge from glibc.

Apply commit
2022-12-27  Adhemerval Zanella Netto  <adhemerval.zanella@linaro.org>
Move libc_freeres_ptrs and libc_subfreeres to hidden/weak functions

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 19:01:15 +0000 (21:01 +0200)] 
intl: Merge from glibc.

Apply commit
2023-02-03  Wilco Dijkstra  <wilco.dijkstra@arm.com>
Replace rawmemchr (s, '\0') with strchr

2 years agointl: Fix portability problem in previous commit.
Bruno Haible [Sat, 30 Sep 2023 18:59:24 +0000 (20:59 +0200)] 
intl: Fix portability problem in previous commit.

* gettext-runtime/intl/localealias.c (read_alias_file): Use
"#pragma GCC diagnostic ..." only with new enough GCC versions.

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:54:00 +0000 (20:54 +0200)] 
intl: Merge from glibc.

Apply commit
2022-01-25  Martin Sebor  <msebor@redhat.com>
intl: Avoid -Wuse-after-free [BZ #26779]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:49:13 +0000 (20:49 +0200)] 
intl: Merge from glibc.

Apply commit
2021-12-12  Andrea Monaco  <andrea.monaco@autistici.org>
intl/plural.y: Avoid conflicting declarations of yyerror and yylex

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:46:04 +0000 (20:46 +0200)] 
intl: Merge from glibc.

Apply commit
2021-03-02  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Use 64 bit time_t stat internally

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:44:18 +0000 (20:44 +0200)] 
intl: Merge from glibc.

Apply commit
2020-09-25  Arjun Shankar  <arjun@redhat.com>
intl: Handle translation output codesets with suffixes [BZ #26383]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:42:50 +0000 (20:42 +0200)] 
intl: Merge from glibc.

Apply commit
2020-07-15  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Remove internal usage of extensible stat functions

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:41:37 +0000 (20:41 +0200)] 
intl: Merge from glibc.

Apply commit
2020-07-07  Arjun Shankar  <arjun@redhat.com>
Rewrite iconv option parsing [BZ #19519]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:38:29 +0000 (20:38 +0200)] 
intl: Merge from glibc.

Apply commit
2019-09-05  Florian Weimer  <fweimer@redhat.com>
locale: Avoid zero-length array in _nl_category_names [BZ #24962]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:35:21 +0000 (20:35 +0200)] 
intl: Merge from glibc.

Apply commit
2018-02-15  Joseph Myers  <joseph@codesourcery.com>
Fix -Os feof_unlocked linknamespace, localplt issues (bug 15105, bug 19463).

2 years agointl: Fix compilation error from previous commit.
Bruno Haible [Sat, 30 Sep 2023 19:44:26 +0000 (21:44 +0200)] 
intl: Fix compilation error from previous commit.

* gettext-runtime/intl/hash-string.h (attribute_hidden): Add fallback
definition.

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:33:06 +0000 (20:33 +0200)] 
intl: Merge from glibc.

Apply commit
2017-10-01  H.J. Lu  <hjl.tools@gmail.com>
Hide internal __hash_string function [BZ #18822]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:31:37 +0000 (20:31 +0200)] 
intl: Merge from glibc.

Apply commit
2017-10-01  H.J. Lu  <hjl.tools@gmail.com>
Hide internal __gettextparse function [BZ #18822]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:29:30 +0000 (20:29 +0200)] 
intl: Merge from glibc.

Apply commit
2017-10-01  H.J. Lu  <hjl.tools@gmail.com>
Mark internal intl functions with attribute_hidden [BZ #18822]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:28:03 +0000 (20:28 +0200)] 
intl: Merge from glibc.

Apply commit
2017-10-01  H.J. Lu  <hjl.tools@gmail.com>
Mark internal functions with attribute_hidden [BZ #18822]

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:21:52 +0000 (20:21 +0200)] 
intl: Merge from glibc.

Apply commit
2017-08-15  Florian Weimer  <fweimer@redhat.com>
iconv, intl, locale, wcsmbs: Remove internal_function

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:13:12 +0000 (20:13 +0200)] 
intl: Merge from glibc.

Apply commit
2017-07-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Consolidate non cancellable close call

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:11:13 +0000 (20:11 +0200)] 
intl: Merge from glibc.

Apply commit
2017-07-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Consolidate non cancellable read call

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:09:57 +0000 (20:09 +0200)] 
intl: Merge from glibc.

Apply commit
2017-07-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Consolidate non cancellable open call

2 years agointl: Fix compilation error from previous commit.
Bruno Haible [Sat, 30 Sep 2023 19:53:59 +0000 (21:53 +0200)] 
intl: Fix compilation error from previous commit.

* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): Use free() instead of
freea().

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 18:07:33 +0000 (20:07 +0200)] 
intl: Merge from glibc.

Apply commit
2017-06-21  Florian Weimer  <fweimer@redhat.com>
_nl_load_domain: Use calloc instead of alloca

2 years agointl: Remove use of alloca() for wdirname handling.
Bruno Haible [Sat, 30 Sep 2023 18:03:47 +0000 (20:03 +0200)] 
intl: Remove use of alloca() for wdirname handling.

* autogen.sh (GNULIB_MODULES_LIBINTL): Add wgetcwd-lgpl.
* gettext-runtime/intl/dcigettext.c: Include <wchar.h>.
(DCIGETTEXT): Allocate resolved_wdirname through malloc() instead of through
alloca().

2 years agointl: Fix compilation error from previous commit.
Bruno Haible [Sat, 30 Sep 2023 20:30:45 +0000 (22:30 +0200)] 
intl: Fix compilation error from previous commit.

* gettext-runtime/intl/dcigettext.c (DCIGETTEXT) [!_LIBC]: Compute the resolved
dirname without using __asprintf.

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 13:08:26 +0000 (15:08 +0200)] 
intl: Merge from glibc.

Apply commits
2017-06-21  Florian Weimer  <fweimer@redhat.com>
DCIGETTEXT: Use getcwd, asprintf to construct absolute pathname
and
2018-12-21  Florian Weimer  <fweimer@redhat.com>
intl: Do not return NULL on asprintf failure in gettext [BZ #24018]

2 years agointl: Use gnulib module 'getcwd-lgpl'.
Bruno Haible [Sat, 30 Sep 2023 13:17:14 +0000 (15:17 +0200)] 
intl: Use gnulib module 'getcwd-lgpl'.

* autogen.sh (GNULIB_MODULES_LIBINTL): Add getcwd-lgpl.

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 12:54:51 +0000 (14:54 +0200)] 
intl: Merge from glibc.

Apply commit
2017-06-19  Florian Weimer  <fweimer@redhat.com>
DCIGETTEXT: Do not make copy of localename

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 12:52:20 +0000 (14:52 +0200)] 
intl: Merge from glibc.

Apply commit
2017-03-13  Wilco Dijkstra  <wdijkstr@arm.com>
Remove the str(n)dup inlines from string/bits/string2.h...

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 12:43:28 +0000 (14:43 +0200)] 
intl: Merge from glibc.

Apply commit
2016-09-18  Samuel Thibault  <samuel.thibault@ens-lyon.org>
hurd: fix pathconf visibility

2 years agointl: Merge from glibc.
Bruno Haible [Sat, 30 Sep 2023 12:38:49 +0000 (14:38 +0200)] 
intl: Merge from glibc.

Apply commit
2015-09-08  Joseph Myers  <joseph@codesourcery.com>
Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912).

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sat, 30 Sep 2023 22:35:18 +0000 (00:35 +0200)] 
Update to the newest gnulib.

2 years agoAllow different --libtool options from multiple gnulib-tool invocations.
Bruno Haible [Fri, 29 Sep 2023 21:05:16 +0000 (23:05 +0200)] 
Allow different --libtool options from multiple gnulib-tool invocations.

* gnulib-local/modules/libxml (Makefile.am): Don't test GL_COND_LIBTOOL, since
gnulib-tool already eliminates lib_LDFLAGS augmentations for non-libtool
libraries.
* libtextstyle/gnulib-local/modules/libcroco (Makefile.am): Likewise.
* libtextstyle/gnulib-local/modules/libglib (Makefile.am): Likewise.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Fri, 29 Sep 2023 21:07:13 +0000 (23:07 +0200)] 
Update to the newest gnulib.

2 years agointl: Assume ISO C 99 or newer.
Bruno Haible [Fri, 22 Sep 2023 07:48:37 +0000 (09:48 +0200)] 
intl: Assume ISO C 99 or newer.

* gettext-runtime/intl/plural-exp.h (HAVE_STRUCT_INITIALIZER): Remove macro.
(GERMANIC_PLURAL): Assume HAVE_STRUCT_INITIALIZER is 1.
* gettext-runtime/intl/plural-exp.c: Assume HAVE_STRUCT_INITIALIZER is 1.
(init_germanic_plural): Remove function.
(INIT_GERMANIC_PLURAL): Remove macro.
(EXTRACT_PLURAL_EXPRESSION): Update.

2 years agoFix intl-7 test failure on Solaris 11.
Bruno Haible [Wed, 20 Sep 2023 09:03:35 +0000 (11:03 +0200)] 
Fix intl-7 test failure on Solaris 11.

* gettext-tools/tests/init.cfg (prepare_locale_): Preserve the existing contents
of "$2".
* gettext-tools/tests/intl-7: While calling prepare_locale_, ensure that fr_FR
has higher priority than fr.

2 years agoMerge from 0.22.x branch: Prepare for 0.22.2 release.
Bruno Haible [Tue, 19 Sep 2023 22:14:38 +0000 (00:14 +0200)] 
Merge from 0.22.x branch: Prepare for 0.22.2 release.

* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.22.2.
* gettext-tools/misc/autopoint.in: Allow version 0.22.2.

2 years agoMerge from 0.22.x branch: Update NEWS file for release 0.22.2.
Bruno Haible [Tue, 19 Sep 2023 22:13:12 +0000 (00:13 +0200)] 
Merge from 0.22.x branch: Update NEWS file for release 0.22.2.

2 years agoMerge from 0.22.x branch: Prepare for 0.22.1 release.
Bruno Haible [Mon, 18 Sep 2023 22:18:37 +0000 (00:18 +0200)] 
Merge from 0.22.x branch: Prepare for 0.22.1 release.

* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 12:0:4.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:1:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:10:5.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.22.1.
* gettext-tools/misc/autopoint.in: Allow version 0.22.1.

2 years agoMerge from 0.22.x branch: Update translations from TP.
Bruno Haible [Mon, 18 Sep 2023 21:28:54 +0000 (23:28 +0200)] 
Merge from 0.22.x branch: Update translations from TP.

2 years agoMerge from 0.22.x branch: Update NEWS file for release 0.22.1.
Bruno Haible [Tue, 19 Sep 2023 08:25:20 +0000 (10:25 +0200)] 
Merge from 0.22.x branch: Update NEWS file for release 0.22.1.

2 years agoUpdate after gnulib changed.
Bruno Haible [Tue, 19 Sep 2023 08:22:55 +0000 (10:22 +0200)] 
Update after gnulib changed.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Tue, 19 Sep 2023 08:18:10 +0000 (10:18 +0200)] 
Update to the newest gnulib.

2 years agolibgettextpo: Fix compilation error on FreeBSD (regression 2023-09-16).
Bruno Haible [Mon, 18 Sep 2023 19:28:25 +0000 (21:28 +0200)] 
libgettextpo: Fix compilation error on FreeBSD (regression 2023-09-16).

* gettext-tools/libgettextpo/gettext-po.c (po_file_write, po_error_logger,
po_message_check_format): Use orig_error, orig_error_at_line instead of the
error, error_at_line symbols.

2 years agoxgettext: Perl: Avoid unnecessary nesting_depth growth.
Bruno Haible [Mon, 18 Sep 2023 18:58:32 +0000 (20:58 +0200)] 
xgettext: Perl: Avoid unnecessary nesting_depth growth.

* gettext-tools/src/x-perl.c: Ensure the top-level extract_balanced call returns
when a closing paren or bracket is seen.
(token_type_r_any): New enum item.
(prefer_regexp_over_division, extract_balanced): Handle it.
(extract_perl): Pass token_type_r_any instead of token_type_rbrace.

2 years agoxgettext: Perl: Add test against unbounded nesting_depth growth.
Bruno Haible [Mon, 18 Sep 2023 18:26:48 +0000 (20:26 +0200)] 
xgettext: Perl: Add test against unbounded nesting_depth growth.

Reported by Gavin D. Smith <gavinsmith0123@gmail.com> at
<https://lists.gnu.org/archive/html/bug-gettext/2023-07/msg00008.html>
and <https://savannah.gnu.org/bugs/?64552>.

* gettext-tools/tests/xgettext-perl-stackovfl-5: New file.
* gettext-tools/tests/testdata/xg-pl-so-5.pl: New file, taken from
https://git.savannah.gnu.org/gitweb/?p=texinfo.git;a=blob;f=tp/Texinfo/Convert/HTML.pm;hb=c8d9edd94d9b1a3e675e811208d9e66eaf9a7daa
* gettext-tools/tests/Makefile.am (TESTS): Add xgettext-perl-stackovfl-5.
(EXTRA_DIST): Add testdata/xg-pl-so-5.pl.

2 years agoxgettext: Perl: Avoid unbounded nesting_depth growth, part 4.
Bruno Haible [Mon, 18 Sep 2023 18:04:47 +0000 (20:04 +0200)] 
xgettext: Perl: Avoid unbounded nesting_depth growth, part 4.

* gettext-tools/src/x-perl.c: Improve parsing of array dereferences.
(extract_variable): After parsing a braced {variable_name}, increment
varbody_length, so as to not parse the following character. If this character
is a closing parenthesis, is would disturb the enclosing extract_balanced call.

Test case:
==========================================
sub in_multi_expanded($)
{
  if (@{$self}) {
  }
}
==========================================

2 years agoxgettext: Perl: Avoid unbounded nesting_depth growth, part 3.
Bruno Haible [Mon, 18 Sep 2023 17:26:54 +0000 (19:26 +0200)] 
xgettext: Perl: Avoid unbounded nesting_depth growth, part 3.

* gettext-tools/src/x-perl.c: Return from extract_balanced when a subroutine's
definition terminates and that subroutine was defined after a declaration that
ended with a semicolon.
(extract_perl): Pass semicolon_delim=true.

Test case:
==========================================
my %a = 4;

sub b
{
}
==========================================

2 years agoxgettext: Perl: Avoid unbounded nesting_depth growth, part 2.
Bruno Haible [Mon, 18 Sep 2023 17:02:01 +0000 (19:02 +0200)] 
xgettext: Perl: Avoid unbounded nesting_depth growth, part 2.

* gettext-tools/src/x-perl.c: Return from extract_balanced when a subroutine's
definition terminates.
(extract_balanced): Test whether the first token is 'sub'. If so, don't use
the usual symbol parsing and return when a token_type_lbrace was seen.

Test cases:
==========================================
sub import {
}
==========================================
sub import {
  if (!$module_loaded) {
    Texinfo::XSLoader::override("", "");
    Texinfo::XSLoader::override("", "");
    $module_loaded = 1;
  }
  goto &Exporter::import;
}
==========================================

2 years agoxgettext: Perl: Avoid unbounded nesting_depth growth, part 1.
Bruno Haible [Mon, 18 Sep 2023 14:18:23 +0000 (16:18 +0200)] 
xgettext: Perl: Avoid unbounded nesting_depth growth, part 1.

* gettext-tools/src/x-perl.c: Return from extract_balanced when a semicolon
outside parentheses is seen.
(extract_balanced): Add parameters semicolon_delim, eat_semicolon_delim.
All callers changed.

Test case:
=================
use strict;
=================

2 years agoxgettext: Perl: Add ability to debug the nesting_depth.
Bruno Haible [Sun, 17 Sep 2023 15:37:25 +0000 (17:37 +0200)] 
xgettext: Perl: Add ability to debug the nesting_depth.

* gettext-tools/src/x-perl.c (DEBUG_NESTING_DEPTH): New macro.
(extract_balanced): Use it.

2 years agoxgettext: Perl: Refactor.
Bruno Haible [Sun, 17 Sep 2023 15:31:23 +0000 (17:31 +0200)] 
xgettext: Perl: Refactor.

* gettext-tools/src/x-perl.c: Reindent all '#if DEBUG_PERL' lines.

2 years agobuild: Fix "make install" failure on Android.
Bruno Haible [Sun, 17 Sep 2023 19:11:09 +0000 (21:11 +0200)] 
build: Fix "make install" failure on Android.

This patch fixes two problems with "make install" on Android:

1) On this platform, libtool is configured to relink libraries during
"make install".
This leads to a problem during the installation of libgettextsrc: The relink
command that libtool emits has the form

  $CC -shared -fPIC -DPIC .libs/*.o -L$(libdir) ... -lgettextlib ... \
      -o .libs/libgettextsrc-@VERSION@.soT

The option -lgettextlib resolves to $(libdir)/libgettextlib.a, not to
$(libdir)/libgettextlib-@VERSION@.so.
Thus the linker attempts to include many object files from libgettextlib.a
into libgettextsrc-@VERSION@.soT, but some of these reference global variables
in a non-PIC way, and the linker thus complains

  ld.lld: error: relocation R_ARM_REL32 cannot be used against symbol 'program_name'; recompile with -fPIC

2) The installed executables don't have a RUNPATH property that points to the
directory that contains the shared libraries. Thus these executables don't run.

Reported at <https://savannah.gnu.org/patch/index.php?10393>.

* m4/libtool.m4: On Android, fix library_names_spec and
hardcode_libdir_flag_spec.

2 years agodoc: Document how to combine POT files.
Bruno Haible [Sun, 17 Sep 2023 13:04:07 +0000 (15:04 +0200)] 
doc: Document how to combine POT files.

Triggered by <https://savannah.gnu.org/bugs/index.php?64490>.

* gettext-tools/doc/gettext.texi (Combining POTs): New section.

2 years agoxgettext: Avoid a warning 'Charset "CHARSET" is not a portable encoding name'.
Bruno Haible [Sun, 17 Sep 2023 09:54:45 +0000 (11:54 +0200)] 
xgettext: Avoid a warning 'Charset "CHARSET" is not a portable encoding name'.

* gettext-tools/src/po-charset.h (po_lex_charset_set): Add is_pot_role
parameter.
* gettext-tools/src/po-charset.c (po_lex_charset_set): Likewise.
* gettext-tools/src/po-lex.h (gram_pot_role): New declaration.
(lex_start): Add is_pot_role parameter.
* gettext-tools/src/po-lex.c (gram_pot_role): New variable.
(lex_start): Add is_pot_role parameter.
(lex_end): Update.
* gettext-tools/src/po-gram-gen.y (do_callback_message): Pass gram_pot_role to
po_lex_charset_set.
* gettext-tools/src/read-catalog-abstract.h (struct catalog_input_format): Add
is_pot_role parameter to the 'parse' member.
(catalog_reader_parse): Add is_pot_role parameter.
* gettext-tools/src/read-po.c (po_parse): Add is_pot_role parameter.
* gettext-tools/src/read-properties.c (properties_parse): Likewise.
* gettext-tools/src/read-stringtable.c (stringtable_parse): Likewise.
* gettext-tools/src/read-catalog-abstract.c (catalog_reader_parse): Add
is_pot_role parameter.
* gettext-tools/src/x-po.c (extract): Pass is_pot_role as true.
* gettext-tools/src/xgettext.c (read_exclusion_file): Likewise.
* gettext-tools/src/read-catalog.c (read_catalog_stream): Pass is_pot_role as
false.
* gettext-tools/src/msgfmt.c (read_catalog_file_msgfmt): Likewise.

2 years agoFix typo in comment.
Bruno Haible [Sun, 17 Sep 2023 09:00:54 +0000 (11:00 +0200)] 
Fix typo in comment.

* gettext-tools/src/po-lex.h (po_gram_lex): Fix typo in comment.

2 years agobuild: Install auxiliary programs in $(libexecdir), not $(libdir). Part 3.
Bruno Haible [Sun, 17 Sep 2023 08:44:23 +0000 (10:44 +0200)] 
build: Install auxiliary programs in $(libexecdir), not $(libdir). Part 3.

* PACKAGING: Update accordingly.

2 years agoxgettext: Avoid error 'present charset "CHARSET" is not a portable encoding name...
Bruno Haible [Sat, 16 Sep 2023 22:18:47 +0000 (00:18 +0200)] 
xgettext: Avoid error 'present charset "CHARSET" is not a portable encoding name' when possible.

Reported by Arsen Arsenović <arsen@aarsen.me>
at <https://savannah.gnu.org/bugs/?64490>.

This changes the behaviour back to the one from gettext 0.21.1, where this
xgettext invocation produced just a warning.

* gettext-tools/src/msgl-iconv.c (iconv_message_list_internal): Don't give an
error when a PO file has a header entry with charset=CHARSET and is entirely
ASCII.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Likewise.
* gettext-tools/tests/xgettext-combine-1: New file.
* gettext-tools/tests/xgettext-combine-2: New file.
* gettext-tools/tests/xgettext-combine-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

2 years agolibgettextpo: Fix compilation error on Android.
Bruno Haible [Sat, 16 Sep 2023 15:49:23 +0000 (17:49 +0200)] 
libgettextpo: Fix compilation error on Android.

* gettext-tools/libgettextpo/gettext-po.c: Include error.h second.
(orig_error, orig_error_at_line): New variables.
(error, error_at_line): Undefine afterwards.
(po_file_read_v2): Use these variables instead of the error, error_at_line
symbols.

2 years agoFix another misnomer.
Bruno Haible [Sat, 16 Sep 2023 10:50:44 +0000 (12:50 +0200)] 
Fix another misnomer.

* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Set BUILDING_LIBRARY instead
of BUILDING_DLL.
* gettext-runtime/intl/intl-compat.c (SHLIB_EXPORTED): Test BUILDING_LIBRARY
instead of BUILDING_DLL.
* gettext-runtime/intl/printf.c (SHLIB_EXPORTED): Likewise.
* gettext-runtime/intl/setlocale.c (SHLIB_EXPORTED): Likewise.

2 years agoFix a misnomer.
Bruno Haible [Sat, 16 Sep 2023 10:32:25 +0000 (12:32 +0200)] 
Fix a misnomer.

* gettext-runtime/configure.ac: Prefer the term "shared library", since the term
"DLL" applies only to Windows.
* gettext-runtime/intl/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
* gettext-runtime/intl/export.h (LIBINTL_SHLIB_EXPORTED): Renamed from
LIBINTL_DLL_EXPORTED. Prefer the term "shared library", since the term "DLL"
applies only to Windows.
* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Update comment.
(libgnuintl.h): Insert LIBINTL_SHLIB_EXPORTED instead of LIBINTL_DLL_EXPORTED.
* gettext-runtime/intl/gettextP.h: Use LIBGLOCALE_SHLIB_EXPORTED instead of
LIBGLOCALE_DLL_EXPORTED. Use LIBINTL_SHLIB_EXPORTED instead of
LIBINTL_DLL_EXPORTED.
* gettext-runtime/intl/loadinfo.h (LIBINTL_SHLIB_EXPORTED): Renamed from
LIBINTL_DLL_EXPORTED.
* gettext-runtime/intl/intl-compat.c (SHLIB_EXPORTED): Renamed from
DLL_EXPORTED. Prefer the term "shared library", since the term "DLL" applies
only to Windows.
* gettext-runtime/intl/printf.c (SHLIB_EXPORTED): Likewise.
* gettext-runtime/intl/setlocale.c (SHLIB_EXPORTED): Likewise.
* gettext-tools/woe32dll/export.h: Update comment.

2 years agointl: Improve support for clang.
Bruno Haible [Fri, 15 Sep 2023 22:27:42 +0000 (00:27 +0200)] 
intl: Improve support for clang.

* gettext-runtime/intl/libgnuintl.in.h (_INTL_MAY_RETURN_STRING_ARG): Use
__attribute__ also for clang.

2 years agointl: Don't export the symbol 'rpl_isnanf' on MSVC.
Bruno Haible [Fri, 15 Sep 2023 21:15:19 +0000 (23:15 +0200)] 
intl: Don't export the symbol 'rpl_isnanf' on MSVC.

* gettext-runtime/intl/configure.ac: Define rpl_isnanf to _libintl_isnanf.

2 years agointl: Don't export the symbol 'mbszero' on Windows platforms.
Bruno Haible [Fri, 15 Sep 2023 21:12:34 +0000 (23:12 +0200)] 
intl: Don't export the symbol 'mbszero' on Windows platforms.

* gettext-runtime/intl/configure.ac: Define mbszero to _libintl_mbszero.

2 years agointl: Don't export libintl_hash_string.
Bruno Haible [Fri, 15 Sep 2023 21:09:49 +0000 (23:09 +0200)] 
intl: Don't export libintl_hash_string.

* gettext-runtime/intl/hash-string.h (__hash_string): Expand to
_libintl_hash_string, not libintl_hash_string.

2 years agointl: Fix list of exported symbols (regression 2021-06-19).
Bruno Haible [Fri, 15 Sep 2023 21:06:11 +0000 (23:06 +0200)] 
intl: Fix list of exported symbols (regression 2021-06-19).

Reported by <fxcoudert@gcc.gnu.org>
and Christian Weisgerber <naddy@mips.inka.de>
in <https://savannah.gnu.org/bugs/?64323>
and <https://lists.gnu.org/archive/html/bug-gettext/2023-07/msg00005.html>.
Analyzed by Christian Weisgerber <naddy@mips.inka.de> and
Tijl Coosemans <tijl@FreeBSD.org>.

* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Set BUILDING_DLL.
* gettext-runtime/intl/intl-compat.c: Update comments.

2 years agointl: Fix a build error on Android.
Bruno Haible [Fri, 15 Sep 2023 18:54:32 +0000 (20:54 +0200)] 
intl: Fix a build error on Android.

The declaration in Android's <math.h>
  long double frexpl(long double, int*) __RENAME_LDBL(frexp, 3, 21);
has the effect that frexpl.o defines the symbol _libintl_frexp, not
_libintl_frexpl, if config.h contains
  #define frexp _libintl_frexp
  #define frexpl _libintl_frexpl

* gettext-runtime/intl/configure.ac:
If REPLACE_FREXP is 1, don't redirect frexp to _libintl_frexp.
If REPLACE_FREXPL is 1, don't redirect frexpl to _libintl_frexp.

2 years agointl: Annotate *printf functions with __attribute__ __nonnull__.
Bruno Haible [Thu, 14 Sep 2023 11:35:48 +0000 (13:35 +0200)] 
intl: Annotate *printf functions with __attribute__ __nonnull__.

* gettext-runtime/intl/libgnuintl.in.h (_INTL_ARG_NONNULL): New macro.
(fprintf, vfprintf, printf, vprintf, sprintf, vsprintf, snprintf, vsnprintf,
asprintf, vasprintf, fwprintf, vfwprintf, wprintf, vwprintf, swprintf,
vswprintf): Annotate with _INTL_ARG_NONNULL.

2 years agointl: Annotate *printf functions with __attribute__ __format__.
Bruno Haible [Thu, 14 Sep 2023 09:13:22 +0000 (11:13 +0200)] 
intl: Annotate *printf functions with __attribute__ __format__.

Reported by Pierre Ossman <ossman@cendio.se> at
<https://savannah.gnu.org/bugs/?64384>.

* gettext-runtime/intl/libgnuintl.in.h (_INTL_ATTRIBUTE_FORMAT,
_INTL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD):
New macros.
(fprintf, vfprintf, printf, vprintf, sprintf, vsprintf, snprintf, vsnprintf,
asprintf, vasprintf): Annotate with _INTL_ATTRIBUTE_FORMAT_PRINTF_STANDARD.
* gettext-runtime/intl/printf.c: Update comment.

2 years agointl: Don't compile relocatable.c any more.
Bruno Haible [Wed, 13 Sep 2023 21:11:52 +0000 (23:11 +0200)] 
intl: Don't compile relocatable.c any more.

The library does not need relocatable.h any more since today.

As a side effect, libintl.la gets installed again and "make uninstall" erases
the installed libintl.{a,so} again (regressions from 2021-06-20).
Reported by David Bohman <debohman@gmail.com> at
<https://savannah.gnu.org/bugs/?64536>.

* autogen.sh (GNULIB_MODULES_LIBINTL): Remove relocatable-lib-lgpl.
* gnulib-local/modules/gettext-runtime-intl-misc (Makefile.am): Don't augment
AM_CPPFLAGS.
* gettext-runtime/intl/configure.ac: Don't set enable_relocatable.
Don't define the C symbols relocate, relocate2.
* gettext-runtime/intl/compat.c: New file.
* gettext-runtime/intl/Makefile.am: Update comments.
(LIBINTLSOURCES): Add compat.c.
(compat.lo): New rule.

2 years agointl: Use a locale.alias file only on glibc systems.
Bruno Haible [Wed, 13 Sep 2023 12:03:21 +0000 (14:03 +0200)] 
intl: Use a locale.alias file only on glibc systems.

On systems without glibc, it makes no sense if libintl supports locale name
aliases that the system's setlocale() does not support. Therefore better
disable the locale.alias processing on these platforms.

Also, stop installing locale.alias, because on systems without glibc we won't
read it any more, and on systems with glibc we need to use the preinstalled
one in /usr/share/locale/locale.alias.

* gettext-runtime/intl/localealias.c: Don't include relocatable.h.
(relocate, relocate2): Remove macros.
(LOCALE_ALIAS_PATH): Define a fallback.
(_nl_expand_alias): Simplify on systems without glibc.
(read_alias_file, extend_alias_table, alias_compare): Don't define on systems
without glibc.
* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Don't set LOCALE_ALIAS_PATH.
(EXTRA_DIST): Remove locale.alias, ref-add.sin, ref-del.sin.
(MOSTLYCLEANFILES): Remove ref-add.sed, red-del.sed.
(ref-add.sed, ref-del.sed, install-data-aliasfile, installdirs-aliasfile,
uninstall-aliasfile): Remove rules.
* gettext-runtime/intl/locale.alias: Remove file.
* gettext-runtime/intl/ref-add.sin: Remove file.
* gettext-runtime/intl/ref-del.sin: Remove file.
* gettext-tools/src/Makefile.am (aliaspath): Remove variable.
(DEFS): Don't set LOCALE_ALIAS_PATH.
* PACKAGING: Don't mention locale.alias.

2 years agointl: Clarify the role of locale.alias.
Bruno Haible [Wed, 13 Sep 2023 11:06:10 +0000 (13:06 +0200)] 
intl: Clarify the role of locale.alias.

This is part of the patch
<https://sourceware.org/pipermail/libc-alpha/2023-September/151524.html>.

* gettext-runtime/intl/localealias.c: Explain the form and the purpose of the
locale.alias file.

2 years agointl: Fix build failure with "make -j".
Bruno Haible [Tue, 12 Sep 2023 09:33:41 +0000 (11:33 +0200)] 
intl: Fix build failure with "make -j".

Reported by Christian Weisgerber <naddy@mips.inka.de> at
<https://lists.gnu.org/archive/html/bug-gettext/2023-09/msg00005.html>.

* gettext-runtime/intl/Makefile.am (langprefs.lo, log.lo): Depend on gettextP.h
and its subordinate includes.

2 years agointl: Treat C.UTF-8 locale like C locale.
Bruno Haible [Sun, 10 Sep 2023 18:33:09 +0000 (20:33 +0200)] 
intl: Treat C.UTF-8 locale like C locale.

The wiki page https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
says that "Setting LC_ALL=C.UTF-8 will ignore LANGUAGE just like it
does with LC_ALL=C." This is now implemented in glibc. Implement it
for other platforms as well.

* gettext-runtime/intl/dcigettext.c (DCIGETTEXT, guess_category_value): Treat
C.<encoding> locale like the C locale.
* gettext-runtime/NEWS: Mention it.
* NEWS: Likewise.
* gettext-tools/tests/intl-0: New file, based on gettext-tools/tests/intl-1.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoSync woe32dll/export.h with GNU libiconv and GNU libunistring.
Bruno Haible [Thu, 7 Sep 2023 11:46:06 +0000 (13:46 +0200)] 
Sync woe32dll/export.h with GNU libiconv and GNU libunistring.

* gettext-tools/woe32dll/export.h: Update comments. Correct indentation.

2 years agoUpdate after gnulib changed.
Bruno Haible [Wed, 6 Sep 2023 19:47:00 +0000 (21:47 +0200)] 
Update after gnulib changed.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Wed, 6 Sep 2023 19:41:23 +0000 (21:41 +0200)] 
Update to the newest gnulib.

2 years agoDon't export symbols from static object files on Windows.
Bruno Haible [Wed, 6 Sep 2023 19:13:25 +0000 (21:13 +0200)] 
Don't export symbols from static object files on Windows.

* gettext-tools/configure.ac (DLL_VARIABLE): Test DLL_EXPORT, not WOE32DLL.
(WOE32DLL): Don't define as a C macro.
* gettext-runtime/configure.ac: Likewise.
(DLL_VARIABLE): Drop special assumption regarding 'exit_failure'.

2 years agolibtextstyle: Don't export symbols from static MSVC .obj files.
Bruno Haible [Wed, 6 Sep 2023 18:59:36 +0000 (20:59 +0200)] 
libtextstyle: Don't export symbols from static MSVC .obj files.

* libtextstyle/lib/Makefile.am (config.h): Don't alias isatty to
libtextstyle_isatty here, before the Windows header files have been included.
* libtextstyle/gnulib-local/lib/isatty.c.diff: New file.
* libtextstyle/Makefile.am (EXTRA_DIST): Add it.

2 years agointl: Don't export symbols from static MSVC .obj files.
Bruno Haible [Wed, 6 Sep 2023 18:59:03 +0000 (20:59 +0200)] 
intl: Don't export symbols from static MSVC .obj files.

* gettext-runtime/intl/configure.ac (WOE32DLL): Set to 1 or 0, not 'yes' or
'no'. Don't define as C macro any more.
(DLL_VARIABLE): Test DLL_EXPORT, not _DLL.
* gettext-runtime/intl/export.h: Use the value of WOE32DLL at configure time.
Set LIBINTL_DLL_EXPORTED to empty on MSVC when DLL_EXPORT is not defined.
* gettext-runtime/intl/Makefile.am (libgnuintl.h): Substitute the value of
@WOE32DLL@.
* gettext-runtime/intl/intl-compat.c (DLL_EXPORTED): Set to empty on MSVC when
DLL_EXPORT is not defined.
* gettext-runtime/intl/printf.c (DLL_EXPORTED): Likewise.
* gettext-runtime/intl/setlocale.c (DLL_EXPORTED): Likewise.

2 years agoRecognize the *-*-windows* config triplets introduced on 2023-06-26.
Bruno Haible [Wed, 6 Sep 2023 15:13:26 +0000 (17:13 +0200)] 
Recognize the *-*-windows* config triplets introduced on 2023-06-26.

* libtextstyle/lib/Makefile.am: Treat windows* as equivalent to mingw*.

2 years agoRecognize the *-*-windows* config triplets introduced on 2023-06-26.
Bruno Haible [Wed, 30 Aug 2023 12:21:46 +0000 (14:21 +0200)] 
Recognize the *-*-windows* config triplets introduced on 2023-06-26.

* gettext-runtime/configure.ac: Treat windows* as equivalent to mingw*.
* gettext-runtime/intl/configure.ac: Likewise.
* gettext-runtime/libasprintf/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
* gettext-tools/m4/locale-de.m4 (gt_LOCALE_DE_UTF8): Likewise.
* libtextstyle/configure.ac: Likewise.
* m4/woe32-dll.m4 (gl_WOE32_DLL): Likewise.

2 years agomsgmerge: Deprecate option '--sort-output'.
Bruno Haible [Fri, 14 Jul 2023 16:23:06 +0000 (18:23 +0200)] 
msgmerge: Deprecate option '--sort-output'.

Reported by Ben Siemerink <gnu@mail.qoben.com> in
<https://savannah.gnu.org/bugs/?61249>.

* gettext-tools/src/msgmerge.c (main): Warn when option '--sort-output' is used.
(usage): Mark the option '--sort-output' deprecated.
* gettext-tools/doc/msgmerge.texi: Likewise.
* NEWS: Mention it.

2 years agoImprove support for GtkBuilder 4.
Bruno Haible [Fri, 14 Jul 2023 16:11:10 +0000 (18:11 +0200)] 
Improve support for GtkBuilder 4.

Reported by Stuart <stuart.a.hayhurst@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2023-07/msg00010.html>.

* gettext-tools/its/gtkbuilder.its: Recognize translatable="1" and similar as
equivalent to translatable="yes".
* NEWS: Mention it.

2 years agoUpdate the installation instructions for Windows.
Bruno Haible [Thu, 29 Jun 2023 13:19:10 +0000 (15:19 +0200)] 
Update the installation instructions for Windows.

* INSTALL.windows: Add a note about MSYS2.

2 years agobuild: Stop using the gnulib module 'gettext'. Part 2.
Bruno Haible [Fri, 23 Jun 2023 06:41:34 +0000 (08:41 +0200)] 
build: Stop using the gnulib module 'gettext'. Part 2.

* Makefile.am (distcheck-hook): Remove checks of nls.m4 and progtest.m4.

2 years agobuild: Ensure that makeinfo ≥ 6.8 checks the @menu structure.
Bruno Haible [Thu, 22 Jun 2023 23:41:41 +0000 (01:41 +0200)] 
build: Ensure that makeinfo ≥ 6.8 checks the @menu structure.

See <https://lists.gnu.org/archive/html/bug-texinfo/2023-06/msg00015.html>.

* gettext-tools/doc/Makefile.am (MAKEINFO): Add option
"-c CHECK_NORMAL_MENU_STRUCTURE=1".

2 years agoFix lang-python-* failures when a traditional French locale is present.
Bruno Haible [Mon, 19 Jun 2023 16:33:36 +0000 (18:33 +0200)] 
Fix lang-python-* failures when a traditional French locale is present.

This is caused by the new UTF-8 encoded messages in .mo files, together
with a bug in gettext.py from Python 2.7 that prohibits reencoding of the
looked-up messages at run time.

* gettext-tools/tests/lang-python-1: Instead of conditionally skipping the test
in the $LOCALE_FR_UTF8 locale, conditionally skip the test in the $LOCALE_FR
locale.
* gettext-tools/tests/lang-python-2: Likewise.

2 years agobuild: Stop using the gnulib module 'gettext'.
Bruno Haible [Mon, 19 Jun 2023 15:22:58 +0000 (17:22 +0200)] 
build: Stop using the gnulib module 'gettext'.

This avoids possible trouble due to divergences between gettext and gnulib.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Remove 'gettext'.
Avoid an error message if gettext-tools/gnulib-m4/po.m4 does not yet exist.

2 years agobuild: Silence most warnings from gcc 11.
Bruno Haible [Mon, 19 Jun 2023 13:05:34 +0000 (15:05 +0200)] 
build: Silence most warnings from gcc 11.

* m4/more-warnings.m4 (gt_MORE_WARNINGS): With gcc 11 or older, silence three
more types of warnings.

2 years agobuild: Remove redundant .m4 file.
Bruno Haible [Mon, 19 Jun 2023 11:22:19 +0000 (13:22 +0200)] 
build: Remove redundant .m4 file.

* gettext-runtime/m4/intlmacosx.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.
* Makefile.am (distcheck-hook): Don't check it.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Take it from the
gettext-runtime/gnulib-m4/ directory.

2 years agobuild: Remove redundant .m4 file.
Bruno Haible [Mon, 19 Jun 2023 10:52:46 +0000 (12:52 +0200)] 
build: Remove redundant .m4 file.

* autogen.sh (GNULIB_MODULES_LIBINTL): Add iconv.
* gettext-runtime/m4/iconv.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.
* Makefile.am (distcheck-hook): Don't check it.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Take it from the
gettext-runtime/gnulib-m4/ directory.

2 years agobuild: Move a .m4 file to where it belongs.
Bruno Haible [Mon, 19 Jun 2023 10:12:57 +0000 (12:12 +0200)] 
build: Move a .m4 file to where it belongs.

* autogen.sh: Pass '-I m4' when generating gettext-runtime/intl/configure.
* gettext-runtime/intl/m4/intdiv0.m4: Moved here from
gettext-runtime/m4/intdiv0.m4.
* gettext-runtime/intl/Makefile.am (ACLOCAL_AMFLAGS): Add '-I m4'.
(EXTRA_DIST): Add m4/intdiv0.m4.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove intdiv0.m4.

2 years agobuild: Remove redundant .m4 file.
Bruno Haible [Mon, 19 Jun 2023 10:04:40 +0000 (12:04 +0200)] 
build: Remove redundant .m4 file.

* gettext-runtime/m4/inttypes_h.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.
* Makefile.am (distcheck-hook): Don't check it.

2 years agobuild: Remove redundant .m4 file.
Bruno Haible [Mon, 19 Jun 2023 09:59:02 +0000 (11:59 +0200)] 
build: Remove redundant .m4 file.

* gettext-runtime/intl/configure.ac: Don't invoke gl_AC_HEADER_STDINT_H.
* gettext-runtime/m4/stdint_h.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.
* Makefile.am (distcheck-hook): Don't check it.

2 years agobuild: Simplify.
Bruno Haible [Mon, 19 Jun 2023 09:52:23 +0000 (11:52 +0200)] 
build: Simplify.

* gettext-runtime/intl/configure.ac: Inline the gt_INTL_SUBDIR_CORE macro.
* gettext-runtime/m4/intl.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.

2 years agobuild: Assume that <stdint.h> or <inttypes.h> defines uintmax_t.
Bruno Haible [Mon, 19 Jun 2023 09:43:49 +0000 (11:43 +0200)] 
build: Assume that <stdint.h> or <inttypes.h> defines uintmax_t.

OpenBSD has it since OpenBSD 3.9 (2006).

* gettext-runtime/m4/intl.m4 (gt_INTL_SUBDIR_CORE): Don't invoke
gl_AC_TYPE_UINTMAX_T.
* gettext-runtime/m4/uintmax_t.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.

2 years agobuild: Remove unused .m4 file.
Bruno Haible [Mon, 19 Jun 2023 09:24:31 +0000 (11:24 +0200)] 
build: Remove unused .m4 file.

* gettext-runtime/m4/intmax.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.

2 years agobuild: Remove redundant .m4 file.
Bruno Haible [Mon, 19 Jun 2023 09:21:01 +0000 (11:21 +0200)] 
build: Remove redundant .m4 file.

* gettext-runtime/m4/size_max.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.
* Makefile.am (distcheck-hook): Don't check it.

2 years agobuild: Remove redundant .m4 file.
Bruno Haible [Mon, 19 Jun 2023 08:57:15 +0000 (10:57 +0200)] 
build: Remove redundant .m4 file.

* gettext-runtime/libasprintf/configure.ac: Don't invoke gl_XSIZE.
* gettext-runtime/m4/xsize.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove it.
* Makefile.am (distcheck-hook): Don't check it.