summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-06-13 22:24:06 -0400
committerJeff Law <jeffreyalaw@gmail.com>2021-06-13 22:26:03 -0400
commit3a01d8eec23091dc24c2fb14a621ea92a262ff50 (patch)
treec40e829823873400ef6f92ad110318e1e7f59e6a /config
parentDaily bump. (diff)
downloadgcc-3a01d8eec23091dc24c2fb14a621ea92a262ff50.tar.gz
gcc-3a01d8eec23091dc24c2fb14a621ea92a262ff50.tar.bz2
gcc-3a01d8eec23091dc24c2fb14a621ea92a262ff50.tar.xz
[PATCH] config: Backport "Rely less on internal symbols" (serial 69) to gettext.m4
config * gettext.m4 (AM_GNU_GETTEXT): Skip checks for the internal symbols _nl_msg_cat_cntr, _nl_domain_bindings, and _nl_expand_alias, if __GNU_GETTEXT_SUPPORTED_REVISION is defined. Backport of gettext serial 68 patch.
Diffstat (limited to 'config')
-rw-r--r--config/gettext.m452
1 files changed, 35 insertions, 17 deletions
diff --git a/config/gettext.m4 b/config/gettext.m4
index 45fa6b4ab76..5b42bb16523 100644
--- a/config/gettext.m4
+++ b/config/gettext.m4
@@ -128,6 +128,13 @@ AC_DEFUN([AM_GNU_GETTEXT],
128 128
129 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, 129 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
130 [AC_TRY_LINK([#include <libintl.h> 130 [AC_TRY_LINK([#include <libintl.h>
131#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
132extern int _nl_msg_cat_cntr;
133extern int *_nl_domain_bindings;
134#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
135#else
136#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
137#endif
131]ifelse([$2], [need-formatstring-macros], 138]ifelse([$2], [need-formatstring-macros],
132[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION 139[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
133#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) 140#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
@@ -135,10 +142,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
135changequote(,)dnl 142changequote(,)dnl
136typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; 143typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
137changequote([,])dnl 144changequote([,])dnl
138], [])[extern int _nl_msg_cat_cntr; 145], []),
139extern int *_nl_domain_bindings;],
140 [bindtextdomain ("", ""); 146 [bindtextdomain ("", "");
141return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], 147return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
142 gt_cv_func_gnugettext_libc=yes, 148 gt_cv_func_gnugettext_libc=yes,
143 gt_cv_func_gnugettext_libc=no)]) 149 gt_cv_func_gnugettext_libc=no)])
144 150
@@ -160,6 +166,17 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
160 LIBS="$LIBS $LIBINTL" 166 LIBS="$LIBS $LIBINTL"
161 dnl Now see whether libintl exists and does not depend on libiconv. 167 dnl Now see whether libintl exists and does not depend on libiconv.
162 AC_TRY_LINK([#include <libintl.h> 168 AC_TRY_LINK([#include <libintl.h>
169#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
170extern int _nl_msg_cat_cntr;
171extern
172#ifdef __cplusplus
173"C"
174#endif
175const char *_nl_expand_alias ();
176#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (0))
177#else
178#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
179#endif
163]ifelse([$2], [need-formatstring-macros], 180]ifelse([$2], [need-formatstring-macros],
164[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION 181[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
165#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) 182#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
@@ -167,20 +184,26 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
167changequote(,)dnl 184changequote(,)dnl
168typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; 185typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
169changequote([,])dnl 186changequote([,])dnl
170], [])[extern int _nl_msg_cat_cntr; 187], []),
171extern
172#ifdef __cplusplus
173"C"
174#endif
175const char *_nl_expand_alias ();],
176 [bindtextdomain ("", ""); 188 [bindtextdomain ("", "");
177return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], 189return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
178 gt_cv_func_gnugettext_libintl=yes, 190 gt_cv_func_gnugettext_libintl=yes,
179 gt_cv_func_gnugettext_libintl=no) 191 gt_cv_func_gnugettext_libintl=no)
180 dnl Now see whether libintl exists and depends on libiconv. 192 dnl Now see whether libintl exists and depends on libiconv.
181 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then 193 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
182 LIBS="$LIBS $LIBICONV" 194 LIBS="$LIBS $LIBICONV"
183 AC_TRY_LINK([#include <libintl.h> 195 AC_TRY_LINK([#include <libintl.h>
196#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
197extern int _nl_msg_cat_cntr;
198extern
199#ifdef __cplusplus
200"C"
201#endif
202const char *_nl_expand_alias ();
203#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (0))
204#else
205#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
206#endif
184]ifelse([$2], [need-formatstring-macros], 207]ifelse([$2], [need-formatstring-macros],
185[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION 208[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
186#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) 209#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
@@ -188,14 +211,9 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
188changequote(,)dnl 211changequote(,)dnl
189typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; 212typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
190changequote([,])dnl 213changequote([,])dnl
191], [])[extern int _nl_msg_cat_cntr; 214], []),
192extern
193#ifdef __cplusplus
194"C"
195#endif
196const char *_nl_expand_alias ();],
197 [bindtextdomain ("", ""); 215 [bindtextdomain ("", "");
198return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], 216return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
199 [LIBINTL="$LIBINTL $LIBICONV" 217 [LIBINTL="$LIBINTL $LIBICONV"
200 LTLIBINTL="$LTLIBINTL $LTLIBICONV" 218 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
201 gt_cv_func_gnugettext_libintl=yes 219 gt_cv_func_gnugettext_libintl=yes