summaryrefslogtreecommitdiffstats
path: root/gl/m4/intl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/intl.m4')
-rw-r--r--gl/m4/intl.m493
1 files changed, 51 insertions, 42 deletions
diff --git a/gl/m4/intl.m4 b/gl/m4/intl.m4
index 5e17fea..335b23c 100644
--- a/gl/m4/intl.m4
+++ b/gl/m4/intl.m4
@@ -1,5 +1,5 @@
1# intl.m4 serial 8 (gettext-0.17) 1# intl.m4 serial 17 (gettext-0.18)
2dnl Copyright (C) 1995-2007, 2009-2010 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-2009 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.
@@ -15,9 +15,9 @@ dnl They are *not* in the public domain.
15 15
16dnl Authors: 16dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. 17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006. 18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
19 19
20AC_PREREQ(2.52) 20AC_PREREQ([2.52])
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 INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@@ -40,14 +40,24 @@ AC_DEFUN([AM_INTL_SUBDIR],
40 AC_REQUIRE([gt_PRINTF_POSIX]) 40 AC_REQUIRE([gt_PRINTF_POSIX])
41 AC_REQUIRE([gl_GLIBC21])dnl 41 AC_REQUIRE([gl_GLIBC21])dnl
42 AC_REQUIRE([gl_XSIZE])dnl 42 AC_REQUIRE([gl_XSIZE])dnl
43 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
43 AC_REQUIRE([gt_INTL_MACOSX])dnl 44 AC_REQUIRE([gt_INTL_MACOSX])dnl
44 45
46 dnl Support for automake's --enable-silent-rules.
47 case "$enable_silent_rules" in
48 yes) INTL_DEFAULT_VERBOSITY=0;;
49 no) INTL_DEFAULT_VERBOSITY=1;;
50 *) INTL_DEFAULT_VERBOSITY=1;;
51 esac
52 AC_SUBST([INTL_DEFAULT_VERBOSITY])
53
45 AC_CHECK_TYPE([ptrdiff_t], , 54 AC_CHECK_TYPE([ptrdiff_t], ,
46 [AC_DEFINE([ptrdiff_t], [long], 55 [AC_DEFINE([ptrdiff_t], [long],
47 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) 56 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
48 ]) 57 ])
49 AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) 58 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
50 AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen]) 59 AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
60 snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
51 61
52 dnl Use the _snprintf function only if it is declared (because on NetBSD it 62 dnl Use the _snprintf function only if it is declared (because on NetBSD it
53 dnl is defined as a weak alias of snprintf; we prefer to use the latter). 63 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
@@ -78,6 +88,12 @@ AC_DEFUN([AM_INTL_SUBDIR],
78 HAVE_SNPRINTF=0 88 HAVE_SNPRINTF=0
79 fi 89 fi
80 AC_SUBST([HAVE_SNPRINTF]) 90 AC_SUBST([HAVE_SNPRINTF])
91 if test "$ac_cv_func_newlocale" = yes; then
92 HAVE_NEWLOCALE=1
93 else
94 HAVE_NEWLOCALE=0
95 fi
96 AC_SUBST([HAVE_NEWLOCALE])
81 if test "$ac_cv_func_wprintf" = yes; then 97 if test "$ac_cv_func_wprintf" = yes; then
82 HAVE_WPRINTF=1 98 HAVE_WPRINTF=1
83 else 99 else
@@ -146,22 +162,31 @@ AC_DEFUN([AM_INTL_SUBDIR],
146#define __libc_lock_lock_recursive gl_recursive_lock_lock 162#define __libc_lock_lock_recursive gl_recursive_lock_lock
147#define __libc_lock_unlock_recursive gl_recursive_lock_unlock 163#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
148#define glthread_in_use libintl_thread_in_use 164#define glthread_in_use libintl_thread_in_use
149#define glthread_lock_init libintl_lock_init 165#define glthread_lock_init_func libintl_lock_init_func
150#define glthread_lock_lock libintl_lock_lock 166#define glthread_lock_lock_func libintl_lock_lock_func
151#define glthread_lock_unlock libintl_lock_unlock 167#define glthread_lock_unlock_func libintl_lock_unlock_func
152#define glthread_lock_destroy libintl_lock_destroy 168#define glthread_lock_destroy_func libintl_lock_destroy_func
153#define glthread_rwlock_init libintl_rwlock_init 169#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
154#define glthread_rwlock_rdlock libintl_rwlock_rdlock 170#define glthread_rwlock_init_func libintl_rwlock_init_func
155#define glthread_rwlock_wrlock libintl_rwlock_wrlock 171#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
156#define glthread_rwlock_unlock libintl_rwlock_unlock 172#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
157#define glthread_rwlock_destroy libintl_rwlock_destroy 173#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
158#define glthread_recursive_lock_init libintl_recursive_lock_init 174#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
159#define glthread_recursive_lock_lock libintl_recursive_lock_lock 175#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
160#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock 176#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
161#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy 177#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
162#define glthread_once libintl_once 178#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
163#define glthread_once_call libintl_once_call 179#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
180#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
181#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
182#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
183#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
184#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
185#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
186#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
187#define glthread_once_func libintl_once_func
164#define glthread_once_singlethreaded libintl_once_singlethreaded 188#define glthread_once_singlethreaded libintl_once_singlethreaded
189#define glthread_once_multithreaded libintl_once_multithreaded
165]) 190])
166]) 191])
167 192
@@ -198,40 +223,24 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
198 AC_TRY_LINK( 223 AC_TRY_LINK(
199 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }], 224 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
200 [], 225 [],
201 [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1, 226 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
202 [Define to 1 if the compiler understands __builtin_expect.])]) 227 [Define to 1 if the compiler understands __builtin_expect.])])
203 228
204 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h]) 229 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
205 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \ 230 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
206 stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ 231 stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
207 argz_next __fsetlocking]) 232 argz_stringify argz_next __fsetlocking])
208 233
209 dnl Use the *_unlocked functions only if they are declared. 234 dnl Use the *_unlocked functions only if they are declared.
210 dnl (because some of them were defined without being declared in Solaris 235 dnl (because some of them were defined without being declared in Solaris
211 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built 236 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
212 dnl on Solaris 2.5.1 to run on Solaris 2.6). 237 dnl on Solaris 2.5.1 to run on Solaris 2.6).
213 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. 238 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
214 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>]) 239 gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
215 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>]) 240 gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
216 241
217 AM_ICONV 242 AM_ICONV
218 243
219 dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
220 dnl and a _NL_LOCALE_NAME macro always.
221 AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
222 [AC_TRY_LINK([#include <langinfo.h>
223#include <locale.h>],
224 [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
225 return !cs;
226 ],
227 gt_cv_nl_locale_name=yes,
228 gt_cv_nl_locale_name=no)
229 ])
230 if test $gt_cv_nl_locale_name = yes; then
231 AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
232 [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
233 fi
234
235 dnl intl/plural.c is generated from intl/plural.y. It requires bison, 244 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
236 dnl because plural.y uses bison specific features. It requires at least 245 dnl because plural.y uses bison specific features. It requires at least
237 dnl bison-1.26 because earlier versions generate a plural.c that doesn't 246 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
@@ -269,7 +278,7 @@ dnl gt_CHECK_DECL(FUNC, INCLUDES)
269dnl Check whether a function is declared. 278dnl Check whether a function is declared.
270AC_DEFUN([gt_CHECK_DECL], 279AC_DEFUN([gt_CHECK_DECL],
271[ 280[
272 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, 281 AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
273 [AC_TRY_COMPILE([$2], [ 282 [AC_TRY_COMPILE([$2], [
274#ifndef $1 283#ifndef $1
275 char *p = (char *) $1; 284 char *p = (char *) $1;