5 # The EILSEQ errno value ought to be defined in <errno.h>, according to
6 # ISO C 99 and POSIX. But some systems (like SunOS 4) don't define it,
7 # and some systems (like BSD/OS) define it in <wchar.h> not <errno.h>.
9 # Define EILSEQ as a C macro and as a substituted macro in such a way that
10 # 1. on all systems, after inclusion of <errno.h>, EILSEQ is usable,
11 # 2. on systems where EILSEQ is defined elsewhere, we use the same numeric
16 AC_REQUIRE([AC_PROG_CC])dnl
18 dnl Check for any extra headers that could define EILSEQ.
19 AC_CHECK_HEADERS(wchar.h)
21 AC_CACHE_CHECK([for EILSEQ], ac_cv_decl_EILSEQ, [
28 if test -n "$have_eilseq"; then
29 dnl EILSEQ exists in <errno.h>. Don't need to define EILSEQ ourselves.
41 if test -n "$have_eilseq"; then
42 dnl EILSEQ exists in some other system header.
43 dnl Define it to the same value.
44 _AC_COMPUTE_INT([EILSEQ], ac_cv_decl_EILSEQ, [
49 /* The following two lines are a workaround against an autoconf-2.52 bug. */
54 dnl EILSEQ isn't defined by the system. Define EILSEQ ourselves, but
55 dnl don't define it as EINVAL, because iconv() callers want to
56 dnl distinguish EINVAL and EILSEQ.
57 ac_cv_decl_EILSEQ=ENOENT
61 if test "$ac_cv_decl_EILSEQ" != yes; then
62 AC_DEFINE_UNQUOTED([EILSEQ], [$ac_cv_decl_EILSEQ],
63 [Define as good substitute value for EILSEQ.])
64 EILSEQ="$ac_cv_decl_EILSEQ"