Bruno Haible [Sun, 25 Sep 2022 15:32:07 +0000 (17:32 +0200)]
Fix a link error on MSVC/clang in --enable-shared mode.
* gettext-runtime/intl/printf.c: Include libgnuintl.h. This ensures that the
LIBINTL_DLL_EXPORTED marker from the libintl_*printf function declarations is
seen when the functions get defined.
* gettext-runtime/intl/Makefile.am: Update comment.
Bruno Haible [Mon, 18 Jul 2022 16:56:46 +0000 (18:56 +0200)]
Move gnulib-tool invocation back from autopull.sh to autogen.sh.
* autogen.sh: Revert most of last change. Improve comments.
* autopull.sh: Only call 'gitsub.sh pull', fetch archive.dir.tar, and recurse.
* libtextstyle/autogen.sh: Revert most of last change. Improve comments.
* libtextstyle/autopull.sh: Only call 'gitsub.sh pull', fetch texinfo.tex.
* libtextstyle/m4/init-package-version.m4: Revert last change.
Bruno Haible [Sun, 17 Jul 2022 14:50:33 +0000 (16:50 +0200)]
Split autogen.sh into autopull.sh and autogen.sh.
* autopull.sh: New file, based on autogen.sh.
* autogen.sh: Remove code that was moved to autopull.sh. Remove --skip-gnulib
option.
* HACKING: Mention autopull.sh.
* libtextstyle/autopull.sh: New file, based on libtextstyle/autogen.sh.
* libtextstyle/autogen.sh: Remove code that was moved to
libtextstyle/autopull.sh. Remove --skip-gnulib option.
* libtextstyle/HACKING: Mention autopull.sh.
* libtextstyle/m4/init-package-version.m4: Update comment.
Bruno Haible [Sun, 17 Jul 2022 10:30:11 +0000 (12:30 +0200)]
Fix "make distcheck" failure (regression from 2022-07-03).
* gettext-runtime/intl/export.h: Add a copyright notice.
* gettext-runtime/intl/Makefile.am (libgnuintl.h): Eliminate this copyright
notice when including export.h.
Bruno Haible [Sun, 3 Jul 2022 14:21:52 +0000 (16:21 +0200)]
build: Fix link error for tstgettext.exe on mingw.
* gettext-runtime/intl/export.h: Treat mingw like MSVC. In static builds. don't
use __declspec(dllexport). In shared builds, use also __declspec(dllimport).
intl: On native Windows, actually define the *wprintf functions.
In dcaf8c4d7 (Cygwin portability., 2003-09-17), the *wprintf() family of
functions in `gettext-runtime/intl/printf.c` were no longer guarded by
the constant `HAVE_WPRINTF`, but instead by `HAVE_FWPRINTF`.
This apparently worked even if the corresponding part in
`gettext-runtime/intl/libgnuintl.h.in` uses `HAVE_WPRINTF` to guard the
declarations of those functions.
However, in d84f20745 (Make sure that libintl.h declares the *wprintf
overrides on Windows., 2019-04-08), gettext introduced a change where it
would look for `wprintf()` instead of `fwprintf()`. As a consequence it
would no longer define the `HAVE_FWPRINTF` constant at all.
GCC apparently interprets `#if HAVE_FWPRINTF` as `#if 0` if the constant
has not even been defined.
This leads to the funny situation that previously, the *wprintf()
functions would be defined, but not be declared. Whereas now the
functions are not defined, but declared.
Also funny: Cygwin did not even export the `fwprintf()` function until
2009, as per Cygwin's 45e20e47ba (cygwin.din: Export wprintf,
fwprintf, swprintf, vwprintf, vfwprintf, vswprintf. [...] , 2009-03-06),
while the `wprintf()` function was exported already in 2003. So the
Cygwin portability patch from 2003 seems to have turned off all of the
*wprintf() functions in gettext.
Let's revert that "portability" patch, as it now only does harm and has
no benefit anymore.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
[Bruno's summary]
Thank you for the analysis and explanation, Johannes!
The commits dcaf8c4d7 and f5ca7696d (2003-09-17) introduced a test for
fwprintf rather than wprintf. This was designed as a workaround to a
Cygwin problem that existed from 2003 to 2009.
The commit d84f20745 (2019-04-08) switched back from testing fwprintf
to testing wprintf, but did so incompletely: I forgot to modify printf.c.
So, since then, the *wprintf functions are declared but not defined.
Bruno Haible [Tue, 21 Jun 2022 00:50:34 +0000 (02:50 +0200)]
gettext-runtime: Provide helper script to build against uninstalled binaries.
Prompted by <https://gcc.gnu.org/pipermail/gcc/2022-June/238929.html>.
* gettext-runtime/uninstalled-config.sh.in: New file.
* gettext-runtime/configure.ac: New variable ENABLE_SHARED. Generate
uninstalled-config.sh at configure time.
Bruno Haible [Mon, 20 Jun 2022 06:56:18 +0000 (08:56 +0200)]
Don't check for java nor javac when --disable-java is specified.
This avoid annoying dialogs on macOS when Java has not been installed so far.
Reported by Iain Sandoe <idsandoe@googlemail.com> in
<https://gcc.gnu.org/pipermail/gcc/2022-June/238929.html>.
* gettext-runtime/configure.ac: When JAVA_CHOICE is 'no', bypass the gt_JAVACOMP
and JAR tests.
* gettext-tools/configure.ac: When JAVA_CHOICE is 'no', bypass the gt_JAVAEXEC,
gt_JAVACOMP, and JAR tests.
Bruno Haible [Sun, 22 May 2022 23:15:51 +0000 (01:15 +0200)]
Add GNU Project notice.
* JOIN-GNU: New file. Inspired by a suggestion from José E. Marchesi
on the gnu-prog-discuss mailing list.
* README: Refer to it.
* Makefile.am (EXTRA_DIST): Add it.
Bruno Haible [Sun, 2 Jan 2022 16:40:52 +0000 (17:40 +0100)]
xgettext: Deprecate option '--sort-output'.
Suggested by Lauri Nurmi <lanurmi@iki.fi> in
<https://savannah.gnu.org/bugs/?61249>.
* gettext-tools/src/xgettext.c (main): Warn when option '--sort-output' is used.
(usage): Mark the option '--sort-output' deprecated.
* gettext-tools/doc/xgettext.texi: Likewise.
* NEWS: Mention it.
Bruno Haible [Sun, 8 Aug 2021 00:08:43 +0000 (02:08 +0200)]
libtextstyle: Make gl_INIT_PACKAGE work with Automake >= 1.16.4.
Reported and analyzed by Nicole Mazzuca <mazzucan@outlook.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2021-08/msg00002.html>.
* m4/init-package-version.m4 (gl_INIT_PACKAGE): Use a new macro gl_INIT_EMPTY.
(gl_INIT_DUMMY): Expand to empty in two steps, via a new macro gl_INIT_DUMMY2.
Bruno Haible [Sun, 20 Jun 2021 01:47:17 +0000 (03:47 +0200)]
Improve conflict resolution between gnulib and libintl.h.
* gettext-runtime/intl/libgnuintl.in.h (fprintf, vfprintf, printf, vprintf,
sprintf, vsprintf, snprintf, vsnprintf, asprintf, vasprintf): Use Gnulib-
provided macros to test more reliably whether Gnulib overrides these functions.
Bruno Haible [Sun, 20 Jun 2021 12:19:39 +0000 (14:19 +0200)]
Update after gnulib changed.
Previously, different gnulib-tool invocations within the scope of the same
configure.ac interfered with each other (through the GNULIB_* indicator macros,
used in the generated .h files), and libgrep relied on it. Now, each gnulib-tool
invocation needs its own copy of the generated .h files, in particular locale.h.
Needed for the localeconv() override on native Windows.
* autogen.sh: When invoking gnulib-tool for libgrep, don't avoid 'locale' and
the other header file modules.
* gettext-tools/configure.ac: Set GL_GRGL_GNULIB_SETLOCALE_NULL to 1.
Bruno Haible [Sun, 20 Jun 2021 01:47:14 +0000 (03:47 +0200)]
Update after gnulib changed.
* gettext-runtime/libasprintf/autosprintf.cc: Include <config.h>. This is
needed because of these new gnulib module dependencies:
vasnprintf -> free-posix -> stdlib -> unistd,
and the generated unistd.h gets included indirectly by <string> on OpenBSD 6.7
and gives a #error "Please include config.h first."
Bruno Haible [Sun, 20 Jun 2021 01:43:54 +0000 (03:43 +0200)]
intl: Assume strtoul exists.
* gettext-runtime/intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Assume
HAVE_STRTOUL to be 1.
* gettext-runtime/m4/intl.m4 (gt_INTL_SUBDIR_CORE): Don't test for strtoul.
Bruno Haible [Sun, 20 Jun 2021 01:42:49 +0000 (03:42 +0200)]
build: Add a separate configure.ac in gettext-runtime/intl/.
* autogen.sh (GNULIB_MODULES_RUNTIME_OTHER): Remove bison. Instead, copy
bison.m4 explicitly.
Generate configure file also in gettext-runtime/intl/.
Do automake invocations top-down, not bottom-up.
* gettext-runtime/intl/Makefile.am (ACLOCAL_AMFLAGS, SUBDIRS): New variables.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Allow 'here' as INTLSYMBOL
argument.
* gettext-runtime/intl/configure.ac: New file, based on
gettext-runtime/configure.ac.
* gettext-runtime/intl/AUTHORS: New file.
* gettext-runtime/intl/NEWS: New file.
* gettext-runtime/intl/README: New file.
* gettext-runtime/intl/ABOUT-NLS: New file, copied from
gettext-runtime/ABOUT-NLS.
* gettext-runtime/intl/INSTALL: New file, copied from gettext-runtime/INSTALL.
* gettext-runtime/configure.ac: Define WINDRES. Pass third argument to
AM_GNU_GETTEXT. Remove conditionals USE_INCLUDED_LIBINTL,
BUILD_INCLUDED_LIBINTL, PRELOADABLE_LIBINTL. Invoke AC_CONFIG_SUBDIRS([intl]).
Don't create intl/Makefile from here.
* gettext-tools/configure.ac: Define WINDRES. Redefine __libc_lock_*, for use
in localealias.c. Invoke gt_GLIBC2.
Bruno Haible [Tue, 6 Apr 2021 23:37:51 +0000 (01:37 +0200)]
libtextstyle: Fix the set of exported symbols on Alpine Linux.
* libtextstyle/build-aux/join-v-1: New file, from GNU libunistring.
* libtextstyle/Makefile.am (EXTRA_DIST): Add it.
* libtextstyle/lib/Makefile.am (config.h): Use it instead of 'join -v 1'.
Bruno Haible [Sun, 4 Apr 2021 17:23:47 +0000 (19:23 +0200)]
msgcat: Handle protected file names with spaces.
* gettext-tools/src/msgl-cat.c: Include msgl-ofn.h.
(catenate_msgdomain_list): Handle references that contain file names with
spaces.
* gettext-tools/tests/msgcat-22: New file, based on
gettext-tools/tests/msgconv-8.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 4 Apr 2021 16:26:57 +0000 (18:26 +0200)]
msgconv: Handle protected file names with spaces.
* gettext-tools/src/po-charset.h (po_lex_isolate_start, po_lex_isolate_end): New
declarations.
* gettext-tools/src/po-charset.c (po_lex_isolate_start, po_lex_isolate_end): New
variables.
(po_lex_charset_init, po_lex_charset_set, po_lex_charset_close): Initialize
them.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export also po_lex_isolate_start,
po_lex_isolate_end.
* gettext-tools/src/read-catalog-abstract.c: Include <stdbool.h>, po-charset.h.
(po_parse_comment_filepos): Parse the syntax of file names surrounded by control
characters.
* gettext-tools/src/msgl-iconv.c: Include msgl-ofn.h.
(iconv_msgdomain_list): Signal error if the target encoding does not contain the
control characters needed for escaping file names with spaces.
* gettext-tools/tests/msgconv-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 4 Apr 2021 14:19:11 +0000 (16:19 +0200)]
xgettext: Protect file names with spaces through Unicode U+2068, U+2069.
* gettext-tools/src/pos.h: Include <stdbool.h>.
(pos_filename_has_spaces): New declaration.
* gettext-tools/src/pos.c: New file.
* gettext-tools/src/msgl-ofn.h: New file.
* gettext-tools/src/msgl-ofn.c: New file.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add msgl-ofn.h.
(COMMON_SOURCE): Add pos.c.
(libgettextsrc_la_SOURCES): Add msgl-ofn.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise.
* gettext-tools/src/write-catalog.h (struct catalog_output_format): Add field
requires_utf8_for_filenames_with_spaces.
* gettext-tools/src/xgettext.c: Include pos.h, msgl-ofn.h.
(finalize_header): Convert the message domain to UTF-8 also when some message
has file names with spaces.
* gettext-tools/src/write-po.h (message_print_comment_filepos): Add charset
parameter.
* gettext-tools/src/write-po.c: Include pos.h.
(message_print_comment_filepos): Add charset parameter. If a file name has
spaces, enclose it in U+2068 and U+2069 characters.
(message_print, message_print_obsolete, output_format_po): Update.
* gettext-tools/src/write-properties.c (write_message,
output_format_properties): Update.
* gettext-tools/src/write-stringtable.c (output_format_stringtable): Update.
* gettext-tools/tests/xgettext-17: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 28 Feb 2021 23:14:46 +0000 (00:14 +0100)]
Update DEPENDENCIES.
* DEPENDENCIES: Update info regarding libiconv. List pre-built package names.
Add awk as a normal dependency of a package with an Autoconf-generated configure
file.
* libtextstyle/DEPENDENCIES: Likewise.
Bruno Haible [Thu, 7 Jan 2021 22:15:05 +0000 (23:15 +0100)]
Update after gnulib changed.
* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Test
gt_localename_enhances_locale_funcs instead of gt_nameless_locales. Set
ENHANCE_LOCALE_FUNCS, not HAVE_NAMELESS_LOCALES.
* gettext-runtime/intl/Makefile.am (libgnuintl.h, libintl.h): Substitute
ENHANCE_LOCALE_FUNCS, not HAVE_NAMELESS_LOCALES.
* gettext-runtime/intl/libgnuintl.in.h: Test ENHANCE_LOCALE_FUNCS, not
HAVE_NAMELESS_LOCALES.
* gettext-runtime/intl/localename.c: Update from gnulib.
* gettext-runtime/m4/iconv.m4: Likewise.
Bruno Haible [Mon, 28 Dec 2020 13:05:05 +0000 (14:05 +0100)]
Update after gnulib changed: Fix link errors on native Windows.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC, GNULIB_MODULES_LIBGETTEXTPO): Add
strdup-posix.
Avoid the *-list-tests, since they reference a variable, leading to a problem
with --enable-shared.
* gettext-tools/libgettextpo/Makefile.am (config.h): Undefine GNULIB_GETCWD and
REPLACE_FCHDIR that are defined in the parent config.h.