]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
12 months agobuild: Make VPATH and non-VPATH builds behave the same.
Bruno Haible [Wed, 24 Jul 2024 23:55:39 +0000 (01:55 +0200)] 
build: Make VPATH and non-VPATH builds behave the same.

* gettext-tools/src/Makefile.am (AM_CPPFLAGS): Add -I option for libgrep
directory in the build dir.

12 months agoUpdate to the newest gnulib.
Bruno Haible [Wed, 24 Jul 2024 23:52:24 +0000 (01:52 +0200)] 
Update to the newest gnulib.

12 months agoUpdate after gnulib changed.
Bruno Haible [Mon, 22 Jul 2024 12:03:25 +0000 (14:03 +0200)] 
Update after gnulib changed.

12 months agoUpdate to the newest gnulib.
Bruno Haible [Mon, 22 Jul 2024 11:45:40 +0000 (13:45 +0200)] 
Update to the newest gnulib.

12 months agobuild: Support "make dist" without prior "make".
Bruno Haible [Mon, 22 Jul 2024 11:25:14 +0000 (13:25 +0200)] 
build: Support "make dist" without prior "make".

This is required by the GNU Coding Standards
<https://www.gnu.org/prep/standards/html_node/Standard-Targets.html>.

Reported by <nroycea+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00010.html>.

* Makefile.am (distdir1): New target.
* configure.ac: Apply FIX_MAKEFILE_DISTRIB on Makefile.
* gettext-runtime/Makefile.am (distdir1, gen-man1): New targets.
* gettext-runtime/configure.ac: Apply FIX_MAKEFILE_DISTRIB on Makefile.
* gettext-tools/Makefile.am (programs-for-distdir, distdir1, gen-man1,
distdir2): New targets.
* gettext-tools/configure.ac: Apply FIX_MAKEFILE_DISTRIB on Makefile.
* gettext-tools/src/Makefile.am (built-sources): New target.

12 months agobuild: Simplify.
Bruno Haible [Mon, 22 Jul 2024 10:43:16 +0000 (12:43 +0200)] 
build: Simplify.

* gettext-runtime/configure.ac: Remove FIX_MAKEFILE_DISTRIB invocation,
no longer needed since 2014-04-25.
* gettext-tools/configure.ac: Likewise.

12 months agodoc: Small updates.
Bruno Haible [Sun, 21 Jul 2024 16:24:48 +0000 (18:24 +0200)] 
doc: Small updates.

* DEPENDENCIES: Document --with-libncurses-prefix instead of
--with-ncurses-prefix, since that is what the option would be if
AC_LIB_LINKFLAGS_BODY([ncurses]) was actually in use.
* HACKING: Stop suggesting Java 7 implementations, since Java 7 support has
ended. Suggest to create 3 more locales, needed to avoid SKIPs of gnulib tests.

12 months agoxgettext: Fix some test failures on MSVC.
Bruno Haible [Sun, 21 Jul 2024 13:48:36 +0000 (15:48 +0200)] 
xgettext: Fix some test failures on MSVC.

* gettext-tools/src/locating-rule.c: Include <dirent.h> always.
(HAVE_DIR): Remove macro.
(locating_rule_list_add_from_directory): Don't test HAVE_DIR.
* gettext-tools/src/msginit.c: Include <dirent.h> always.
(HAVE_DIR): Remove macro.
(find_pot): Don't test HAVE_DIR.

12 months agolang-tcl: Avoid FAIL on native Windows.
Bruno Haible [Sun, 21 Jul 2024 10:53:46 +0000 (12:53 +0200)] 
lang-tcl: Avoid FAIL on native Windows.

* gettext-tools/tests/lang-tcl: Set the LANG variable as expected by tclsh.

12 months agoDeclare expected test failures on native Windows.
Bruno Haible [Fri, 19 Jul 2024 03:37:47 +0000 (05:37 +0200)] 
Declare expected test failures on native Windows.

* autogen.sh (GNULIB_MODULES_TOOLS_TESTS): Add test-xfail.
* gettext-tools/tests/Makefile.am (XFAIL_TESTS): New variable.

12 months agolang-perl-*: Avoid FAIL on NetBSD.
Bruno Haible [Fri, 19 Jul 2024 03:33:09 +0000 (05:33 +0200)] 
lang-perl-*: Avoid FAIL on NetBSD.

* gettext-tools/tests/lang-perl-1: On NetBSD, don't test the ISO-8859-1 locale.
* gettext-tools/tests/lang-perl-2: Likewise.

12 months agolang-clisp: Avoid FAIL on NetBSD.
Bruno Haible [Fri, 19 Jul 2024 03:28:23 +0000 (05:28 +0200)] 
lang-clisp: Avoid FAIL on NetBSD.

* gettext-tools/tests/lang-clisp: Unset CLISP_LANGUAGE, LANGUAGE instead of
setting them to empty.

12 months agolang-librep: Avoid FAIL on FreeBSD, NetBSD.
Bruno Haible [Fri, 19 Jul 2024 02:08:16 +0000 (04:08 +0200)] 
lang-librep: Avoid FAIL on FreeBSD, NetBSD.

* gettext-tools/tests/lang-librep: On FreeBSD and NetBSD, don't test the
ISO-8859-1 locale.

12 months agolang-guile: Avoid FAIL on Alpine Linux, macOS, NetBSD.
Bruno Haible [Fri, 19 Jul 2024 01:25:00 +0000 (03:25 +0200)] 
lang-guile: Avoid FAIL on Alpine Linux, macOS, NetBSD.

* gettext-tools/tests/lang-guile: Mark the test as skipped when it does not
produce the translations.

12 months agolang-tcl: Avoid FAIL on native Windows.
Bruno Haible [Fri, 19 Jul 2024 00:02:36 +0000 (02:02 +0200)] 
lang-tcl: Avoid FAIL on native Windows.

* gettext-tools/tests/lang-tcl: Unset LC_ALL, LC_MESSAGES, LC_CTYPE instead of
setting them to empty.

13 months agojava: Create reproducible .jar files if the 'jar' utility supports it.
Bruno Haible [Tue, 16 Jul 2024 21:59:05 +0000 (23:59 +0200)] 
java: Create reproducible .jar files if the 'jar' utility supports it.

Suggested by Bernhard M. Wiedemann <bwiedemann@suse.de> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00020.html>.

* build-aux/jar-cf: New file.
* Makefile.am (EXTRA_DIST): Add it.
* gettext-runtime/intl-java/Makefile.am (libintl.jar): Use jar-cf.
* gettext-tools/src/Makefile.am (gettext.jar): Likewise.

13 months agoautopoint-3: Don't require GNU make.
Bruno Haible [Tue, 16 Jul 2024 19:30:07 +0000 (21:30 +0200)] 
autopoint-3: Don't require GNU make.

* gettext-tools/tests/autopoint-3: Don't invoke "$MAKE --version". Instead,
just assume that $MAKE works.

13 months agolang-pascal: Modernize.
Bruno Haible [Tue, 16 Jul 2024 13:30:20 +0000 (15:30 +0200)] 
lang-pascal: Modernize.

* gettext-tools/tests/lang-pascal: Try fpc before ppc386 and ppcx64.

13 months agolang-python-*: Avoid SKIP on macOS.
Bruno Haible [Tue, 16 Jul 2024 12:59:00 +0000 (14:59 +0200)] 
lang-python-*: Avoid SKIP on macOS.

* gettext-tools/tests/lang-python-1: Search for 'python3' and 'python'.
* gettext-tools/tests/lang-python-2: Likewise.

13 months agolang-bash: Fix handling of macOS bash.
Bruno Haible [Tue, 16 Jul 2024 12:52:29 +0000 (14:52 +0200)] 
lang-bash: Fix handling of macOS bash.

* gettext-tools/tests/lang-bash: Don't test whether bash is localized. Instead,
on macOS, test only in the UTF-8 locale.

13 months agoFind the Objective-C compiler out-of-the-box on AlmaLinux 9 systems.
Bruno Haible [Tue, 16 Jul 2024 03:24:27 +0000 (05:24 +0200)] 
Find the Objective-C compiler out-of-the-box on AlmaLinux 9 systems.

* gettext-tools/configure.ac: Invoke AC_PROG_OBJC with a customized search list.
* gettext-tools/tests/init-env.in (OBJC, OBJCFLAGS): Set to the configure-
determined values.
* gettext-tools/tests/lang-objc: Use OBJC instead of CC, and OBJCFLAGS instead
of CFLAGS.
* gettext-tools/examples/hello-objc/configure.ac: Invoke AC_PROG_OBJC with a
customized search list. Don't invoke AC_PROC_CC.

13 months agobuild: Fix "make dist" after switching to automake 1.17.
Bruno Haible [Mon, 15 Jul 2024 23:01:07 +0000 (01:01 +0200)] 
build: Fix "make dist" after switching to automake 1.17.

