annotate m4/duplocale.m4 @ 14685:f7f11056a86e

maint: remove useless REPLACE_*_H macros There are still a few modules, like iconv_h.m4, that still use older paradigms where GNULIB_POSIXCHECK is unsupported and where gl_REPLACE_<HEADER>_H is still essential. But since we are moving away from that style, I see no reason to keep the idiom for the modules that don't need it. * m4/arpa_inet_h.m4 (gl_REPLACE_ARPA_INET_H): Delete. * m4/dirent_h.m4 (gl_REPLACE_DIRENT_H): Likewise. * m4/locale_h.m4 (gl_REPLACE_LOCALE_H): Likewise. * m4/poll_h.m4 (gl_REPLACE_POLL_H): Likewise. * m4/spawn_h.m4 (gl_REPLACE_SPAWN_H): Likewise. * m4/sys_ioctl_h.m4 (gl_REPLACE_SYS_IOCTL_H): Likewise. * m4/wchar_h.m4 (gl_REPLACE_WCHAR_H): Likewise. * m4/btowc.m4: Update callers. * m4/dirfd.m4: Likewise. * m4/duplocale.m4: Likewise. * m4/fchdir.m4: Likewise. * m4/fdopendir.m4: Likewise. * m4/inet_ntop.m4: Likewise. * m4/inet_pton.m4: Likewise. * m4/ioctl.m4: Likewise. * m4/mbrlen.m4: Likewise. * m4/mbrtowc.m4: Likewise. * m4/mbsinit.m4: Likewise. * m4/mbsnrtowcs.m4: Likewise. * m4/mbsrtowcs.m4: Likewise. * m4/poll.m4: Likewise. * m4/setlocale.m4: Likewise. * m4/wcrtomb.m4: Likewise. * m4/wcsnrtombs.m4: Likewise. * m4/wcsrtombs.m4: Likewise. * m4/wctob.m4: Likewise. * m4/wcwidth.m4: Likewise. * modules/posix_spawn: Likewise. * modules/posix_spawn_file_actions_addclose: Likewise. * modules/posix_spawn_file_actions_adddup2: Likewise. * modules/posix_spawn_file_actions_addopen: Likewise. * modules/posix_spawn_file_actions_destroy: Likewise. * modules/posix_spawn_file_actions_init: Likewise. * modules/posix_spawnattr_destroy: Likewise. * modules/posix_spawnattr_getflags: Likewise. * modules/posix_spawnattr_getpgroup: Likewise. * modules/posix_spawnattr_getschedparam: Likewise. * modules/posix_spawnattr_getschedpolicy: Likewise. * modules/posix_spawnattr_getsigdefault: Likewise. * modules/posix_spawnattr_getsigmask: Likewise. * modules/posix_spawnattr_init: Likewise. * modules/posix_spawnattr_setflags: Likewise. * modules/posix_spawnattr_setpgroup: Likewise. * modules/posix_spawnattr_setschedparam: Likewise. * modules/posix_spawnattr_setschedpolicy: Likewise. * modules/posix_spawnattr_setsigdefault: Likewise. * modules/posix_spawnattr_setsigmask: Likewise. * modules/posix_spawnp: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 04 May 2011 14:26:56 -0600
parents 97fc9a21a8fb
children 45dddbc362fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14685
f7f11056a86e maint: remove useless REPLACE_*_H macros
Eric Blake <eblake@redhat.com>
parents: 14079
diff changeset
1 # duplocale.m4 serial 6
14079
97fc9a21a8fb maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents: 13885
diff changeset
2 dnl Copyright (C) 2009-2011 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 if test $REPLACE_DUPLOCALE = 1; then
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 AC_LIBOBJ([duplocale])
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 gl_PREREQ_DUPLOCALE
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 fi
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 # Prerequisites of lib/duplocale.c.
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 AC_DEFUN([gl_PREREQ_DUPLOCALE],
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 [
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 :
f214e6acb33b New module 'duplocale'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 ])