+ac_widec_funcs=yes
+AC_CHECK_HEADER(wchar.h,[
+ ac_have_wchar_h=yes
+ AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
+ [ac_have_wchar_h=no])
+AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
+AC_CHECK_DECLS(wcwidth)
+AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
+
+if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
+ ac_widec_possible=yes
+else
+ ac_widec_possible=no
+fi
+