* m4/fixautomake.m4 (FIX_MAKEFILE_TOPDIR_DISTRIB): Also recognize the distdir
rule generated by automake 1.17.

13 months agobuild: Switch to autoconf 2.72, automake 1.17.
Bruno Haible [Fri, 12 Jul 2024 15:11:27 +0000 (17:11 +0200)] 
build: Switch to autoconf 2.72, automake 1.17.

* autogen.sh: Update comments.

13 months agomsgfmt: Revisit Tcl string handling.
Bruno Haible [Mon, 1 Jul 2024 22:27:58 +0000 (00:27 +0200)] 
msgfmt: Revisit Tcl string handling.

* gettext-tools/src/write-tcl.c (write_tcl_string): Improve comment.

13 months agomsgunfmt: Fix msgunfmt-tcl-1 failure with tcl version 9.0 beta2.
Bruno Haible [Mon, 1 Jul 2024 11:26:43 +0000 (13:26 +0200)] 
msgunfmt: Fix msgunfmt-tcl-1 failure with tcl version 9.0 beta2.

Reported by Jeffrey Cliff <jeffrey.cliff@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-07/msg00000.html>.

* gettext-tools/src/msgunfmt.tcl: Access the ::msgcat::header variable through
an absolute name syntax, not a relative name syntax.

Rationale: <https://core.tcl-lang.org/tcl/wiki?name=Migrating+scripts+to+Tcl+9>
says:
  "In Tcl 8 variable names that are not absolute are resolved by looking
   first in the current namespace, and then in the global namespace.
   In Tcl 9 such variables are always interpreted as relative to the current
   namespace."

14 months agoModernize Java compiler invocations.
Bruno Haible [Mon, 10 Jun 2024 18:59:55 +0000 (20:59 +0200)] 
Modernize Java compiler invocations.

The currently used Java version in the industry is Java 8 or newer, since 2022.
See <https://en.wikipedia.org/wiki/Java_version_history>. And on macOS 11..13,
I'm seeing the "error: Source option 6 is no longer supported. Use 8 or later."

* gettext-runtime/configure.ac: Search for a Java compiler with source and
target 1.8.
* gettext-tools/configure.ac: Search for a Java compiler with source 1.8.
* gettext-tools/examples/hello-java/configure.ac: Likewise.
* gettext-tools/examples/hello-java-awt/configure.ac: Likewise.
* gettext-tools/examples/hello-java-swing/configure.ac: Likewise.

14 months agoFix undefined behaviour according to ISO C 23 § 6.5.6.(9).
Bruno Haible [Mon, 10 Jun 2024 15:39:28 +0000 (17:39 +0200)] 
Fix undefined behaviour according to ISO C 23 § 6.5.6.(9).

Found by clang's undefined-behaviour sanitizer.

* gettext-tools/src/msgl-fsearch.c (mult_index_list_accumulate): If len1 == 0,
skip two loops.

14 months agoUpdate DEPENDENCIES.
Bruno Haible [Wed, 5 Jun 2024 09:13:27 +0000 (11:13 +0200)] 
Update DEPENDENCIES.

* DEPENDENCIES: libiconv is needed again on macOS 14. Mention win-iconv as an
alternative.

15 months agoUpdate after gnulib changed.
Bruno Haible [Tue, 30 Apr 2024 13:11:42 +0000 (15:11 +0200)] 
Update after gnulib changed.

* gnulib-local/lib/exitfail.h.diff: Update.

15 months agoUpdate to the newest gnulib.
Bruno Haible [Tue, 30 Apr 2024 13:11:17 +0000 (15:11 +0200)] 
Update to the newest gnulib.

16 months agoFix -Wdiscarded-qualifiers warnings caused by a newer libxml2.
Bruno Haible [Mon, 8 Apr 2024 15:04:45 +0000 (17:04 +0200)] 
Fix -Wdiscarded-qualifiers warnings caused by a newer libxml2.

Reported by Manish Tiwari <matiwari@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-04/msg00001.html>.

* gettext-tools/src/format-kde-kuit.c (format_parse): Declare the local variable
err as 'const xmlError *'.
* gettext-tools/src/its.c (its_rule_list_add_from_file,
its_rule_list_add_from_string, its_rule_list_extract, its_merge_context_alloc):
Likewise.
* gettext-tools/src/locating-rule.c (locating_rule_match): Likewise.

16 months agoFix macro file 'serial' numbers for 'aclocal --install'.
Bruno Haible [Thu, 4 Apr 2024 14:15:29 +0000 (16:15 +0200)] 
Fix macro file 'serial' numbers for 'aclocal --install'.

* gettext-runtime/m4/gettext.m4: Make 'serial' effective.
* gettext-runtime/m4/glibc2.m4: Likewise.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/po.m4: Likewise.
* gettext-runtime/m4/progtest.m4: Likewise.
* gettext-tools/m4/exported.m4: Likewise.
* gettext-tools/m4/hostname.m4: Likewise.
* gettext-tools/m4/locale-de.m4: Likewise.
* libtextstyle/gnulib-local/m4/libcroco.m4: Likewise.
* libtextstyle/gnulib-local/m4/libglib.m4: Likewise.
* libtextstyle/gnulib-local/m4/moo.m4: Likewise.
* libtextstyle/gnulib-local/m4/term-ostream.m4: Likewise.
* libtextstyle/m4/init-package-version.m4: Likewise.
* m4/fixautomake.m4: Likewise.
* m4/more-warnings.m4: Likewise.
* m4/woe32-dll.m4: Likewise.
* gnulib-local/m4/java.m4: Likewise.
* gnulib-local/m4/libxml.m4: Likewise.
* gnulib-local/m4/backupfile.m4: Likewise. Make sure to override the gnulib
version.

17 months agolocale-*.m4: Update comments.
Bruno Haible [Tue, 5 Mar 2024 11:59:07 +0000 (12:59 +0100)] 
locale-*.m4: Update comments.

* gettext-tools/m4/locale-de.m4: Update comments for Solaris 10.

17 months agobuild: Fix "make distcheck" failure.
Bruno Haible [Fri, 1 Mar 2024 23:18:31 +0000 (00:18 +0100)] 
build: Fix "make distcheck" failure.

* Makefile.am (distcheck-hook): Remove comparison with
gettext-tools/gnulib-m4/po.m4, since that file no longer exists.

17 months agolibtextstyle: Avoid crashing the terminal emulator when using ncurses.
Bruno Haible [Wed, 28 Feb 2024 22:15:35 +0000 (23:15 +0100)] 
libtextstyle: Avoid crashing the terminal emulator when using ncurses.

Reported by Adriaan de Groot <adridg@freebsd.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2021-12/msg00023.html>.
Long explanation: <https://euroquis.nl/freebsd/2021/11/24/bison.html>

* libtextstyle/gnulib-local/lib/term-ostream.oo.c (out_data_string,
out_data_string_unchecked): New functions.
(out_hyperlink_change): Don't use tputs on strings that are not escape
sequences.

17 months agobuild: Tweak ChangeLog generation.
Bruno Haible [Sat, 24 Feb 2024 11:17:01 +0000 (12:17 +0100)] 
build: Tweak ChangeLog generation.

* Makefile.am (gen-ChangeLogs): Untabify rule. Pass option '--no-cluster'.

17 months agoUpdate after gnulib changed.
Bruno Haible [Mon, 26 Feb 2024 19:32:30 +0000 (20:32 +0100)] 
Update after gnulib changed.

17 months agobuild: Improve handling of divergences between gnulib and gettext.
Bruno Haible [Mon, 26 Feb 2024 19:26:13 +0000 (20:26 +0100)] 
build: Improve handling of divergences between gnulib and gettext.

* autogen.sh: Detect divergence also of gettext.m4, nls.m4, progtest.m4.
When there is a divergence without a serial number bump, assume it's a copyright
year update and copy the file from gnulib to gettext.

17 months agoMerge from 0.22.x branch: Prepare for 0.22.5 release.
Bruno Haible [Thu, 22 Feb 2024 01:31:47 +0000 (02:31 +0100)] 
Merge from 0.22.x branch: Prepare for 0.22.5 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.5.
* gettext-tools/misc/autopoint.in: Allow version 0.22.5.

17 months agoUpdate after gnulib changed.
Bruno Haible [Thu, 22 Feb 2024 01:29:52 +0000 (02:29 +0100)] 
Update after gnulib changed.

* gettext-runtime/intl/configure.ac: Update list of symbols to rename,
from modules 'localename-unsafe', 'localename', and 'setlocale-null-unlocked'.

17 months agoUpdate to the newest gnulib.
Bruno Haible [Thu, 22 Feb 2024 01:25:46 +0000 (02:25 +0100)] 
Update to the newest gnulib.

17 months agoMerge from 0.22.x branch: Update NEWS file for release 0.22.5.
Bruno Haible [Thu, 22 Feb 2024 01:24:13 +0000 (02:24 +0100)] 
Merge from 0.22.x branch: Update NEWS file for release 0.22.5.

