1
3
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
3
dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
5
dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
4
6
dnl This file is free software; the Free Software Foundation
5
7
dnl gives unlimited permission to copy and/or distribute it,
6
8
dnl with or without modifications, as long as this notice is preserved.
10
12
AC_DEFUN([gl_WCTYPE_H],
14
AC_REQUIRE([AC_PROG_CC])
12
15
AC_CHECK_FUNCS_ONCE([iswcntrl])
16
if test $ac_cv_func_iswcntrl = yes; then
21
AC_SUBST([HAVE_ISWCNTRL])
13
22
AC_CHECK_HEADERS_ONCE([wctype.h])
14
23
AC_REQUIRE([AC_C_INLINE])
25
34
if test $ac_cv_header_wctype_h = yes; then
26
if test "$ac_cv_func_iswcntrl" = yes; then
35
if test $ac_cv_func_iswcntrl = yes; then
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],
40
AC_TRY_RUN([#include <stddef.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.
51
[gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
54
if test $gl_cv_func_iswcntrl_works = yes; then
29
dnl Compute ABSOLUTE_WCTYPE_H even if WCTYPE_H is empty,
58
dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
30
59
dnl for the benefit of builds from non-distclean directories.
31
gl_ABSOLUTE_HEADER([wctype.h])
32
ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\"
60
gl_CHECK_NEXT_HEADERS([wctype.h])
35
ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\"
38
AC_SUBST([ABSOLUTE_WCTYPE_H])
39
65
AC_SUBST([HAVE_WCTYPE_H])
40
66
AC_SUBST([WCTYPE_H])
68
if test "$gl_cv_func_iswcntrl_works" = no; then
73
AC_SUBST([REPLACE_ISWCNTRL])