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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_DUPLOCALE],
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 AC_REQUIRE([AC_CANONICAL_HOST])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 AC_CHECK_FUNCS_ONCE([duplocale])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 if test $ac_cv_func_duplocale = yes; then
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 dnl Check against glibc bug where duplocale crashes.
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 AC_REQUIRE([gl_LOCALE_H])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works],
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <locale.h>
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #if HAVE_XLOCALE_H
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 # include <xlocale.h>
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #endif
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 int main ()
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
87a95303747f Port to uClibc.
Bruno Haible <bruno@clisp.org>
parents: 13579
diff changeset
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
87a95303747f Port to uClibc.
Bruno Haible <bruno@clisp.org>
parents: 13579
diff changeset
38 AC_EGREP_CPP([Unlucky], [
12342
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #include <features.h>
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 #ifdef __GNU_LIBRARY__
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 Unlucky GNU user
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #endif
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 #endif
13885
87a95303747f Port to uClibc.
Bruno Haible <bruno@clisp.org>
parents: 13579
diff changeset
45 #ifdef __UCLIBC__
87a95303747f Port to uClibc.
Bruno Haible <bruno@clisp.org>
parents: 13579
diff changeset
46 Unlucky user
87a95303747f Port to uClibc.
Bruno Haible <bruno@clisp.org>
parents: 13579
diff changeset
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
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 ])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 ])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 case "$gl_cv_func_duplocale_works" in
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 *no) REPLACE_DUPLOCALE=1 ;;
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 fi
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 ])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 # Prerequisites of lib/duplocale.c.
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 AC_DEFUN([gl_PREREQ_DUPLOCALE],
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 [
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 :
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 ])