diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-01-15 09:22:57 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-01-15 10:19:08 (GMT) |
commit | 71cdb52799220f8d9052643baf1d3e9836a9c755 (patch) | |
tree | 27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/m4/wctype.m4 | |
parent | f7afa46586645e50498d8b2d0c67884f014dc3a4 (diff) | |
download | monitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz |
Sync with gnulib
Diffstat (limited to 'gl/m4/wctype.m4')
-rw-r--r-- | gl/m4/wctype.m4 | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gl/m4/wctype.m4 b/gl/m4/wctype.m4 index 7483c4f..6a1b6f0 100644 --- a/gl/m4/wctype.m4 +++ b/gl/m4/wctype.m4 | |||
@@ -1,6 +1,8 @@ | |||
1 | # wctype.m4 serial 2 | ||
2 | |||
1 | dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. | 3 | dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. |
2 | 4 | ||
3 | dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc. | 5 | dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. |
4 | dnl This file is free software; the Free Software Foundation | 6 | dnl This file is free software; the Free Software Foundation |
5 | dnl gives unlimited permission to copy and/or distribute it, | 7 | dnl gives unlimited permission to copy and/or distribute it, |
6 | dnl with or without modifications, as long as this notice is preserved. | 8 | dnl with or without modifications, as long as this notice is preserved. |
@@ -9,6 +11,7 @@ dnl Written by Paul Eggert. | |||
9 | 11 | ||
10 | AC_DEFUN([gl_WCTYPE_H], | 12 | AC_DEFUN([gl_WCTYPE_H], |
11 | [ | 13 | [ |
14 | AC_REQUIRE([AC_PROG_CC]) | ||
12 | AC_CHECK_FUNCS_ONCE([iswcntrl]) | 15 | AC_CHECK_FUNCS_ONCE([iswcntrl]) |
13 | if test $ac_cv_func_iswcntrl = yes; then | 16 | if test $ac_cv_func_iswcntrl = yes; then |
14 | HAVE_ISWCNTRL=1 | 17 | HAVE_ISWCNTRL=1 |
@@ -30,7 +33,27 @@ AC_DEFUN([gl_WCTYPE_H], | |||
30 | WCTYPE_H=wctype.h | 33 | WCTYPE_H=wctype.h |
31 | if test $ac_cv_header_wctype_h = yes; then | 34 | if test $ac_cv_header_wctype_h = yes; then |
32 | if test $ac_cv_func_iswcntrl = yes; then | 35 | if test $ac_cv_func_iswcntrl = yes; then |
33 | WCTYPE_H= | 36 | dnl Linux libc5 has an iswprint function that returns 0 for all arguments. |
37 | dnl The other functions are likely broken in the same way. | ||
38 | AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], | ||
39 | [ | ||
40 | AC_TRY_RUN([#include <stddef.h> | ||
41 | #include <stdio.h> | ||
42 | #include <time.h> | ||
43 | #include <wchar.h> | ||
44 | #include <wctype.h> | ||
45 | int main () { return iswprint ('x') == 0; }], | ||
46 | [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], | ||
47 | [AC_TRY_COMPILE([#include <stdlib.h> | ||
48 | #if __GNU_LIBRARY__ == 1 | ||
49 | Linux libc5 i18n is broken. | ||
50 | #endif], [], | ||
51 | [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) | ||
52 | ]) | ||
53 | ]) | ||
54 | if test $gl_cv_func_iswcntrl_works = yes; then | ||
55 | WCTYPE_H= | ||
56 | fi | ||
34 | fi | 57 | fi |
35 | dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty, | 58 | dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty, |
36 | dnl for the benefit of builds from non-distclean directories. | 59 | dnl for the benefit of builds from non-distclean directories. |
@@ -41,4 +64,11 @@ AC_DEFUN([gl_WCTYPE_H], | |||
41 | fi | 64 | fi |
42 | AC_SUBST([HAVE_WCTYPE_H]) | 65 | AC_SUBST([HAVE_WCTYPE_H]) |
43 | AC_SUBST([WCTYPE_H]) | 66 | AC_SUBST([WCTYPE_H]) |
67 | |||
68 | if test "$gl_cv_func_iswcntrl_works" = no; then | ||
69 | REPLACE_ISWCNTRL=1 | ||
70 | else | ||
71 | REPLACE_ISWCNTRL=0 | ||
72 | fi | ||
73 | AC_SUBST([REPLACE_ISWCNTRL]) | ||
44 | ]) | 74 | ]) |