1 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
3 dnl Copyright (C) 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.
8 dnl Written by Eric Blake.
12 AC_DEFUN([gl_WCHAR_H],
14 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15 AC_CACHE_CHECK([whether <wchar.h> is standalone],
16 [gl_cv_header_wchar_h_standalone],
17 [AC_COMPILE_IFELSE([[#include <wchar.h>
19 [gl_cv_header_wchar_h_standalone=yes],
20 [gl_cv_header_wchar_h_standalone=no])])
21 if test $gl_cv_header_wchar_h_standalone != yes; then
25 dnl Prepare for creating substitute <wchar.h>.
26 dnl Do it always: WCHAR_H may be empty here but can be set later.
27 dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
28 dnl character support).
29 AC_CHECK_HEADERS_ONCE([wchar.h])
30 if test $ac_cv_header_wchar_h = yes; then
35 AC_SUBST([HAVE_WCHAR_H])
36 gl_CHECK_NEXT_HEADERS([wchar.h])
39 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
41 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
42 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
43 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
46 AC_DEFUN([gl_WCHAR_H_DEFAULTS],
48 GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
49 dnl Assume proper GNU behavior unless another module says otherwise.
50 HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
51 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])