-dnl ------------------
-dnl CHECK HEADER FILES
-dnl ------------------
-
-dnl On glibc we need to define at least the '_XOPEN_SOURCE' level of features,
-dnl or wchar.h doesn't declare a prototype for wcwidth(). But if we only define
-dnl that level then db.h won't compile. So we define _GNU_SOURCE which turns
-dnl on everything. Perhaps other OSes need some feature switch set to get wcwidth()
-dnl declared; if so they should have an entry added to this case statement.
-dnl NB that we must define this on the compiler command line, not in config.h,
-dnl because it must be set before any system header is included and there's no
-dnl portable way to make sure that files generated by lex include config.h
-dnl before system header files.
-
-AS_CASE(["$host_os"],
- [linux*],
- [# Like DEFS, but doesn't get stomped on by configure when using config.h:
- AS_IF([test -z "$CPPFLAGS"],[CPPFLAGS="-D_GNU_SOURCE"],
- [CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"])])
-
-AC_HEADER_TIOCGWINSZ
-AC_CHECK_HEADERS([fcntl.h langinfo.h wchar.h wctype.h sys/param.h \
- sys/time.h sys/stream.h])
-
-AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
- [Define to 1 if `struct winsize' requires <sys/ptem.h>.]),,
-[[#if HAVE_SYS_STREAM_H
-# include <sys/stream.h>
-#endif
-]])
-
-dnl ---------------
-dnl CHECK FUNCTIONS
-dnl ---------------
-AC_CHECK_FUNCS([wcwidth mbtowc nl_langinfo getutxent arc4random])
-
-dnl Check for multibyte character set support
-AS_IF([test "x$ac_cv_header_wchar_h" = "xyes" -a \
- "x$ac_cv_header_wctype_h" = "xyes" -a \
- "x$ac_cv_func_wcwidth" = "xyes" -a \
- "x$ac_cv_func_mbtowc" = "xyes"],
- [AC_DEFINE([MULTIBYTE_SUPPORT], [1],
- [Define to enable support for multibyte character sets.])
- MULTIBYTE_ENABLED=1],
- [MULTIBYTE_ENABLED=0])
-AC_SUBST([MULTIBYTE_ENABLED])
-