|
| 1 | +From 117664643b58b9db5227a14be580e9db10ed7573 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Kartatz <105828205+Kartatz@users.noreply.github.com> |
| 3 | +Date: Sun, 9 Aug 2026 18:21:52 +0000 |
| 4 | +Subject: [PATCH] texinfo: guard gettext setup calls with ENABLE_NLS |
| 5 | + |
| 6 | +bindtextdomain() and textdomain() are called unconditionally in |
| 7 | +makeinfo, info, texindex and install-info. When the build is |
| 8 | +configured with --disable-nls the bundled intl/libintl.a is not |
| 9 | +built, so these references are left undefined on hosts whose libc |
| 10 | +lacks gettext (e.g. Android's bionic), breaking the link. |
| 11 | + |
| 12 | +Guard the two calls with #ifdef ENABLE_NLS, which is only defined in |
| 13 | +config.h when --enable-nls (the default) is in effect, so the symbols |
| 14 | +are only referenced when libintl is actually available. |
| 15 | +--- |
| 16 | + texinfo/info/info.c | 2 ++ |
| 17 | + texinfo/makeinfo/makeinfo.c | 2 ++ |
| 18 | + texinfo/util/install-info.c | 2 ++ |
| 19 | + texinfo/util/texindex.c | 2 ++ |
| 20 | + 4 files changed, 8 insertions(+) |
| 21 | + |
| 22 | +diff --git a/texinfo/info/info.c b/texinfo/info/info.c |
| 23 | +index 22b831a..6c781c4 100644 |
| 24 | +--- a/texinfo/info/info.c |
| 25 | ++++ b/texinfo/info/info.c |
| 26 | +@@ -127,8 +127,10 @@ main (argc, argv) |
| 27 | + #endif |
| 28 | + |
| 29 | + /* Set the text message domain. */ |
| 30 | ++#ifdef ENABLE_NLS |
| 31 | + bindtextdomain (PACKAGE, LOCALEDIR); |
| 32 | + textdomain (PACKAGE); |
| 33 | ++#endif |
| 34 | + |
| 35 | + while (1) |
| 36 | + { |
| 37 | +diff --git a/texinfo/makeinfo/makeinfo.c b/texinfo/makeinfo/makeinfo.c |
| 38 | +index 3094a65..f06a27b 100644 |
| 39 | +--- a/texinfo/makeinfo/makeinfo.c |
| 40 | ++++ b/texinfo/makeinfo/makeinfo.c |
| 41 | +@@ -951,8 +951,10 @@ main (argc, argv) |
| 42 | + #endif |
| 43 | + |
| 44 | + /* Set the text message domain. */ |
| 45 | ++#ifdef ENABLE_NLS |
| 46 | + bindtextdomain (PACKAGE, LOCALEDIR); |
| 47 | + textdomain (PACKAGE); |
| 48 | ++#endif |
| 49 | + |
| 50 | + /* Parse argument flags from the input line. */ |
| 51 | + while ((c = getopt_long (argc, argv, "D:e:E:f:I:o:p:P:r:s:U:V", |
| 52 | +diff --git a/texinfo/util/install-info.c b/texinfo/util/install-info.c |
| 53 | +index 91b599d..3369865 100644 |
| 54 | +--- a/texinfo/util/install-info.c |
| 55 | ++++ b/texinfo/util/install-info.c |
| 56 | +@@ -438,8 +438,10 @@ main (argc, argv) |
| 57 | + #endif |
| 58 | + |
| 59 | + /* Set the text message domain. */ |
| 60 | ++#ifdef ENABLE_NLS |
| 61 | + bindtextdomain (PACKAGE, LOCALEDIR); |
| 62 | + textdomain (PACKAGE); |
| 63 | ++#endif |
| 64 | + |
| 65 | + while (1) |
| 66 | + { |
| 67 | +diff --git a/texinfo/util/texindex.c b/texinfo/util/texindex.c |
| 68 | +index 347cccb..4767602 100644 |
| 69 | +--- a/texinfo/util/texindex.c |
| 70 | ++++ b/texinfo/util/texindex.c |
| 71 | +@@ -177,8 +177,10 @@ main (argc, argv) |
| 72 | + #endif |
| 73 | + |
| 74 | + /* Set the text message domain. */ |
| 75 | ++#ifdef ENABLE_NLS |
| 76 | + bindtextdomain (PACKAGE, LOCALEDIR); |
| 77 | + textdomain (PACKAGE); |
| 78 | ++#endif |
| 79 | + |
| 80 | + /* Describe the kind of sorting to do. */ |
| 81 | + /* The first keyfield uses the first braced field and folds case. */ |
| 82 | +-- |
| 83 | +2.54.0 |
| 84 | + |
0 commit comments