aboutsummaryrefslogtreecommitdiff
path: root/m4/intl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/intl.m4')
-rw-r--r--m4/intl.m487
1 files changed, 35 insertions, 52 deletions
diff --git a/m4/intl.m4 b/m4/intl.m4
index 42fac953..043176d0 100644
--- a/m4/intl.m4
+++ b/m4/intl.m4
@@ -1,15 +1,15 @@
1# intl.m4 serial 29 (gettext-0.19) 1# intl.m4 serial 44 (gettext-0.21)
2dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-2014, 2016-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
6dnl 6dnl
7dnl This file can be used in projects which are not available under 7dnl This file can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public 8dnl the GNU General Public License or the GNU Lesser General Public
9dnl License but which still want to provide support for the GNU gettext 9dnl License but which still want to provide support for the GNU gettext
10dnl functionality. 10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered 11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU 12dnl by the GNU Lesser General Public License, and the rest of the GNU
13dnl gettext package is covered by the GNU General Public License. 13dnl gettext package is covered by the GNU General Public License.
14dnl They are *not* in the public domain. 14dnl They are *not* in the public domain.
15 15
@@ -20,8 +20,7 @@ dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
20AC_PREREQ([2.60]) 20AC_PREREQ([2.60])
21 21
22dnl Checks for all prerequisites of the intl subdirectory, 22dnl Checks for all prerequisites of the intl subdirectory,
23dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, 23dnl except for LIBTOOL, USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
24dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
25AC_DEFUN([AM_INTL_SUBDIR], 24AC_DEFUN([AM_INTL_SUBDIR],
26[ 25[
27 AC_REQUIRE([AC_PROG_INSTALL])dnl 26 AC_REQUIRE([AC_PROG_INSTALL])dnl
@@ -29,7 +28,6 @@ AC_DEFUN([AM_INTL_SUBDIR],
29 AC_REQUIRE([AC_PROG_CC])dnl 28 AC_REQUIRE([AC_PROG_CC])dnl
30 AC_REQUIRE([AC_CANONICAL_HOST])dnl 29 AC_REQUIRE([AC_CANONICAL_HOST])dnl
31 AC_REQUIRE([gt_GLIBC2])dnl 30 AC_REQUIRE([gt_GLIBC2])dnl
32 AC_REQUIRE([AC_PROG_RANLIB])dnl
33 AC_REQUIRE([gl_VISIBILITY])dnl 31 AC_REQUIRE([gl_VISIBILITY])dnl
34 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl 32 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
35 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl 33 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
@@ -41,9 +39,26 @@ AC_DEFUN([AM_INTL_SUBDIR],
41 AC_REQUIRE([gl_GLIBC21])dnl 39 AC_REQUIRE([gl_GLIBC21])dnl
42 AC_REQUIRE([gl_XSIZE])dnl 40 AC_REQUIRE([gl_XSIZE])dnl
43 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl 41 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
42 AC_REQUIRE([gt_INTL_THREAD_LOCALE_NAME])
44 AC_REQUIRE([gt_INTL_MACOSX])dnl 43 AC_REQUIRE([gt_INTL_MACOSX])dnl
45 AC_REQUIRE([gl_EXTERN_INLINE])dnl 44 AC_REQUIRE([gl_EXTERN_INLINE])dnl
46 AC_REQUIRE([gt_GL_ATTRIBUTE])dnl 45 AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
46 AC_REQUIRE([AC_C_FLEXIBLE_ARRAY_MEMBER])dnl
47
48 dnl In projects that use gnulib, use gl_PROG_AR_RANLIB.
49 dnl The '][' hides this use from 'aclocal'.
50 m4_ifdef([g][l_PROG_AR_RANLIB],
51 [AC_REQUIRE([g][l_PROG_AR_RANLIB])],
52 [AC_REQUIRE([AC_PROG_RANLIB])
53 dnl Use Automake-documented default values for AR and ARFLAGS, but prefer
54 dnl ${host}-ar over ar (useful for cross-compiling).
55 AC_CHECK_TOOL([AR], [ar], [ar])
56 if test -z "$ARFLAGS"; then
57 ARFLAGS='cr'
58 fi
59 AC_SUBST([AR])
60 AC_SUBST([ARFLAGS])
61 ])
47 62
48 dnl Support for automake's --enable-silent-rules. 63 dnl Support for automake's --enable-silent-rules.
49 case "$enable_silent_rules" in 64 case "$enable_silent_rules" in
@@ -58,8 +73,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
58 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) 73 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
59 ]) 74 ])
60 AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h]) 75 AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
61 AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \ 76 AC_CHECK_FUNCS([asprintf wprintf newlocale putenv setenv \
62 snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) 77 snprintf strnlen uselocale wcslen wcsnlen mbrtowc wcrtomb])
63 78
64 dnl Use the _snprintf function only if it is declared (because on NetBSD it 79 dnl Use the _snprintf function only if it is declared (because on NetBSD it
65 dnl is defined as a weak alias of snprintf; we prefer to use the latter). 80 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
@@ -104,6 +119,13 @@ AC_DEFUN([AM_INTL_SUBDIR],
104 AM_LANGINFO_CODESET 119 AM_LANGINFO_CODESET
105 gt_LC_MESSAGES 120 gt_LC_MESSAGES
106 121
122 if test $gt_nameless_locales = yes; then
123 HAVE_NAMELESS_LOCALES=1
124 else
125 HAVE_NAMELESS_LOCALES=0
126 fi
127 AC_SUBST([HAVE_NAMELESS_LOCALES])
128
107 dnl Compilation on mingw and Cygwin needs special Makefile rules, because 129 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
108 dnl 1. when we install a shared library, we must arrange to export 130 dnl 1. when we install a shared library, we must arrange to export
109 dnl auxiliary pointer variables for every exported variable, 131 dnl auxiliary pointer variables for every exported variable,
@@ -135,18 +157,6 @@ AC_DEFUN([AM_INTL_SUBDIR],
135 AC_CHECK_TOOL([WINDRES], [windres]) 157 AC_CHECK_TOOL([WINDRES], [windres])
136 fi 158 fi
137 159
138 dnl Determine whether when creating a library, "-lc" should be passed to
139 dnl libtool or not. On many platforms, it is required for the libtool option
140 dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
141 dnl in the *.la files - makes it impossible to create multithreaded programs,
142 dnl because libtool also reorders the -lc to come before the -pthread, and
143 dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
144 case "$host_os" in
145 hpux*) LTLIBC="" ;;
146 *) LTLIBC="-lc" ;;
147 esac
148 AC_SUBST([LTLIBC])
149
150 dnl Rename some macros and functions used for locking. 160 dnl Rename some macros and functions used for locking.
151 AH_BOTTOM([ 161 AH_BOTTOM([
152#define __libc_lock_t gl_lock_t 162#define __libc_lock_t gl_lock_t
@@ -217,7 +227,6 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
217 AC_REQUIRE([AC_FUNC_MMAP])dnl 227 AC_REQUIRE([AC_FUNC_MMAP])dnl
218 AC_REQUIRE([gt_INTDIV0])dnl 228 AC_REQUIRE([gt_INTDIV0])dnl
219 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl 229 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
220 AC_REQUIRE([gt_INTTYPES_PRI])dnl
221 AC_REQUIRE([gl_LOCK])dnl 230 AC_REQUIRE([gl_LOCK])dnl
222 231
223 AC_LINK_IFELSE( 232 AC_LINK_IFELSE(
@@ -227,16 +236,9 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
227 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], 236 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
228 [Define to 1 if the compiler understands __builtin_expect.])]) 237 [Define to 1 if the compiler understands __builtin_expect.])])
229 238
230 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h]) 239 AC_CHECK_HEADERS([inttypes.h limits.h unistd.h sys/param.h])
231 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \ 240 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
232 stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \ 241 stpcpy strcasecmp strdup strtoul tsearch __fsetlocking])
233 argz_stringify argz_next __fsetlocking])
234
235 dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
236 dnl it nor the equivalent.
237 if test $ac_cv_func_uselocale = yes; then
238 AC_CHECK_FUNCS([getlocalename_l])
239 fi
240 242
241 dnl Use the *_unlocked functions only if they are declared. 243 dnl Use the *_unlocked functions only if they are declared.
242 dnl (because some of them were defined without being declared in Solaris 244 dnl (because some of them were defined without being declared in Solaris
@@ -248,33 +250,14 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
248 250
249 dnl intl/plural.c is generated from intl/plural.y. It requires bison, 251 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
250 dnl because plural.y uses bison specific features. It requires at least 252 dnl because plural.y uses bison specific features. It requires at least
251 dnl bison-2.7 for %define api.pure. 253 dnl bison-3.0 for %precedence.
252 dnl bison is only needed for the maintainer (who touches plural.y). But in 254 dnl bison is only needed for the maintainer (who touches plural.y). But in
253 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put 255 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
254 dnl the rule in general Makefile. Now, some people carelessly touch the 256 dnl the rule in general Makefile. Now, some people carelessly touch the
255 dnl files or have a broken "make" program, hence the plural.c rule will 257 dnl files or have a broken "make" program, hence the plural.c rule will
256 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not 258 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
257 dnl present or too old. 259 dnl present or too old.
258 AC_CHECK_PROGS([INTLBISON], [bison]) 260 gl_PROG_BISON([INTLBISON], [3.0])
259 if test -z "$INTLBISON"; then
260 ac_verc_fail=yes
261 else
262 dnl Found it, now check the version.
263 AC_MSG_CHECKING([version of bison])
264changequote(<<,>>)dnl
265 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
266 case $ac_prog_version in
267 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
268 2.[7-9]* | [3-9].*)
269changequote([,])dnl
270 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
271 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
272 esac
273 AC_MSG_RESULT([$ac_prog_version])
274 fi
275 if test $ac_verc_fail = yes; then
276 INTLBISON=:
277 fi
278]) 261])
279 262
280dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from 263dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from