Paul Eggert wrote:
> I attempted to put gzip on a diet by installing the attached Gnulib 
> patches to remove some unnecessary dependencies

Patch 0001 does not work for me: gettext-h is documented in the GNU gettext
manual [1], and there it is used without any Autoconf macro. I don't want to
maintain two different versions of gettext.h, one that needs an Autoconf macro
(in Gnulib), and one that is standalone (in gettext).

Therefore I have to revert this change, finding a simpler way to remove the
gettext-h → locale-h dependency.

[1] 
https://www.gnu.org/software/gettext/manual/html_node/lib_002fgettext_002eh.html


2026-04-01  Bruno Haible  <[email protected]>

        gettext-h: Revert most of last change.
        * m4/gettext_h.m4 (gl_GETTEXT_H): Revert last change.
        * lib/gettext.h: Revert last change.
        (LC_MESSAGES): Define fallback like in locale.in.h.

diff --git a/lib/gettext.h b/lib/gettext.h
index ffe303f568..894d4d9652 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -177,31 +177,33 @@ dcgettext (const char *domain, const char *msgid, int 
category)
    short and rarely need to change.
    The letter 'p' stands for 'particular' or 'special'.  */
 
+#include <locale.h> /* for LC_MESSAGES */
+/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
+   On systems that don't define it, use the same value as GNU libintl.  */
+#if !defined LC_MESSAGES
+# define LC_MESSAGES 1729
+#endif
+
 #ifdef DEFAULT_TEXT_DOMAIN
 # define pgettext(Msgctxt, Msgid) \
-   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \
-                 Msgid, _GL_LC_MESSAGES)
+   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
 #else
 # define pgettext(Msgctxt, Msgid) \
-   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
_GL_LC_MESSAGES)
+   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
 #endif
 #define dpgettext(Domainname, Msgctxt, Msgid) \
-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \
-                Msgid, _GL_LC_MESSAGES)
+  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
 #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
 #ifdef DEFAULT_TEXT_DOMAIN
 # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
-   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \
-                  Msgid, MsgidPlural, N, _GL_LC_MESSAGES)
+   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
 #else
 # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
-   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \
-                  Msgid, MsgidPlural, N, _GL_LC_MESSAGES)
+   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
 #endif
 #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \
-                 Msgid, MsgidPlural, N, _GL_LC_MESSAGES)
+  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
 #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
 
@@ -271,9 +273,9 @@ npgettext_aux (const char *domain,
 #endif
 
 #define pgettext_expr(Msgctxt, Msgid) \
-  dcpgettext_expr (NULL, Msgctxt, Msgid, _GL_LC_MESSAGES)
+  dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
 #define dpgettext_expr(Domainname, Msgctxt, Msgid) \
-  dcpgettext_expr (Domainname, Msgctxt, Msgid, _GL_LC_MESSAGES)
+  dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
 
 #if defined __GNUC__ || defined __clang__
 __inline
@@ -317,9 +319,9 @@ dcpgettext_expr (const char *domain,
 }
 
 #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
-  dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, _GL_LC_MESSAGES)
+  dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
 #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
-  dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, 
_GL_LC_MESSAGES)
+  dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
 
 #if defined __GNUC__ || defined __clang__
 __inline
diff --git a/m4/gettext_h.m4 b/m4/gettext_h.m4
index 26546bef5d..7fa8926cae 100644
--- a/m4/gettext_h.m4
+++ b/m4/gettext_h.m4
@@ -1,5 +1,5 @@
 # gettext_h.m4
-# serial 2
+# serial 3
 dnl Copyright (C) 2025-2026 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,15 +10,6 @@ AC_DEFUN_ONCE([gl_GETTEXT_H]
 [
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
-  AC_CACHE_CHECK([for LC_MESSAGES value], [gl_cv_val_LC_MESSAGES],
-    [AC_COMPUTE_INT([gl_cv_val_LC_MESSAGES],
-       [LC_MESSAGES],
-       [#include <locale.h>
-       ],
-       [# The value Gnulib uses when <locale.h> does not define LC_MESSAGES.
-        gl_cv_LC_MESSAGES=1729])])
-  AC_DEFINE_UNQUOTED([_GL_LC_MESSAGES], [$gl_cv_val_LC_MESSAGES],
-    [The value of LC_MESSAGES, or 1729 on hosts that lack it.])
   AH_BOTTOM([
 /* The text domainname for Gnulib messages.  Ordinarily this is "gnulib",
    but packages that do their own translations of Gnulib can use something




Reply via email to