Mercurial > hg > octave-shane > gnulib-hg
annotate m4/duplocale.m4 @ 17252:7a29ec33d6c5
missing @item
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Tue, 01 Jan 2013 09:17:08 -0800 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
14933
45dddbc362fb
duplocale: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14685
diff
changeset
|
1 # duplocale.m4 serial 7 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. |
12342 | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | |
5 dnl with or without modifications, as long as this notice is preserved. | |
6 | |
7 AC_DEFUN([gl_FUNC_DUPLOCALE], | |
8 [ | |
9 AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) | |
10 AC_REQUIRE([AC_CANONICAL_HOST]) | |
11 AC_CHECK_FUNCS_ONCE([duplocale]) | |
12 if test $ac_cv_func_duplocale = yes; then | |
13 dnl Check against glibc bug where duplocale crashes. | |
14 dnl See <http://sourceware.org/bugzilla/show_bug.cgi?id=10969>. | |
13509
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
15 dnl Also, on AIX 7.1, duplocale(LC_GLOBAL_LOCALE) returns (locale_t)0 with |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
16 dnl errno set to EINVAL. |
12342 | 17 AC_REQUIRE([gl_LOCALE_H]) |
18 AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works], | |
19 [gl_cv_func_duplocale_works], | |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13509
diff
changeset
|
20 [AC_RUN_IFELSE( |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13509
diff
changeset
|
21 [AC_LANG_SOURCE([[ |
12342 | 22 #include <locale.h> |
23 #if HAVE_XLOCALE_H | |
24 # include <xlocale.h> | |
25 #endif | |
26 int main () | |
27 { | |
13509
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
28 if (duplocale (LC_GLOBAL_LOCALE) == (locale_t)0) |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
29 return 1; |
12342 | 30 return 0; |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13509
diff
changeset
|
31 }]])], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13509
diff
changeset
|
32 [gl_cv_func_duplocale_works=yes], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13509
diff
changeset
|
33 [gl_cv_func_duplocale_works=no], |
13885 | 34 [dnl Guess it works except on glibc < 2.12, uClibc, and AIX. |
13509
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
35 case "$host_os" in |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
36 aix*) gl_cv_func_duplocale_works="guessing no";; |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
37 *-gnu*) |
13885 | 38 AC_EGREP_CPP([Unlucky], [ |
12342 | 39 #include <features.h> |
40 #ifdef __GNU_LIBRARY__ | |
41 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12) | |
42 Unlucky GNU user | |
43 #endif | |
44 #endif | |
13885 | 45 #ifdef __UCLIBC__ |
46 Unlucky user | |
47 #endif | |
13509
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
48 ], |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
49 [gl_cv_func_duplocale_works="guessing no"], |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
50 [gl_cv_func_duplocale_works="guessing yes"]) |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
51 ;; |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
52 *) gl_cv_func_duplocale_works="guessing yes";; |
a7655f9a621f
duplocale: Work around AIX 7.1 bug.
Bruno Haible <bruno@clisp.org>
parents:
12935
diff
changeset
|
53 esac |
12342 | 54 ]) |
55 ]) | |
56 case "$gl_cv_func_duplocale_works" in | |
57 *no) REPLACE_DUPLOCALE=1 ;; | |
58 esac | |
12935
3e591f7f34d8
locale: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
59 else |
3e591f7f34d8
locale: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
60 HAVE_DUPLOCALE=0 |
12342 | 61 fi |
62 ]) | |
63 | |
64 # Prerequisites of lib/duplocale.c. | |
65 AC_DEFUN([gl_PREREQ_DUPLOCALE], | |
66 [ | |
67 : | |
68 ]) |