17 months agoRemove support for OS/2 (based on EMX directly), part 2.
Bruno Haible [Fri, 23 Feb 2024 02:08:46 +0000 (03:08 +0100)] 
Remove support for OS/2 (based on EMX directly), part 2.

* Makefile.am (EXTRA_DIST): Remove os2/*.

17 months agoRemove support for OS/2 (based on EMX directly).
Bruno Haible [Mon, 19 Feb 2024 22:25:12 +0000 (23:25 +0100)] 
Remove support for OS/2 (based on EMX directly).

Nowadays, KO Myung-Hun <komh78@gmail.com> uses an approach based on kLIBC
instead of emx+gcc. This kLIBC (https://github.com/bitwiseworks/libc) contains
iconv already.

* os2: Remove directory.

17 months agoWrite #include <error.h>, not #include "error.h".
Bruno Haible [Mon, 19 Feb 2024 22:58:27 +0000 (23:58 +0100)] 
Write #include <error.h>, not #include "error.h".

This is required by Gnulib, although <error.h> is not a POSIX or ISO C
standardized header file.

Reported by Collin Funk <collin.funk1@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-02/msg00011.html>.

* gettext-runtime/src/envsubst.c: Use #include <error.h> instead of
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-tools/libgettextpo/gettext-po.c: Likewise.
* gettext-tools/libgrep/m-fgrep.c: Likewise.
* gettext-tools/libgrep/m-regex.c: Likewise.
* gettext-tools/src/file-list.c: Likewise.
* gettext-tools/src/format-scheme.c: Likewise.
* gettext-tools/src/format.h: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/if-error.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgl-cat.c: Likewise.
* gettext-tools/src/msgl-charset.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/po-error.c: Likewise.
* gettext-tools/src/po-gram-gen.y: Likewise.
* gettext-tools/src/po-lex.c: Likewise.
* gettext-tools/src/po-lex.h: Likewise.
* gettext-tools/src/po-xerror.c: Likewise.
* gettext-tools/src/read-catalog-abstract.c: Likewise.
* gettext-tools/src/read-csharp.c: Likewise.
* gettext-tools/src/read-desktop.c: Likewise.
* gettext-tools/src/read-java.c: Likewise.
* gettext-tools/src/read-mo.c: Likewise.
* gettext-tools/src/read-properties.c: Likewise.
* gettext-tools/src/read-resources.c: Likewise.
* gettext-tools/src/read-stringtable.c: Likewise.
* gettext-tools/src/read-tcl.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/write-csharp.c: Likewise.
* gettext-tools/src/write-desktop.c: Likewise.
* gettext-tools/src/write-java.c: Likewise.
* gettext-tools/src/write-mo.c: Likewise.
* gettext-tools/src/write-properties.c: Likewise.
* gettext-tools/src/write-qt.c: Likewise.
* gettext-tools/src/write-resources.c: Likewise.
* gettext-tools/src/write-tcl.c: Likewise.
* gettext-tools/src/write-xml.c: Likewise.
* gettext-tools/src/x-awk.c: Likewise.
* gettext-tools/src/x-c.c: Likewise.
* gettext-tools/src/x-csharp.c: Likewise.
* gettext-tools/src/x-desktop.c: Likewise.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-java.c: Likewise.
* gettext-tools/src/x-javascript.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-lisp.c: Likewise.
* gettext-tools/src/x-lua.c: Likewise.
* gettext-tools/src/x-perl.c: Likewise.
* gettext-tools/src/x-php.c: Likewise.
* gettext-tools/src/x-python.c: Likewise.
* gettext-tools/src/x-rst.c: Likewise.
* gettext-tools/src/x-ruby.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/src/x-smalltalk.c: Likewise.
* gettext-tools/src/x-tcl.c: Likewise.
* gettext-tools/src/x-vala.c: Likewise.
* gettext-tools/src/x-ycp.c: Likewise.
* gettext-tools/src/xg-mixed-string.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/tests/tstgettext.c: Likewise.
* gettext-tools/tests/tstngettext.c: Likewise.
* gnulib-local/lib/closeout.c: Likewise.
* gnulib-local/lib/xerror.c: Likewise.
* libtextstyle/gnulib-local/lib/fd-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/term-ostream.oo.c: Likewise.
* gettext-tools/src/its.c: Likewise, and reorganize #includes.
* gettext-tools/src/locating-rule.c: Likewise.

17 months agolibtextstyle: Use #include <...> style for system headers.
Bruno Haible [Mon, 19 Feb 2024 22:08:30 +0000 (23:08 +0100)] 
libtextstyle: Use #include <...> style for system headers.

* libtextstyle/gnulib-local/lib/libcroco/cr-additional-sel.c: Use #include <...>
style for system headers.
* libtextstyle/gnulib-local/lib/libcroco/cr-input.c: Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-num.c: Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-parser.c: Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-stylesheet.c: Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-tknzr.c: Likewise.

18 months agoDon't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.
Bruno Haible [Wed, 14 Feb 2024 23:00:56 +0000 (00:00 +0100)] 
Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.

* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c (iconv_ostream::write_mem):
Don't treat the bastard Apple iconv like GNU libiconv.
* gettext-tools/src/po-charset.c (po_lex_charset_set): Likewise.

18 months agointl: Improve support of Citrus/FreeBSD iconv.
Bruno Haible [Wed, 14 Feb 2024 22:51:28 +0000 (23:51 +0100)] 
intl: Improve support of Citrus/FreeBSD iconv.

* gettext-runtime/intl/dcigettext.c (_nl_find_msg): Use //TRANSLIT with all
iconv implementations that support it.

18 months agolibtextstyle: Add a comment regarding COLORTERM.
Bruno Haible [Mon, 29 Jan 2024 18:19:11 +0000 (19:19 +0100)] 
libtextstyle: Add a comment regarding COLORTERM.

* libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Add
comment.

18 months agolibtextstyle: Update a few URLs.
Bruno Haible [Mon, 29 Jan 2024 10:05:57 +0000 (11:05 +0100)] 
libtextstyle: Update a few URLs.

* libtextstyle/doc/libtextstyle.texi (Terminal emulators): Update URL. From
Simon Sobisch.
(Style rules): Update URL.
(Hyperlinks): Reference new state-of-the-art document. From Simon Sobisch.

18 months agointl: Revert "Add special hack for GCC" from 2022-06-21.
Bruno Haible [Mon, 29 Jan 2024 09:32:34 +0000 (10:32 +0100)] 
intl: Revert "Add special hack for GCC" from 2022-06-21.

The added option --enable-host-shared has the same effect as the
libtool-provided option --with-pic, and gcc's Makefile.def actually
uses --with-pic, not --enable-host-shared.

* gettext-runtime/intl/configure.ac: Don't accept option --enable-host-shared.
Don't set PICFLAG.
* gettext-runtime/intl/Makefile.am (AM_CFLAGS): Remove the PICFLAG.
* gnulib-local/modules/gettext-runtime-intl-misc (Makefile.am): Remove the
PICFLAG from AM_CFLAGS.

19 months agointl: Fix the Windows MUI code, so that it works on Windows 10.
Bruno Haible [Mon, 8 Jan 2024 05:51:40 +0000 (06:51 +0100)] 
intl: Fix the Windows MUI code, so that it works on Windows 10.

Reported by <lrn1986@gmail.com> at <https://savannah.gnu.org/bugs/?65128>.

* gettext-runtime/intl/langprefs.c (_nl_language_preferences_win32_mui): Make
GetUserPreferredUILanguages prototype with Microsoft's current documentation.
Allow the first GetUserPreferredUILanguages call to succeed.

20 months agoxgettext: Java: Flag strings on which the method 'formatted' is used as java-printf...
Bruno Haible [Tue, 5 Dec 2023 15:07:38 +0000 (16:07 +0100)] 
xgettext: Java: Flag strings on which the method 'formatted' is used as java-printf-format.

* gettext-tools/src/x-java.c (token_type_semicolon): New enum item.
(phase5_get): Recognize semicolon tokens.
(extract_parenthesized): Handle method invocation .formatted. Return when a
semicolon was seen.
* gettext-tools/tests/xgettext-java-8: New file, based on
gettext-tools/tests/xgettext-vala-6.
* gettext-tools/tests/xgettext-java-9: New file, based on
gettext-tools/tests/xgettext-vala-7.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* NEWS: Mention the change.

20 months agoxgettext: Python: Add support for f-strings.
Bruno Haible [Tue, 5 Dec 2023 13:15:42 +0000 (14:15 +0100)] 
xgettext: Python: Add support for f-strings.

Reported by Ben <gnu@mail.qoben.com>
at <https://savannah.gnu.org/bugs/?61596>.

* gettext-tools/src/x-python.c (P7_498_START_OF_EXPRESSION): New macro.
(token_type_498, token_type_l498, token_type_m498, token_type_r498): New enum
items.
(free_token): Treat token_type_498 like token_type_string.
(phase7_getuc): Accept an f_string parameter. Use it to combine {{ to { and
}} to }.
(f_string_depth): New variable.
(struct f_string_level): New type.
(f_string_stack, f_string_stack_alloc): New variables.
(new_f_string_level): New function.
(open_pb): Renamed from open_pbb.
(phase5_get): Consider also the f_string_stack. Accept f"...", fr"...", rf"..."
syntax. Recognize tokens of type token_type_498, token_type_l498,
token_type_m498, token_type_r498.
(x_python_lex): Treat token_type_498 like token_type_string.
(extract_balanced): Handle the new token types.
(extract_python): Initialize f_string_depth and the f_string_stack.
* gettext-tools/tests/xgettext-python-1: Test also the backslash handling in
f-strings.
* gettext-tools/tests/xgettext-python-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/lang-python.texi (Python): Explain the limitations of
f-string support.
* NEWS: Mention the change.

20 months agoxgettext: Vala: Flag strings on which the method 'printf' is used as c-format.
Bruno Haible [Thu, 30 Nov 2023 16:16:36 +0000 (17:16 +0100)] 
xgettext: Vala: Flag strings on which the method 'printf' is used as c-format.

* gettext-tools/src/x-vala.c (token_type_semicolon): New enum item.
(phase3_get): Recognize semicolon tokens.
(phase4_pushback, phase4_pushback_length): New variables.
(phase4_get): Renamed from x_vala_lex. Handle pushback.
(phase4_unget, x_vala_lex, x_vala_unlex): New functions.
(extract_balanced): Handle method invocations .printf and .vprintf. Return when
a semicolon was seen.
(extract_vala): Initialize phase4_pushback_length.
* gettext-tools/tests/xgettext-vala-6: Add tests for printf used as method.
* gettext-tools/tests/xgettext-vala-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

20 months agoxgettext: Vala: Don't flag printf arguments as c-format.
Bruno Haible [Thu, 30 Nov 2023 15:55:42 +0000 (16:55 +0100)] 
xgettext: Vala: Don't flag printf arguments as c-format.

Reported by Anders Jonsson <anders.jonsson@norsjovallen.se>
at <https://savannah.gnu.org/bugs/?64921>.

* gettext-tools/src/xgettext.c (xgettext_record_flag: Recognize also
"undecided-...-format".
* gettext-tools/src/x-vala.c (init_flag_table_vala): Flag the printf function as
'undecided-c-format', not 'c-format'.
* gettext-tools/tests/xgettext-vala-5: Use vprintf instead of printf.
* gettext-tools/tests/xgettext-vala-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

20 months agoxgettext: Support modifying the flags of a message after it has been remembered.
Bruno Haible [Thu, 30 Nov 2023 15:01:50 +0000 (16:01 +0100)] 
xgettext: Support modifying the flags of a message after it has been remembered.

* gettext-tools/src/xg-arglist-context.h (struct remembered_message_ty,
struct remembered_message_list_ty): New types.
(remembered_message_list_append): New declaration.
(struct formatstring_region_ty): Add a 'remembered' field.
* gettext-tools/src/xg-arglist-context.c (remembered_message_list_alloc,
remembered_message_list_append, remembered_message_list_ref,
remembered_message_list_unref): New functions.
(the_null_context_region): Update.
(inheriting_region): Inherit or allocate the 'remembered' fields.
(unref_region): Unref the 'remembered' fields.
* gettext-tools/src/xg-message.h (set_format_flag_from_context): New
declaration.
* gettext-tools/src/xg-message.c (validate_is_format): New function, extracted
from set_format_flags_from_context.
(set_format_flags_from_context): Change parameters. Invoke validate_is_format.
(set_format_flag_from_context): New function.
(remember_a_message, remember_a_message_plural): Update.

20 months agoxgettext: Refactor the formatstring code.
Bruno Haible [Thu, 30 Nov 2023 08:02:29 +0000 (09:02 +0100)] 
xgettext: Refactor the formatstring code.

Use "regions" instead of "contexts" to keep track of the flags and data that is
specific to a (usually parenthesized) block in an input file.

* gettext-tools/src/xg-arglist-context.h (null_context, passthrough_context,
inherited_context): Remove declarations.
(struct formatstring_region_ty, struct flag_region_ty): New types.
(null_context_region, inheriting_region, ref_region, unref_region): New
declarations.
(assign_region, assign_new_region): New macros.
* gettext-tools/src/xg-arglist-context.c: Include attribute.h.
(null_context): Make static.
(passthrough_context): Make static. Mark as MAYBE_UNUSED.
(inherited_context): Remove function.
(the_null_context_region): New variable.
(null_context_region, inheriting_region, ref_region, unref_region): New
functions.
* gettext-tools/src/xg-arglist-parser.h (struct partial_call,
arglist_parser_remember, arglist_parser_remember_msgctxt): Use
'flag_region_ty *' instead of flag_context_ty.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_alloc,
arglist_parser_clone, arglist_parser_remember): Update.
(arglist_parser_remember_msgctxt, arglist_parser_done): Use 'flag_region_ty *'
instead of flag_context_ty.
* gettext-tools/src/xg-message.h (remember_a_message,
remember_a_message_plural): Use 'flag_region_ty *' instead of flag_context_ty.
* gettext-tools/src/xg-message.c (set_format_flags_from_context,
remember_a_message, remember_a_message_plural): Use 'flag_region_ty *' instead
of flag_context_ty.
* gettext-tools/src/x-awk.c (extract_parenthesized): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_awk): Update.
* gettext-tools/src/x-c.c (extract_parenthesized): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_whole_file): Update.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_csharp): Update.
* gettext-tools/src/x-desktop.c (extract_desktop_handle_pair): Update.
* gettext-tools/src/x-elisp.c (read_object): Use 'flag_region_ty *' instead of
flag_context_ty.
(extract_elisp): Update.
* gettext-tools/src/x-java.c (extract_parenthesized): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_java): Update.
* gettext-tools/src/x-javascript.c (extract_balanced): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_javascript): Update.
* gettext-tools/src/x-librep.c (read_object): Use 'flag_region_ty *' instead of
flag_context_ty.
(extract_librep): Update.
* gettext-tools/src/x-lisp.c (read_object): Use 'flag_region_ty *' instead of
flag_context_ty.
(extract_lisp): Update.
* gettext-tools/src/x-lua.c (extract_balanced): Use 'flag_region_ty *' instead
of flag_context_ty.
(extract_lua): Update.
* gettext-tools/src/x-perl.c (extract_variable, interpolate_keywords,
extract_balanced): Use 'flag_region_ty *' instead of flag_context_ty.
(extract_perl): Update.
* gettext-tools/src/x-php.c (extract_balanced): Use 'flag_region_ty *' instead
of flag_context_ty.
(extract_php): Update.
* gettext-tools/src/x-python.c (extract_balanced): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_python): Update.
* gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Update.
* gettext-tools/src/x-scheme.c (read_object): Use 'flag_region_ty *' instead of
flag_context_ty.
(extract_scheme): Update.
* gettext-tools/src/x-sh.c (read_word, read_command, read_command_list): Use
'flag_region_ty *' instead of flag_context_ty.
(extract_sh): Update.
* gettext-tools/src/x-smalltalk.c (extract_smalltalk): Update.
* gettext-tools/src/x-tcl.c (accumulate_word, read_word, read_command,
read_command_list): Use 'flag_region_ty *' instead of flag_context_ty.
(extract_tcl): Update.
* gettext-tools/src/x-vala.c (extract_balanced): Use 'flag_region_ty *' instead
of flag_context_ty.
(extract_vala): Update.
* gettext-tools/src/x-ycp.c (extract_parenthesized): Use 'flag_region_ty *'
instead of flag_context_ty.
(extract_ycp): Update.
* gettext-tools/src/xgettext.c (xgettext_its_extract_callback): Update.

20 months agoxgettext: Refactor the formatstring code.
Bruno Haible [Thu, 30 Nov 2023 07:43:16 +0000 (08:43 +0100)] 
xgettext: Refactor the formatstring code.

* gettext-tools/src/xg-formatstring.h (NXFORMATS, XFORMAT_PRIMARY,
XFORMAT_SECONDARY, XFORMAT_TERTIARY, XFORMAT_FOURTH): New macros.
(current_formatstring_parser1, current_formatstring_parser2,
current_formatstring_parser3, current_formatstring_parser4): Remove
declarations.
(current_formatstring_parser): New declaration.
* gettext-tools/src/xg-formatstring.c (current_formatstring_parser1,
current_formatstring_parser2, current_formatstring_parser3,
current_formatstring_parser4): Remove variables.
(current_formatstring_parser): New variable.
* gettext-tools/src/xg-arglist-context.h: Include xg-formatstring.h.
(struct formatstring_context_ty): New type.
(struct flag_context_ty): Replace individual fields with an array.
(flag_context_list_table_add): Rename parameter 'index' to 'fi'.
* gettext-tools/src/xg-arglist-context.c (null_context, passthrough_context):
Update.
(inherited_context): Loop over the four formatstring types.
(passthrough_context_circular_list): Update.
(set_flags_for_formatstring_type): Simplify.
(flag_context_list_table_add): Rename parameter 'index' to 'fi'.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update.
* gettext-tools/src/xg-message.c (set_format_flags_from_context): Loop over the
four formatstring types.
(is_relevant): New function.
(decide_is_format, remember_a_message_plural): Use it.
* gettext-tools/src/xgettext.c (struct extractor_ty): Replace individual fields
with an array.
(main): Update.
(flag_context_list_table_insert): Rename parameter 'index' to 'fi'.
(xgettext_record_flag): Use XFORMAT_* macros.
(extract_from_file): Loop over the four formatstring types.
(recognize_qt_formatstrings): Update.
(language_to_extractor): Use XFORMAT_* macros and a loop.

20 months agoxgettext: Refactor.
Bruno Haible [Thu, 30 Nov 2023 07:34:51 +0000 (08:34 +0100)] 
xgettext: Refactor.

* gettext-tools/src/xg-formatstring.h: New file, extracted from xgettext.h.
* gettext-tools/src/xg-formatstring.c: New file, extracted from xgettext.c.
* gettext-tools/src/FILES: Mention them.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add xg-formatstring.h.
(xgettext_SOURCES): Add xg-formatstring.c.
* gettext-tools/src/xgettext.h (current_formatstring_parser1,
current_formatstring_parser2, current_formatstring_parser3,
current_formatstring_parser4): Remove declarations.
* gettext-tools/src/xgettext.c: Include xg-formatstring.h.
(current_formatstring_parser1, current_formatstring_parser2,
current_formatstring_parser3, current_formatstring_parser4): Remove variables.
* gettext-tools/src/xg-message.c: Include xg-formatstring.h.

20 months agoxgettext: Refactor.
Bruno Haible [Thu, 30 Nov 2023 07:31:27 +0000 (08:31 +0100)] 
xgettext: Refactor.

* gettext-tools/src/xg-message.c (remember_a_message): Simplify: Don't cache
mp->do_syntax_check in a local variable.

20 months agoxgettext: Refactor.
Bruno Haible [Thu, 30 Nov 2023 07:30:05 +0000 (08:30 +0100)] 
xgettext: Refactor.

* gettext-tools/src/xg-message.c (remember_a_message): Simplify: Don't cache
mp->do_wrap in a local variable.

20 months agoxgettext: Refactor.
Bruno Haible [Thu, 30 Nov 2023 07:27:32 +0000 (08:27 +0100)] 
xgettext: Refactor.

* gettext-tools/src/xg-message.c (remember_a_message): Simplify: Don't cache
mp->is_format in a local variable.

20 months agotests: Avoid an autopoint-3 failure caused by an Autoconf 2.71 bug.
Bruno Haible [Thu, 30 Nov 2023 10:38:36 +0000 (11:38 +0100)] 
tests: Avoid an autopoint-3 failure caused by an Autoconf 2.71 bug.

* gettext-tools/tests/autopoint-3: Remove the autom4te cache before invoking
automake.

20 months agoFix clang -Wunused-function warnings.
Bruno Haible [Thu, 30 Nov 2023 07:24:18 +0000 (08:24 +0100)] 
Fix clang -Wunused-function warnings.

* gettext-runtime/src/envsubst.c: Include attribute.h.
(string_list_member, string_list_destroy): Mark as MAYBE_UNUSED.
* gettext-tools/src/format-scheme.c: Include attribute.h.
(II): Mark as MAYBE_UNUSED.
* gettext-tools/src/msgl-fsearch.c: Include attribute.h.
(add_index): Mark as MAYBE_UNUSED.
* gettext-tools/src/po-lex.c: Include attribute.h.
(mb_isnul, mb_cmp, mb_equal, mb_isascii, mb_putc, mb_setascii): Mark as
MAYBE_UNUSED.
* gettext-tools/src/write-qt.c: Include attribute.h.
(write_u16): Mark as MAYBE_UNUSED.
* gettext-tools/src/x-awk.c (free_token): Mark as MAYBE_UNUSED.
* gettext-tools/src/x-python.c (phase0_ungetc): Mark as MAYBE_UNUSED.

20 months agotests: Fix a typo.
Bruno Haible [Thu, 30 Nov 2023 07:07:56 +0000 (08:07 +0100)] 
tests: Fix a typo.

* gettext-tools/tests/autopoint-3: Fix a typo in a file name.

20 months agoMerge from 0.22.x branch: Prepare for 0.22.4 release.
Bruno Haible [Sun, 19 Nov 2023 21:25:43 +0000 (22:25 +0100)] 
Merge from 0.22.x branch: Prepare for 0.22.4 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.3.
* gettext-tools/misc/autopoint.in: Allow version 0.22.3.

20 months agoMerge from 0.22.x branch: Update NEWS file for release 0.22.4.
Bruno Haible [Sun, 19 Nov 2023 21:24:11 +0000 (22:24 +0100)] 
Merge from 0.22.x branch: Update NEWS file for release 0.22.4.

20 months agobuild: Obey --disable-threads also regarding msgmerge and OpenMP.
Bruno Haible [Fri, 17 Nov 2023 21:31:15 +0000 (22:31 +0100)] 
build: Obey --disable-threads also regarding msgmerge and OpenMP.

* gettext-tools/configure.ac: If --disable-threads was specified, just set
OPENMP_CFLAGS to empty.

20 months agoUpdate after gnulib changed.
Bruno Haible [Fri, 17 Nov 2023 21:26:38 +0000 (22:26 +0100)] 
Update after gnulib changed.

20 months agoUpdate to the newest gnulib.
Bruno Haible [Fri, 17 Nov 2023 21:23:00 +0000 (22:23 +0100)] 
Update to the newest gnulib.

20 months agoAdd installation instructions for AIX.
Bruno Haible [Fri, 17 Nov 2023 12:10:01 +0000 (13:10 +0100)] 
Add installation instructions for AIX.

* INSTALL.aix: New file.
* Makefile.am (EXTRA_DIST): Add it.

20 months agogettext.m4: Recognize a statically built libintl on macOS and AIX.
Bruno Haible [Fri, 17 Nov 2023 11:46:18 +0000 (12:46 +0100)] 
gettext.m4: Recognize a statically built libintl on macOS and AIX.

Reported by David Edelsohn <dje.gcc@gmail.com> in
<https://gcc.gnu.org/pipermail/gcc-patches/2023-November/636558.html>.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): In the
"checking for GNU gettext in libintl..." test, add also the special
system library dependencies needed on macOS and AIX.

20 months agobuild: Fix a build issue on AIX.
Bruno Haible [Fri, 17 Nov 2023 11:40:54 +0000 (12:40 +0100)] 
build: Fix a build issue on AIX.

How to reproduce:
$ cd gettext-20231111
$ ~/build-64-gcc --disable-shared
$ (cd build-64-gcc && gmake install)
$ cd ..
$ cd gettext-0.22.3
$ ~/build-64-gcc
=> Fails with "ERROR: Undefined symbol: .syntax_check_message_list"
because the link uses $PREFIX/lib/libgettextsrc.a, which is a non-shared
library that does not export 'syntax_check_message_list'.

* gettext-tools/configure.ac (INSTALL_PRIVATE_LIBRARIES): New conditional.
* gettext-tools/src/Makefile.am (noinst_LTLIBRARIES): Define as alternative to
lib_LTLIBRARIES.
(install-exec-clean): Remove rule.
* gettext-tools/gnulib-lib/Makefile.am (lib_LTLIBRARIES): Initialize.
* gnulib-local/modules/gettext-tools-misc (Makefile.am): Define
noinst_LTLIBRARIES as alternative to lib_LTLIBRARIES. Remove
'install-exec-clean' rule.

21 months agobuild: Fix a compilation failure on AIX with gcc 10.
Bruno Haible [Wed, 15 Nov 2023 15:11:34 +0000 (16:11 +0100)] 
build: Fix a compilation failure on AIX with gcc 10.

* m4/more-warnings.m4 (gt_MORE_WARNINGS): Turn off -fanalyzer with GCC 10
or older.

21 months agoxgettext: Fix memory overrun while parsing a C++ brace format string.
Bruno Haible [Sun, 12 Nov 2023 00:07:41 +0000 (01:07 +0100)] 
xgettext: Fix memory overrun while parsing a C++ brace format string.

Found with CHERI on CheriBSD.

* gettext-tools/src/format-c++-brace.c (format_parse): Compare the first
character after ':' against '\0', not '0'.

21 months agolibgettextpo: Remove static variables gram_pos_column, gram_pot_role, signal_eilseq...
Bruno Haible [Sat, 11 Nov 2023 15:48:31 +0000 (16:48 +0100)] 
libgettextpo: Remove static variables gram_pos_column, gram_pot_role, signal_eilseq, po_lex_obsolete, po_lex_previous, mbf.

* gettext-tools/src/po-gram.h: Include <stdbool.h>, <stdio.h>, unistr.h.
(MBCHAR_BUF_SIZE, struct mbchar, mbchar_t, NPUSHBACK, struct mbfile, mbfile_t):
Moved to here, from po-lex.c.
(struct po_parser_state): Add fields gram_pot_role, gram_pos_column,
signal_eilseq, mbf, po_lex_obsolete, po_lex_previous.
* gettext-tools/src/po-gram-gen.y: Add %lex-param declaration.
(do_callback_message): Add 'struct po_parser_state *ps' parameter. Update all
callers.
* gettext-tools/src/po-lex.h (gram_pos_column, gram_pot_role): Remove
declarations.
(lex_start): Add 'struct po_parser_state *ps' parameter. Remove is_pot_role
parameter.
(po_gram_lex): Add 'struct po_parser_state *ps' parameter.
* gettext-tools/src/po-lex.c: Don't include unistr.h.
(gram_pos_column, gram_pot_role, signal_eilseq, mbf, po_lex_obsolete,
po_lex_previous): Remove variables.
(po_gram_error): Update.
(MBCHAR_BUF_SIZE, struct mbchar, mbchar_t, NPUSHBACK, struct mbfile, mbfile_t):
Remove declarations.
(mb_width): Add 'struct po_parser_state *ps' parameter.
(mbfile_getc): Likewise. Pass it to po_gram_error.
(lex_start): Add 'struct po_parser_state *ps' parameter. Remove is_pot_role
parameter.
(lex_end): Remove assignments to variables.
(lex_getc, lex_ungetc, keyword_p, control_sequence, po_gram_lex): Add
'struct po_parser_state *ps' parameter.
* gettext-tools/src/read-po.c (po_parse): Iniitialize gram_pot_role field here.
Pass 'struct po_parser_state *' to lex_start.
* gettext-tools/woe32dll/gettextsrc-exports.c: Remove gram_pos_column,
gram_pot_role.

21 months agolibgettextpo: Remove static variable 'plural_counter'.
Bruno Haible [Sat, 11 Nov 2023 15:48:27 +0000 (16:48 +0100)] 
libgettextpo: Remove static variable 'plural_counter'.

* gettext-tools/src/po-gram.h (struct po_parser_state): New type.
(po_gram_parse): Add 'struct po_parser_state *ps' parameter.
* gettext-tools/src/po-gram-gen.y: Add %parse-param declaration.
Access ps->plural_counter instead of plural_counter.
(plural_counter): Remove variable.
* gettext-tools/src/po-lex.h (po_gram_error): Add 'struct po_parser_state *ps'
parameter.
* gettext-tools/src/po-lex.c: Include po-gram.h.
(po_gram_error): Add 'struct po_parser_state *ps' parameter.
(mbfile_getc, control_sequence): Update po_gram_error calls.
* gettext-tools/src/read-po.c (po_parse): Pass a 'struct po_parser_state *' to
po_gram_parse.

21 months agobuild: Remove po-gram-gen2.h.
Bruno Haible [Sat, 11 Nov 2023 15:48:24 +0000 (16:48 +0100)] 
build: Remove po-gram-gen2.h.

* gettext-tools/src/po-lex.c: Include po-gram-gen.h instead of po-gram-gen2.h.
* gettext-tools/src/po-lex.h: Update comment.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Remove po-gram-gen2.h.
(po-gram-gen2.h): Remove rule.
(BUILT_SOURCES, MAINTAINERCLEANFILES, EXTRA_DIST): Don't add it.
(po-lex.o, po-lex.lo): Don't depend on it.

21 months agolibgettextpo: Remove static variables po_gram_lval, po_gram_char, po_gram_nerrs.
Bruno Haible [Sat, 11 Nov 2023 15:48:20 +0000 (16:48 +0100)] 
libgettextpo: Remove static variables po_gram_lval, po_gram_char, po_gram_nerrs.

* gettext-tools/src/po-gram-gen.y: Request a pure parser.
* gettext-tools/src/po-lex.h (po_gram_lex): Add lval parameter.
* gettext-tools/src/po-lex.c (po_gram_lex): Add lval parameter. Store the result
in *lval instead of in po_gram_lval.
* gettext-tools/woe32dll/gettextsrc-exports.c: Remove po_gram_lval.

21 months agolibgettextpo: Remove static variable 'width.0'.
Bruno Haible [Sat, 11 Nov 2023 15:48:16 +0000 (16:48 +0100)] 
libgettextpo: Remove static variable 'width.0'.

* gnulib-local/lib/xerror.h: Include <stddef.h>.
(multiline_warning, multiline_error): Change return type to size_t. Don't
suggest to pass a NULL prefix.
(multiline_append): New declaration.
* gnulib-local/lib/xerror.c (multiline_internal): New function, extracted from
multiline_warning.
(multiline_warning, multiline_error): Reject a NULL prefix. Call
multiline_internal.
(multiline_append): New function.
* gettext-tools/src/msgl-charset.c (compare_po_locale_charsets): Invoke
multiline_append instead of multiline_warning with NULL argument.
* gettext-tools/src/msgfmt.c (msgfmt_parse_debrief): Invoke multiline_append
instead of multiline_error with NULL argument.
* gettext-tools/src/po-error.c (void_multiline_warning, void_multiline_error):
New functions.
(po_multiline_warning, po_multiline_error): Use them as initializer.
* gettext-tools/libgettextpo/gettext-po.c (void_multiline_warning,
void_multiline_error): New functions.
(po_file_read_v2, po_file_write): Use them as defaults for po_multiline_warning,
po_multiline_error.

21 months agolibgettextpo: Remove static variable 'result.0'.
Bruno Haible [Sat, 11 Nov 2023 15:48:13 +0000 (16:48 +0100)] 
libgettextpo: Remove static variable 'result.0'.

* gettext-tools/src/write-po.h (make_format_description_string): Change return
type to 'char *'.
* gettext-tools/src/write-po.c (make_format_description_string): Return a
freshly allocated string.
(message_print_comment_flags, message_print_obsolete): Free the result of
make_format_description_string when done.
* gettext-tools/src/write-stringtable.c (write_message): Likewise.

21 months agolibgettextpo: Remove static variables curr_mp, curr_msgid_pos.
Bruno Haible [Sat, 11 Nov 2023 15:48:09 +0000 (16:48 +0100)] 
libgettextpo: Remove static variables curr_mp, curr_msgid_pos.

* gettext-tools/src/format.h (formatstring_error_logger_t): Add a 'data'
parameter.
(struct formatstring_parser): In the 'check' method, add an 'error_logger_data'
parameter.
(check_msgid_msgstr_format_i, check_msgid_msgstr_format): Add an
'error_logger_data' parameter.
* gettext-tools/src/format-awk.c (format_check): Add an 'error_logger_data'
parameter. Pass it to each error_logger invocation.
* gettext-tools/src/format-boost.c (format_check): Likewise.
* gettext-tools/src/format-c.c (format_check): Likewise.
* gettext-tools/src/format-c++-brace.c (format_check): Likewise.
* gettext-tools/src/format-csharp.c (format_check): Likewise.
* gettext-tools/src/format-elisp.c (format_check): Likewise.
* gettext-tools/src/format-gcc-internal.c (format_check): Likewise.
* gettext-tools/src/format-gfc-internal.c (format_check): Likewise.
* gettext-tools/src/format-java-printf.c (format_check): Likewise.
* gettext-tools/src/format-java.c (format_check): Likewise.
* gettext-tools/src/format-javascript.c (format_check): Likewise.
* gettext-tools/src/format-kde-kuit.c (format_check): Likewise.
* gettext-tools/src/format-kde.c (format_check): Likewise.
* gettext-tools/src/format-librep.c (format_check): Likewise.
* gettext-tools/src/format-lisp.c (format_check): Likewise.
* gettext-tools/src/format-lua.c (format_check): Likewise.
* gettext-tools/src/format-pascal.c (format_check): Likewise.
* gettext-tools/src/format-perl-brace.c (format_check): Likewise.
* gettext-tools/src/format-perl.c (format_check): Likewise.
* gettext-tools/src/format-php.c (format_check): Likewise.
* gettext-tools/src/format-python-brace.c (format_check): Likewise.
* gettext-tools/src/format-python.c (format_check): Likewise.
* gettext-tools/src/format-qt-plural.c (format_check): Likewise.
* gettext-tools/src/format-qt.c (format_check): Likewise.
* gettext-tools/src/format-ruby.c (format_check): Likewise.
* gettext-tools/src/format-scheme.c (format_check): Likewise.
* gettext-tools/src/format-sh.c (format_check): Likewise.
* gettext-tools/src/format-smalltalk.c (format_check): Likewise.
* gettext-tools/src/format-tcl.c (format_check): Likewise.
* gettext-tools/src/format.c (check_msgid_msgstr_format_i,
check_msgid_msgstr_format): Add an 'error_logger_data' parameter.
* gettext-tools/src/msgl-check.c (curr_mp, curr_msgid_pos): Remove variables.
(struct formatstring_error_logger_locals): New type.
(formatstring_error_logger): Add a 'data' parameter.
(check_pair): Set up a 'struct formatstring_error_logger_locals' on the stack
and pass it to check_msgid_msgstr_format.
* gettext-tools/src/msgmerge.c (silent_error_logger): Add a 'data' parameter.
(message_merge): Pass a null error_logger_data.
* gettext-tools/libgettextpo/gettext-po.c (po_error_logger): Add a 'data'
parameter.
(po_message_check_format): Pass a null error_logger_data.

21 months agolibgettextpo: Remove static variable bullet_stack.
Bruno Haible [Sat, 11 Nov 2023 15:48:05 +0000 (16:48 +0100)] 
libgettextpo: Remove static variable bullet_stack.

* gettext-tools/src/xg-check.h: New file, extracted from
gettext-tools/src/msgl-check.h.
* gettext-tools/src/xg-check.c: New file, extracted from
gettext-tools/src/msgl-check.c.
* gettext-tools/src/msgl-check.h (syntax_check_message_list): Remove
declaration.
* gettext-tools/src/msgl-check.c: Don't include quote.h, sentence.h, unictype.h,
unistr.h.
(struct callback_arg, struct bullet_ty, struct bullet_stack_ty,
syntax_check_function): Remove types.
(bullet_stack, sc_funcs): Remove variables.
(syntax_check_ellipsis_unicode, syntax_check_space_ellipsis,
syntax_check_quote_unicode_callback, syntax_check_quote_unicode,
syntax_check_bullet_unicode, syntax_check_message, syntax_check_message_list):
Remove functions.
* gettext-tools/src/xgettext.c: Include xg-check.h instead of msgl-check.h.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add xg-check.h.
(xgettext_SOURCES): Add xg-check.c.
* gettext-tools/src/FILES: Mention xg-check.h, xg-check.c.
* gettext-tools/po/POTFILES.in: Add src/xg-check.c.

21 months agolibgettextpo: Remove static variable 'directory'.
Bruno Haible [Sat, 11 Nov 2023 15:48:00 +0000 (16:48 +0100)] 
libgettextpo: Remove static variable 'directory'.

* gettext-tools/src/read-catalog-file.h: New file, extracted from
gettext-tools/src/read-catalog.h.
* gettext-tools/src/read-catalog.h (read_catalog_file): Remove declaration.
* gettext-tools/src/read-catalog-file.c: New file, extracted from
gettext-tools/src/read-catalog.c.
* gettext-tools/src/read-catalog.c: Don't include open-catalog.h.
(read_catalog_file): Remove function.
* gettext-tools/src/msgl-cat.c: Include read-catalog-file.h instead of
read-catalog.h.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/FILES: Mention read-catalog-file.h, read-catalog-file.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add read-catalog-file.h.
(libgettextsrc_la_SOURCES): Add read-catalog-file.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Remove
dir-list.c, open-catalog.c.

21 months agobuild: Use $(PATH_SEPARATOR) as a path separator
KO Myung-Hun [Wed, 18 Oct 2023 14:32:44 +0000 (23:32 +0900)] 
build: Use $(PATH_SEPARATOR) as a path separator

':' is not a path separator on Windows and OS/2.

PATH_SEPARATOR is defined and AC_SUBSTed by Autoconf.

* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): Use
$(PATH_SEPARATOR) instead of ':'.

Copyright-paperwork-exempt: Yes

22 months agoxgettext: Mention last changes in NEWS.
Bruno Haible [Fri, 6 Oct 2023 15:38:41 +0000 (17:38 +0200)] 
xgettext: Mention last changes in NEWS.

* NEWS: Mention diagnostics changes.

22 months agoxgettext: Simplify code that emits diagnostics with error number.
Bruno Haible [Thu, 5 Oct 2023 21:04:32 +0000 (23:04 +0200)] 
xgettext: Simplify code that emits diagnostics with error number.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add xstrerror.
(GNULIB_MODULES_LIBGETTEXTPO_OTHER): Add strerror_r-posix.
* gettext-tools/src/x-csharp.c: Include xstrerror.h.
(phase2_getc): Invoke 'xstrerror' and 'if_error' instead of 'error'.
* gettext-tools/src/x-javascript.c: Include xstrerror.h.
(phase2_getc): Invoke 'xstrerror' and 'if_error' instead of 'error'.
* gettext-tools/src/x-python.c: Include xstrerror.h.
(phase2_getc): Invoke 'xstrerror' and 'if_error' instead of 'error'.

22 months agoxgettext: Simplify code that emits diagnostics.
Bruno Haible [Thu, 5 Oct 2023 12:30:20 +0000 (14:30 +0200)] 
xgettext: Simplify code that emits diagnostics.

Also, for Perl input, clarify some diagnostics as errors vs. warnings.

* gettext-tools/src/if-error.h: New file.
* gettext-tools/src/if-error.c: New file.
* gettext-tools/src/xg-mixed-string.c: Include if-error.h instead of
error-progname.h.
(mixed_string_buffer_append_lone_surrogate): Invoke 'if_error' instead of
'error'.
* gettext-tools/src/x-awk.c: Include if-error.h instead of error-progname.h.
(phase7_getc, x_awk_lex, extract_parenthesized): Invoke 'if_error' instead of
'error'.
* gettext-tools/src/x-c.c: Include if-error.h instead of error-progname.h.
(phase7_getc, phase5_get, extract_parenthesized): Invoke 'if_error' instead of
'error'.
* gettext-tools/src/x-csharp.c: Include if-error.h instead of error-progname.h.
(do_getc_unicode_escaped, accumulate_escaped, extract_parenthesized): Invoke
'if_error' instead of 'error'.
* gettext-tools/src/x-elisp.c: Include if-error.h instead of error-progname.h.
(do_getc_escaped, read_object): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-java.c: Include if-error.h instead of error-progname.h.
(accumulate_escaped, phase5_get, extract_parenthesized): Invoke 'if_error'
instead of 'error'.
* gettext-tools/src/x-javascript.c: Include if-error.h instead of
error-progname.h.
(phase7_getuc, phase5_scan_regexp, phase5_scan_xml_markup, phase5_get,
extract_balanced): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-librep.c: Include if-error.h instead of error-progname.h.
(read_object): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-lisp.c: Include if-error.h instead of error-progname.h.
(read_object): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-lua.c: Include if-error.h instead of error-progname.h.
(extract_balanced): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-perl.c: Include if-error.h instead of error-progname.h.
(get_here_document, extract_quotelike_pass3, interpolate_keywords, x_perl_lex,
extract_balanced): Invoke 'if_error' instead of 'error'.
(interpolate_keywords): Update extract_quotelike_pass3 invocations.
(extract_balanced): Update collect_message invocations. Call fflush before
abort (needed for MSVC).
* gettext-tools/src/x-php.c: Include if-error.h instead of error-progname.h.
(extract_balanced): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-python.c: Include if-error.h instead of error-progname.h.
(phase7_getuc, extract_balanced): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-rst.c: Include if-error.h instead of error-progname.h.
(extract_rst, extract_rsj): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-scheme.c: Include if-error.h instead of error-progname.h.
(read_object): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-sh.c: Include if-error.h instead of error-progname.h.
(read_word, read_command_list): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-tcl.c: Include if-error.h instead of error-progname.h.
(accumulate_word, read_word): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/x-vala.c: Include if-error.h instead of error-progname.h.
(phase7_getc, phase3_scan_regex, phase3_get, extract_balanced): Invoke
'if_error' instead of 'error'.
* gettext-tools/src/x-ycp.c: Include if-error.h instead of error-progname.h.
(extract_parenthesized): Invoke 'if_error' instead of 'error'.
* gettext-tools/src/xg-arglist-parser.c: Include if-error.h instead of error.h,
error-progname.h.
(arglist_parser_done): Invoke 'if_error' instead of 'error_at_line'.
* gettext-tools/src/xg-message.c: Include if-error.h instead of
error-progname.h.
(set_format_flags_from_context, warn_format_string, remember_a_message): Invoke
'if_error' instead of 'multiline_warning'.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add if-error.h.
(xgettext_SOURCES): Add if-error.c.
* gettext-tools/src/FILES: Mention if-error.h, if-error.c.
* gettext-tools/po/Makevars (XGETTEXT_OPTIONS): Add option regarding the
'if_error' function.
* gettext-tools/po/POTFILES.in: Add src/if-error.c.

22 months agoxgettext: Clarify some diagnostics as errors vs. warnings.
Bruno Haible [Thu, 5 Oct 2023 06:20:50 +0000 (08:20 +0200)] 
xgettext: Clarify some diagnostics as errors vs. warnings.

* gettext-tools/src/x-csharp.c (phase2_getc): Clarify role of diagnostics.
* gettext-tools/src/x-javascript.c (phase2_getc): Likewise.
* gettext-tools/src/x-perl.c (get_here_document, extract_balanced): Likewise.
* gettext-tools/src/x-python.c (phase2_getc): Likewise.
* gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Likewise.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Likewise.

22 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 7 Oct 2023 12:54:50 +0000 (14:54 +0200)] 
Update to the newest gnulib.

22 months agoAvoid possible problems in C++ mode.
Bruno Haible [Wed, 4 Oct 2023 20:48:31 +0000 (22:48 +0200)] 
Avoid possible problems in C++ mode.

* gettext-tools/src/po-xerror.h: Move the #include outside the extern "C" {...}
block.

22 months agoAvoid crash by SIGFPE during plural form expression evaluation.
Bruno Haible [Sun, 1 Oct 2023 18:18:23 +0000 (20:18 +0200)] 
Avoid crash by SIGFPE during plural form expression evaluation.

Libraries (such as libintl and libgettextpo) should not raise signals, because
catching such signals cannot be done in a multithread-safe way.

* gettext-runtime/intl/plural-exp.h (enum eval_status): New enum items
PE_INTDIV, PE_INTOVF.
* gettext-runtime/intl/eval-plural.h (plural_eval_recurse): When a division
argument is zero, return status PE_INTDIV instead of raising SIGFPE.
* gettext-runtime/intl/dcigettext.c (INTDIV0_RAISES_SIGFPE): Remove macro.
Don't include <signal.h>.
* gettext-runtime/intl/configure.ac: Don't invoke gt_INTDIV0.
* gettext-runtime/intl/m4/intdiv0.m4: Remove file.
* gettext-runtime/intl/Makefile.am (ACLOCAL_AMFLAGS): Remove option '-I m4'.
(EXTRA_DIST): Remove m4/intdiv0.m4.
* autogen.sh: When invoking aclocal in gettext-runtime/intl, omit option
'-I m4'.

* gettext-tools/src/msgl-check.c: Don't include <setjmp.h>, <signal.h>.
(plural_expression_histogram): Don't invoke install_sigfpe_handler,
uninstall_sigfpe_handler.
(check_plural_eval): Don't invoke setjmp, install_sigfpe_handler,
uninstall_sigfpe_handler. Remove 'volatile' from array variable.
Produce error message when status PE_INTDIV or PE_INTOVF occurred.
* gettext-tools/src/plural-eval.h: Don't include <setjmp.h>.
(sigjmp_buf, sigsetjmp, siglongjmp): Remove definitions.
(USE_SIGINFO): Remove macro.
(sigfpe_exit, sigfpe_code, install_sigfpe_handler, uninstall_sigfpe_handler):
Remove declarations.
* gettext-tools/src/plural-eval.c: Don't include <signal.h>.
(sigfpe_exit, sigfpe_code): Remove variables.
(sigfpe_handler, install_sigfpe_handler, uninstall_sigfpe_handler): Remove
functions.
* gettext-tools/configure.ac: Don't invoke gt_SIGINFO.
* gettext-tools/m4/siginfo.m4: Remove file.
* gettext-tools/m4/Makefile.am (EXTRA_DIST): Remove it.

22 months agotests: Check against SIGFPE signal during plural expression evaluation.
Bruno Haible [Sun, 1 Oct 2023 18:18:17 +0000 (20:18 +0200)] 
tests: Check against SIGFPE signal during plural expression evaluation.

* gettext-tools/tests/plural-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

22 months agoAvoid crash by stack overflow during plural expression evaluation.
Bruno Haible [Sun, 1 Oct 2023 18:18:12 +0000 (20:18 +0200)] 
Avoid crash by stack overflow during plural expression evaluation.

* gettext-runtime/intl/plural-exp.h (enum eval_status, struct eval_result): New
types.
(plural_eval): Change return type to 'struct eval_result'.
* gettext-runtime/intl/eval-plural.h (EVAL_MAXDEPTH, OK): New macros.
(plural_eval_recurse): New function, extracted from plural_eval.
(plural_eval): Change return type to 'struct eval_result'. Invoke
plural_eval_recurse.
* gettext-runtime/intl/dcigettext.c (plural_lookup): Update.
* gettext-tools/src/plural-eval.h: Update comment.
* gettext-tools/src/msgl-check.c (plural_expression_histogram): Update.
(check_plural_eval): Update. Fail with an error message if the plural expression
evaluation produced a stack overflow.
* gettext-tools/tests/plural-3: Update.

22 months agotests: Check against stack overflow during plural expression evaluation.
Bruno Haible [Sun, 1 Oct 2023 18:18:06 +0000 (20:18 +0200)] 
tests: Check against stack overflow during plural expression evaluation.

* gettext-tools/tests/plural-1: Add comment.
* gettext-tools/tests/plural-2: Add comment.
* gettext-tools/tests/plural-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

22 months agotests: Add option --thread to tstgettext, tstngettext.
Bruno Haible [Sun, 1 Oct 2023 18:18:02 +0000 (20:18 +0200)] 
tests: Add option --thread to tstgettext, tstngettext.

* gettext-tools/tests/tstgettext.c: Include glthread/thread.h.
(inhibit_added_newline, do_expand): Remove variables.
(long_options): Add --thread option.
(struct worker_context): New type.
(main): Move some local variables into a context. Recognize option --thread.
At the end, invoke worker_thread.
(worker_thread): New function, extracted from main.
* gettext-tools/tests/tstngettext.c: Include glthread/thread.h.
(long_options): Add --thread option.
(struct worker_context): New type.
(main): Move some local variables into a context. Recognize option --thread.
At the end, invoke worker_thread.
(worker_thread): New function, extracted from main.
* gettext-tools/tests/Makefile.am (tstgettext_LDADD, tstngettext_LDADD): Add
gnulib-lib/libtestsgnu.a and $(LIBMULTITHREAD).

22 months agobuild: Use a separate gnulib-tool invocation for gettext-tools/tests/.
Bruno Haible [Sun, 1 Oct 2023 18:17:58 +0000 (20:17 +0200)] 
build: Use a separate gnulib-tool invocation for gettext-tools/tests/.

* autogen.sh (GNULIB_MODULES_LIBGETTEXTLIB, GNULIB_MODULES_TOOLS_TESTS): New
variables.
Add a gnulib-tool invocation for gettext-tools/tests/gnulib-{m4,lib}.
Add option -I tests/gnulib-m4 when generating gettext-tools/configure.
* gettext-tools/tests/gnulib-lib/Makefile.am: New file.
* gettext-tools/tests/Makefile.am (SUBDIRS): New variable.
(AM_CPPFLAGS): Add more -I options.
(EXTRA_DIST): Add gnulib-m4/gnulib-cache.m4.
* gettext-tools/Makefile.am (ACLOCAL_AMFLAGS): Add -I tests/gnulib-m4.
* gettext-tools/configure.ac: Invoke gttgl_EARLY and gttgl_INIT. Add an
AC_CONFIG_FILES of tests/gnulib-lib/Makefile.

22 months agobuild: Remove redundant -I options from AM_CPPFLAGS.
Bruno Haible [Sun, 1 Oct 2023 18:16:36 +0000 (20:16 +0200)] 
build: Remove redundant -I options from AM_CPPFLAGS.

https://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
documents that -I. -I$(srcdir) and -I$(top_builddir) (for config.h)
are already part of Automake's $(DEFAULT_INCLUDES), which is used
before $(AM_CPPFLAGS).

* gettext-runtime/src/Makefile.am (AM_CPPFLAGS): Remove redundant -I options.
* gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/libgettextpo/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/libgrep/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/src/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/system-tests/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-tools/tests/Makefile.am (AM_CPPFLAGS): Likewise.
* libtextstyle/adhoc-tests/Makefile.am (AM_CPPFLAGS): Likewise.
* libtextstyle/lib/Makefile.am (AM_CPPFLAGS): Likewise.
* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Add comment.
* gettext-runtime/libasprintf/Makefile.am (AM_CPPFLAGS): Likewise.

22 months agobuild: Remove unused -I options from AM_CPPFLAGS.
Bruno Haible [Sun, 1 Oct 2023 10:55:46 +0000 (12:55 +0200)] 
build: Remove unused -I options from AM_CPPFLAGS.

* gnulib-local/modules/gettext-runtime-misc (Makefile.am): Remove
-I$(top_srcdir)/intl from AM_CPPFLAGS.
* gettext-runtime/tests/Makefile.am (AM_CPPFLAGS): Set to empty.
* gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Remove
-I$(top_srcdir)/../gettext-runtime/intl.
* gettext-tools/gnulib-tests/Makefile.am (AM_CPPFLAGS): Update comment.
* gettext-tools/src/Makefile.am (AM_CPPFLAGS): Add comment.
* gettext-tools/libgettextpo/Makefile.am (AM_CPPFLAGS): Likewise.
* libtextstyle/lib/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir).