summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2016-05-26 13:38:57 +0900
committerDaiki Ueno <ueno@gnu.org>2016-05-27 17:39:22 +0900
commitb67399b40bc5bf3165b09e6a095ec941d4b30a97 (patch)
treede31b6d530001b82cf52b688f942d7db49d547bb
parent34feee233ae4d66b2e1658159e5319ded111e97b (diff)
downloadexternal_gettext-b67399b40bc5bf3165b09e6a095ec941d4b30a97.zip
external_gettext-b67399b40bc5bf3165b09e6a095ec941d4b30a97.tar.gz
external_gettext-b67399b40bc5bf3165b09e6a095ec941d4b30a97.tar.bz2
m4: Rely less on internal symbols
* gettext-runtime/m4/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. Problem reported and fix suggested by Masanori Ogino in: https://lists.gnu.org/archive/html/bug-gettext/2016-04/msg00000.html The rationale behind this is: (1) those symbol checks are for detecting certain broken implementations, namely NetBSD and Solaris 7, and (2) __GNU_GETTEXT_SUPPORTED_REVISION is not defined in those implementations, while it is defined on compatible implementations, such as musl-libc which doesn't have those internal symbols.
-rw-r--r--gettext-runtime/m4/gettext.m429
1 files changed, 22 insertions, 7 deletions
diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4
index 1f6979a..eef5073 100644
--- a/gettext-runtime/m4/gettext.m4
+++ b/gettext-runtime/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 67 (gettext-0.19.6)
+# gettext.m4 serial 68 (gettext-0.19.8)
dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -161,13 +161,18 @@ changequote([,])dnl
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
-$gt_revision_test_code
+#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
+$gt_revision_test_code
]],
[[
bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
]])],
[eval "$gt_func_gnugettext_libc=yes"],
[eval "$gt_func_gnugettext_libc=no"])])
@@ -193,17 +198,22 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
]],
[[
bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
]])],
[eval "$gt_func_gnugettext_libintl=yes"],
[eval "$gt_func_gnugettext_libintl=no"])
@@ -214,17 +224,22 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
]],
[[
bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
]])],
[LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV"