[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.
This commit is contained in:
+35
-17
@@ -128,6 +128,13 @@ AC_DEFUN([AM_GNU_GETTEXT],
|
|||||||
|
|
||||||
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
|
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
|
||||||
[AC_TRY_LINK([#include <libintl.h>
|
[AC_TRY_LINK([#include <libintl.h>
|
||||||
|
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||||
|
extern int _nl_msg_cat_cntr;
|
||||||
|
extern int *_nl_domain_bindings;
|
||||||
|
#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
|
||||||
|
#else
|
||||||
|
#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
|
||||||
|
#endif
|
||||||
]ifelse([$2], [need-formatstring-macros],
|
]ifelse([$2], [need-formatstring-macros],
|
||||||
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
||||||
@@ -135,10 +142,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
|
|||||||
changequote(,)dnl
|
changequote(,)dnl
|
||||||
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
||||||
changequote([,])dnl
|
changequote([,])dnl
|
||||||
], [])[extern int _nl_msg_cat_cntr;
|
], []),
|
||||||
extern int *_nl_domain_bindings;],
|
|
||||||
[bindtextdomain ("", "");
|
[bindtextdomain ("", "");
|
||||||
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
|
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
|
||||||
gt_cv_func_gnugettext_libc=yes,
|
gt_cv_func_gnugettext_libc=yes,
|
||||||
gt_cv_func_gnugettext_libc=no)])
|
gt_cv_func_gnugettext_libc=no)])
|
||||||
|
|
||||||
@@ -160,6 +166,17 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
|
|||||||
LIBS="$LIBS $LIBINTL"
|
LIBS="$LIBS $LIBINTL"
|
||||||
dnl Now see whether libintl exists and does not depend on libiconv.
|
dnl Now see whether libintl exists and does not depend on libiconv.
|
||||||
AC_TRY_LINK([#include <libintl.h>
|
AC_TRY_LINK([#include <libintl.h>
|
||||||
|
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||||
|
extern int _nl_msg_cat_cntr;
|
||||||
|
extern
|
||||||
|
#ifdef __cplusplus
|
||||||
|
"C"
|
||||||
|
#endif
|
||||||
|
const char *_nl_expand_alias ();
|
||||||
|
#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (0))
|
||||||
|
#else
|
||||||
|
#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
|
||||||
|
#endif
|
||||||
]ifelse([$2], [need-formatstring-macros],
|
]ifelse([$2], [need-formatstring-macros],
|
||||||
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
||||||
@@ -167,20 +184,26 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
|
|||||||
changequote(,)dnl
|
changequote(,)dnl
|
||||||
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
||||||
changequote([,])dnl
|
changequote([,])dnl
|
||||||
], [])[extern int _nl_msg_cat_cntr;
|
], []),
|
||||||
extern
|
|
||||||
#ifdef __cplusplus
|
|
||||||
"C"
|
|
||||||
#endif
|
|
||||||
const char *_nl_expand_alias ();],
|
|
||||||
[bindtextdomain ("", "");
|
[bindtextdomain ("", "");
|
||||||
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
|
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
|
||||||
gt_cv_func_gnugettext_libintl=yes,
|
gt_cv_func_gnugettext_libintl=yes,
|
||||||
gt_cv_func_gnugettext_libintl=no)
|
gt_cv_func_gnugettext_libintl=no)
|
||||||
dnl Now see whether libintl exists and depends on libiconv.
|
dnl Now see whether libintl exists and depends on libiconv.
|
||||||
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
|
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
|
||||||
LIBS="$LIBS $LIBICONV"
|
LIBS="$LIBS $LIBICONV"
|
||||||
AC_TRY_LINK([#include <libintl.h>
|
AC_TRY_LINK([#include <libintl.h>
|
||||||
|
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||||
|
extern int _nl_msg_cat_cntr;
|
||||||
|
extern
|
||||||
|
#ifdef __cplusplus
|
||||||
|
"C"
|
||||||
|
#endif
|
||||||
|
const char *_nl_expand_alias ();
|
||||||
|
#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (0))
|
||||||
|
#else
|
||||||
|
#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
|
||||||
|
#endif
|
||||||
]ifelse([$2], [need-formatstring-macros],
|
]ifelse([$2], [need-formatstring-macros],
|
||||||
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
|
||||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
|
||||||
@@ -188,14 +211,9 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
|
|||||||
changequote(,)dnl
|
changequote(,)dnl
|
||||||
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
|
||||||
changequote([,])dnl
|
changequote([,])dnl
|
||||||
], [])[extern int _nl_msg_cat_cntr;
|
], []),
|
||||||
extern
|
|
||||||
#ifdef __cplusplus
|
|
||||||
"C"
|
|
||||||
#endif
|
|
||||||
const char *_nl_expand_alias ();],
|
|
||||||
[bindtextdomain ("", "");
|
[bindtextdomain ("", "");
|
||||||
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
|
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
|
||||||
[LIBINTL="$LIBINTL $LIBICONV"
|
[LIBINTL="$LIBINTL $LIBICONV"
|
||||||
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
|
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
|
||||||
gt_cv_func_gnugettext_libintl=yes
|
gt_cv_func_gnugettext_libintl=yes
|
||||||
|
|||||||
Reference in New Issue
Block a user