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, 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 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, 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, 10 Dec 2020 16:01:43 +0000 (17:01 +0100)]
intl: Support the AIX 7 locale names.
* gettext-runtime/intl/explodename.c (_nl_find_language): Remove function.
(_nl_explode_name): Inline it here. On AIX, lowercase the language and map a
script identifier to a modifier.
* NEWS: Mention it.
Bruno Haible [Fri, 4 Dec 2020 21:49:27 +0000 (22:49 +0100)]
xgettext: Make --directory option work right with Ruby input files.
* gettext-tools/src/xgettext.c (extract_from_file_func): Add found_in_dir
argument.
(xgettext_find_file): Return also the directory that was used to find the file.
(extract_from_file): Pass the directory to the extractor.
* gettext-tools/src/x-ruby.h (extract_ruby): Add found_in_dir argument.
* gettext-tools/src/x-ruby.c (extract_ruby): Add found_in_dir argument. Pass the
logical_filename to rxgettext, and run rxgettext in the given directory.
* gettext-tools/tests/xgettext-16: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Sun, 6 Sep 2020 19:28:50 +0000 (21:28 +0200)]
Fix matching of languages in the LINGUAS environment variable.
Setting LINGUAS e.g. to "frs" should not cause fr.mo to get installed,
because Frisian is not a variant of French.
Reported by <arfrever.fta@gmail.com> in <https://savannah.gnu.org/bugs/?59062>.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS, AM_POSTPROCESS_PO_MAKEFILE): Don't
consider $desiredlang a variant of $presentlang unless it has the syntax of a
variant.
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 [Mon, 12 Sep 2022 23:28:06 +0000 (01:28 +0200)]
Update after gnulib changed: Fix link errors on MSVC.
* gettext-runtime/configure.ac: For the expansion of DLL_VARIABLE, test
WOE32DLL, not _DLL.
* gettext-tools/configure.ac: Set the module indicator variable
GL_GTPO_GNULIB_VFPRINTF to 0.
Bruno Haible [Mon, 12 Sep 2022 21:44:17 +0000 (23:44 +0200)]
Update after gnulib changed: Fix link errors of gettextpo-1-prg on mingw.
* gettext-tools/configure.ac: Set the module indicator variables
GL_GTPO_GNULIB_{PUTC,FPUTC,FPUTS,FWRITE,FPRINTF} to 0.
* gettext-tools/libgettextpo/Makefile.am (config.h): Undefine REPLACE_FCHDIR
that is defined in the parent config.h.
Bruno Haible [Mon, 12 Sep 2022 00:47:22 +0000 (02:47 +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 [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.
Bruno Haible [Mon, 12 Oct 2020 00:09:10 +0000 (02:09 +0200)]
Update after gnulib changed.
* autogen.sh: Don't copy attribute.h, as it would have the wrong copyright header.
* gettext-runtime/intl/attribute.h: New file, from gnulib.
* gettext-runtime/intl/thread-optim.h: New file, from gnulib.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Add thread-optim.h.
* Makefile.am (distcheck-hook): Check also thread-optim.h.
Bruno Haible [Tue, 28 Jul 2020 17:43:57 +0000 (19:43 +0200)]
Fix -export-symbols and -export-symbols-regex support on Solaris 11.3.
Apply fix from <https://savannah.gnu.org/patch/?9467>.
On Solaris 11.3 (as opposed to Solaris 11.0), the output of /usr/bin/nm -p
on object files contains, for global variables without initializer, the
letter 'C' (it was 'D' in Solaris 11.0).
* m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Adjust symcode for Solaris.
Bruno Haible [Sat, 14 Nov 2020 13:53:19 +0000 (14:53 +0100)]
build: Fix warnings emitted by autoconf-2.69d.
* gettext-tools/configure.ac: Use AC_LINK_IFELSE instead of AC_TRY_LINK. Don't
invoke AC_FUNC_VFORK.
* gettext-tools/m4/exported.m4 (gt_GLOBAL_SYMBOL_PIPE): Require LT_PATH_NM
instead of AC_PROG_NM.
* gnulib-local/m4/libxml.m4 (gl_LIBXML): Use AC_LINK_IFELSE instead of
AC_TRY_LINK. Use AC_PREPROC_IFELSE instead of AC_TRY_CPP.
* libtextstyle/configure.ac: Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER.
* libtextstyle/gnulib-local/m4/libcroco.m4 (gl_LIBCROCO): Use AC_LINK_IFELSE
instead of AC_TRY_LINK.
* libtextstyle/gnulib-local/m4/libglib.m4 (gl_LIBGLIB): Use AC_LINK_IFELSE
instead of AC_TRY_LINK. Require AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE.
* libtextstyle/gnulib-local/m4/termcap.m4 (gl_TERMCAP_BODY): Use AC_LINK_IFELSE
instead of AC_TRY_LINK.
* libtextstyle/gnulib-local/m4/terminfo.m4 (gl_TERMINFO_BODY): Use
AC_LINK_IFELSE instead of AC_TRY_LINK.
* m4/woe32-dll.m4 (gl_WOE32_DLL): Use AC_LINK_IFELSE instead of AC_TRY_LINK.