* lib/wctype_.h [HAVE_WINT_T]: Rely on AC_DEFINE.
[pspp] / m4 / wctype.m4
1 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
2
3 dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl Written by Paul Eggert.
9
10 # wctype.m4 serial 2
11
12 AC_DEFUN([gl_WCTYPE_H],
13 [
14   AC_CHECK_FUNCS_ONCE([iswcntrl])
15   AC_CHECK_HEADERS_ONCE([wctype.h])
16   AC_REQUIRE([AC_C_INLINE])
17
18   AC_REQUIRE([gt_TYPE_WINT_T])
19
20   WCTYPE_H=wctype.h
21   if test $ac_cv_header_wctype_h = yes; then
22     if test "$ac_cv_func_iswcntrl" = yes; then
23       WCTYPE_H=
24     fi
25     dnl Compute ABSOLUTE_WCTYPE_H even if WCTYPE_H is empty,
26     dnl for the benefit of builds from non-distclean directories.
27     gl_ABSOLUTE_HEADER([wctype.h])
28     ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\"
29     HAVE_WCTYPE_H=1
30   else
31     ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\"
32     HAVE_WCTYPE_H=0
33   fi
34   AC_SUBST([ABSOLUTE_WCTYPE_H])
35   AC_SUBST([HAVE_WCTYPE_H])
36   AC_SUBST([WCTYPE_H])
37 ])