Mercurial > hg > octave-shane > gnulib-hg
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 |
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 | 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 if test $REPLACE_DUPLOCALE = 1; then | |
63 AC_LIBOBJ([duplocale]) | |
64 gl_PREREQ_DUPLOCALE | |
65 fi | |
66 ]) | |
67 | |
68 # Prerequisites of lib/duplocale.c. | |
69 AC_DEFUN([gl_PREREQ_DUPLOCALE], | |
70 [ | |
71 : | |
72 ]) |