From: Bruno Haible Date: Fri, 15 Sep 2023 21:06:11 +0000 (+0200) Subject: intl: Fix list of exported symbols (regression 2021-06-19). X-Git-Tag: v0.22.2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fa5a6a218d014bea77f3b60f3591ac709c32e9a;p=thirdparty%2Fgettext.git intl: Fix list of exported symbols (regression 2021-06-19). Reported by and Christian Weisgerber in and . Analyzed by Christian Weisgerber and Tijl Coosemans . * gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Set BUILDING_DLL. * gettext-runtime/intl/intl-compat.c: Update comments. --- diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am index 753e75e5f..2bed67b75 100644 --- a/gettext-runtime/intl/Makefile.am +++ b/gettext-runtime/intl/Makefile.am @@ -32,10 +32,12 @@ SUFFIXES = # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. +# -DBUILDING_DLL: Change expansion of DLL_EXPORTED macro. We're compiling +# a library. Exporting the relevant symbols is desired. AM_CPPFLAGS = \ -Ignulib-lib -I$(srcdir)/gnulib-lib \ -DLOCALEDIR=$(localedir_c_make) -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ - -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL + -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL if WOE32 # On mingw, disable the declarations of *printf functions as aliases to the diff --git a/gettext-runtime/intl/intl-compat.c b/gettext-runtime/intl/intl-compat.c index d141e0453..a33dacb7e 100644 --- a/gettext-runtime/intl/intl-compat.c +++ b/gettext-runtime/intl/intl-compat.c @@ -1,5 +1,4 @@ -/* intl-compat.c - Stub functions to call gettext functions from GNU gettext - Library. +/* Redirections from public function names to GNU libintl functions. Copyright (C) 1995, 2000-2003, 2005, 2023 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -23,15 +22,23 @@ /* @@ end of prolog @@ */ + /* This file redirects the gettext functions (without prefix) to those defined in the included GNU libintl library (with "libintl_" prefix). - It is compiled into libintl in order to make the AM_GNU_GETTEXT test - of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which - has the redirections primarily in the include file. - It is also compiled into libgnuintl so that libgnuintl.so can be used - as LD_PRELOADable library on glibc systems, to provide the extra - features that the functions in the libc don't have (namely, logging). */ - + It is compiled into libintl for three purposes: + * Packages that bind libintl into other programming languages + (Python, Perl, PHP, OCaml, Free Pascal Compiler, mailfromd's mail + filtering language, and many others) bind to the symbols without + prefix and at the linker level, i.e. without '#include '. + Only few packages bind to the symbols with "libintl_" prefix. + * On glibc systems, we want that existing and future features of + GNU gettext (such as the logging to $GETTEXT_LOG_UNTRANSLATED) + become available when the program is linked against -lintl or + when libintl.so is used LD_PRELOADable library. + * In order to make the AM_GNU_GETTEXT test of gettext <= 0.11.2 work + with the libintl library >= 0.11.3 which has the redirections + primarily in the include file. + */ #undef gettext #undef dgettext