Import upstream version 1.26
[debian/tar] / configure
index 08758085007c64238cde8810ccf5523475252c67..858b4e79266721359e0b2c8c8d6561d3269f3c27 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for GNU tar 1.25.
+# Generated by GNU Autoconf 2.63 for GNU tar 1.26.
 #
 # Report bugs to <bug-tar@gnu.org>.
 #
@@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='GNU tar'
 PACKAGE_TARNAME='tar'
-PACKAGE_VERSION='1.25'
-PACKAGE_STRING='GNU tar 1.25'
+PACKAGE_VERSION='1.26'
+PACKAGE_STRING='GNU tar 1.26'
 PACKAGE_BUGREPORT='bug-tar@gnu.org'
 
 ac_unique_file="src/tar.c"
@@ -681,17 +681,9 @@ LIB_SETSOCKOPT
 LIBGNU_LTLIBDEPS
 LIBGNU_LIBDEPS
 gltests_WITNESS
-REPLACE_ISWCNTRL
-HAVE_WCTYPE_H
-NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
-NEXT_WCTYPE_H
-REPLACE_ISWBLANK
-HAVE_ISWBLANK
-HAVE_ISWCNTRL
-HAVE_WINT_T
-HAVE_WCHAR_H
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
 NEXT_WCHAR_H
+HAVE_FEATURES_H
 LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE
 LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE
 LIBUNISTRING_UNIWIDTH_H
@@ -716,12 +708,10 @@ NEXT_AS_FIRST_DIRECTIVE_STRING_H
 NEXT_STRING_H
 HAVE_DECL_STRNCASECMP
 HAVE_STRCASECMP
-HAVE_RANDOM_H
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
 NEXT_STDLIB_H
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H
 NEXT_STDIO_H
-ASM_SYMBOL_PREFIX
 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
 NEXT_STDDEF_H
 STDDEF_H
@@ -737,7 +727,7 @@ REPLACE_LOCALTIME_R
 HAVE_TIMEGM
 HAVE_STRPTIME
 HAVE_NANOSLEEP
-HAVE_LOCALTIME_R
+HAVE_DECL_LOCALTIME_R
 GNULIB_TIME_R
 GNULIB_TIMEGM
 GNULIB_STRPTIME
@@ -749,6 +739,7 @@ REPLACE_STRSIGNAL
 REPLACE_STRNLEN
 REPLACE_STRNDUP
 REPLACE_STRNCAT
+REPLACE_STRERROR_R
 REPLACE_STRERROR
 REPLACE_STRCASESTR
 REPLACE_STRSTR
@@ -758,6 +749,7 @@ REPLACE_MEMMEM
 REPLACE_MEMCHR
 HAVE_STRVERSCMP
 HAVE_DECL_STRSIGNAL
+HAVE_DECL_STRERROR_R
 HAVE_DECL_STRTOK_R
 HAVE_STRCASESTR
 HAVE_STRSEP
@@ -776,6 +768,7 @@ HAVE_MEMCHR
 HAVE_MBSLEN
 GNULIB_STRVERSCMP
 GNULIB_STRSIGNAL
+GNULIB_STRERROR_R
 GNULIB_STRERROR
 GNULIB_MBSTOK_R
 GNULIB_MBSSEP
@@ -823,6 +816,21 @@ NEXT_LANGINFO_H
 REPLACE_NL_LANGINFO
 HAVE_NL_LANGINFO
 GNULIB_NL_LANGINFO
+REPLACE_ISWCNTRL
+HAVE_WCTYPE_H
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
+NEXT_WCTYPE_H
+HAVE_WINT_T
+HAVE_ISWCNTRL
+REPLACE_ISWBLANK
+HAVE_WCTRANS_T
+HAVE_WCTYPE_T
+HAVE_ISWBLANK
+GNULIB_TOWCTRANS
+GNULIB_WCTRANS
+GNULIB_ISWCTYPE
+GNULIB_WCTYPE
+GNULIB_ISWBLANK
 UINT64_MAX_EQ_ULONG_MAX
 UINT32_MAX_LT_UINTMAX_MAX
 INT64_MAX_EQ_LONG_MAX
@@ -861,6 +869,7 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H
 NEXT_STDINT_H
 HAVE_SYS_TYPES_H
 HAVE_INTTYPES_H
+HAVE_WCHAR_H
 HAVE_UNSIGNED_LONG_LONG_INT
 HAVE_LONG_LONG_INT
 HAVE__BOOL
@@ -924,6 +933,8 @@ HAVE_DECL_SNPRINTF
 HAVE_DECL_OBSTACK_PRINTF
 HAVE_DECL_GETLINE
 HAVE_DECL_GETDELIM
+HAVE_DECL_FTELLO
+HAVE_DECL_FSEEKO
 HAVE_DECL_FPURGE
 GNULIB_VSPRINTF_POSIX
 GNULIB_VSNPRINTF
@@ -1034,6 +1045,8 @@ GNULIB_ALPHASORT
 GNULIB_SCANDIR
 GNULIB_FDOPENDIR
 GNULIB_DIRFD
+pkglibexecdir
+lispdir
 LIB_CLOCK_GETTIME
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
 UNISTD_H_HAVE_WINSOCK2_H
@@ -1054,6 +1067,8 @@ REPLACE_LINK
 REPLACE_LCHOWN
 REPLACE_GETPAGESIZE
 REPLACE_GETGROUPS
+REPLACE_GETLOGIN_R
+REPLACE_GETDOMAINNAME
 REPLACE_GETCWD
 REPLACE_FCHOWNAT
 REPLACE_DUP2
@@ -1062,13 +1077,15 @@ REPLACE_CLOSE
 REPLACE_CHOWN
 HAVE_SYS_PARAM_H
 HAVE_OS_H
+HAVE_DECL_TTYNAME_R
 HAVE_DECL_GETUSERSHELL
 HAVE_DECL_GETPAGESIZE
 HAVE_DECL_GETLOGIN_R
+HAVE_DECL_GETDOMAINNAME
+HAVE_DECL_FCHDIR
 HAVE_DECL_ENVIRON
 HAVE_USLEEP
 HAVE_UNLINKAT
-HAVE_TTYNAME_R
 HAVE_SYMLINKAT
 HAVE_SYMLINK
 HAVE_SLEEP
@@ -1077,6 +1094,7 @@ HAVE_READLINK
 HAVE_PWRITE
 HAVE_PREAD
 HAVE_PIPE2
+HAVE_PIPE
 HAVE_LINKAT
 HAVE_LINK
 HAVE_LCHOWN
@@ -1085,7 +1103,6 @@ HAVE_GETLOGIN
 HAVE_GETHOSTNAME
 HAVE_GETGROUPS
 HAVE_GETDTABLESIZE
-HAVE_GETDOMAINNAME
 HAVE_FTRUNCATE
 HAVE_FSYNC
 HAVE_FCHOWNAT
@@ -1111,6 +1128,7 @@ GNULIB_READLINK
 GNULIB_PWRITE
 GNULIB_PREAD
 GNULIB_PIPE2
+GNULIB_PIPE
 GNULIB_LSEEK
 GNULIB_LINKAT
 GNULIB_LINK
@@ -1135,6 +1153,7 @@ GNULIB_DUP3
 GNULIB_DUP2
 GNULIB_CLOSE
 GNULIB_CHOWN
+REPLACE_WCTOMB
 REPLACE_UNSETENV
 REPLACE_STRTOD
 REPLACE_SETENV
@@ -1142,20 +1161,23 @@ REPLACE_REALPATH
 REPLACE_REALLOC
 REPLACE_PUTENV
 REPLACE_MKSTEMP
+REPLACE_MBTOWC
 REPLACE_MALLOC
 REPLACE_CANONICALIZE_FILE_NAME
 REPLACE_CALLOC
-HAVE_UNSETENV
+HAVE_DECL_UNSETENV
 HAVE_UNLOCKPT
 HAVE_SYS_LOADAVG_H
 HAVE_STRUCT_RANDOM_DATA
 HAVE_STRTOULL
 HAVE_STRTOLL
 HAVE_STRTOD
+HAVE_DECL_SETENV
 HAVE_SETENV
 HAVE_RPMATCH
 HAVE_REALPATH
 HAVE_RANDOM_R
+HAVE_RANDOM_H
 HAVE_PTSNAME
 HAVE_MKSTEMPS
 HAVE_MKSTEMP
@@ -1168,6 +1190,7 @@ HAVE_DECL_GETLOADAVG
 HAVE_CANONICALIZE_FILE_NAME
 HAVE_ATOLL
 HAVE__EXIT
+GNULIB_WCTOMB
 GNULIB_UNSETENV
 GNULIB_UNLOCKPT
 GNULIB_SYSTEM_POSIX
@@ -1186,6 +1209,7 @@ GNULIB_MKSTEMP
 GNULIB_MKOSTEMPS
 GNULIB_MKOSTEMP
 GNULIB_MKDTEMP
+GNULIB_MBTOWC
 GNULIB_MALLOC_POSIX
 GNULIB_GRANTPT
 GNULIB_GETSUBOPT
@@ -1195,6 +1219,7 @@ GNULIB_CALLOC_POSIX
 GNULIB_ATOLL
 GNULIB__EXIT
 LOCALE_FR
+REPLACE_WCSWIDTH
 REPLACE_WCWIDTH
 REPLACE_WCSNRTOMBS
 REPLACE_WCSRTOMBS
@@ -1209,6 +1234,34 @@ REPLACE_BTOWC
 REPLACE_MBSTATE_T
 HAVE_DECL_WCWIDTH
 HAVE_DECL_WCTOB
+HAVE_WCSWIDTH
+HAVE_WCSTOK
+HAVE_WCSSTR
+HAVE_WCSPBRK
+HAVE_WCSSPN
+HAVE_WCSCSPN
+HAVE_WCSRCHR
+HAVE_WCSCHR
+HAVE_WCSDUP
+HAVE_WCSXFRM
+HAVE_WCSCOLL
+HAVE_WCSNCASECMP
+HAVE_WCSCASECMP
+HAVE_WCSNCMP
+HAVE_WCSCMP
+HAVE_WCSNCAT
+HAVE_WCSCAT
+HAVE_WCPNCPY
+HAVE_WCSNCPY
+HAVE_WCPCPY
+HAVE_WCSCPY
+HAVE_WCSNLEN
+HAVE_WCSLEN
+HAVE_WMEMSET
+HAVE_WMEMMOVE
+HAVE_WMEMCPY
+HAVE_WMEMCMP
+HAVE_WMEMCHR
 HAVE_WCSNRTOMBS
 HAVE_WCSRTOMBS
 HAVE_WCRTOMB
@@ -1218,6 +1271,34 @@ HAVE_MBRLEN
 HAVE_MBRTOWC
 HAVE_MBSINIT
 HAVE_BTOWC
+GNULIB_WCSWIDTH
+GNULIB_WCSTOK
+GNULIB_WCSSTR
+GNULIB_WCSPBRK
+GNULIB_WCSSPN
+GNULIB_WCSCSPN
+GNULIB_WCSRCHR
+GNULIB_WCSCHR
+GNULIB_WCSDUP
+GNULIB_WCSXFRM
+GNULIB_WCSCOLL
+GNULIB_WCSNCASECMP
+GNULIB_WCSCASECMP
+GNULIB_WCSNCMP
+GNULIB_WCSCMP
+GNULIB_WCSNCAT
+GNULIB_WCSCAT
+GNULIB_WCPNCPY
+GNULIB_WCSNCPY
+GNULIB_WCPCPY
+GNULIB_WCSCPY
+GNULIB_WCSNLEN
+GNULIB_WCSLEN
+GNULIB_WMEMSET
+GNULIB_WMEMMOVE
+GNULIB_WMEMCPY
+GNULIB_WMEMCMP
+GNULIB_WMEMCHR
 GNULIB_WCWIDTH
 GNULIB_WCSNRTOMBS
 GNULIB_WCSRTOMBS
@@ -1919,7 +2000,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures GNU tar 1.25 to adapt to many kinds of systems.
+\`configure' configures GNU tar 1.26 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1989,7 +2070,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GNU tar 1.25:";;
+     short | recursive ) echo "Configuration of GNU tar 1.26:";;
    esac
   cat <<\_ACEOF
 
@@ -2127,7 +2208,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GNU tar configure 1.25
+GNU tar configure 1.26
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -2141,7 +2222,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by GNU tar $as_me 1.25, which was
+It was created by GNU tar $as_me 1.26, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2450,11 +2531,9 @@ ac_func_list="$ac_func_list fchown"
 ac_header_list="$ac_header_list dirent.h"
 ac_func_list="$ac_func_list fdopendir"
 ac_func_list="$ac_func_list dup2"
-ac_header_list="$ac_header_list errno.h"
-ac_func_list="$ac_func_list fchdir"
 ac_func_list="$ac_func_list fcntl"
+ac_func_list="$ac_func_list fchdir"
 ac_func_list="$ac_func_list mempcpy"
-ac_header_list="$ac_header_list float.h"
 ac_func_list="$ac_func_list isblank"
 ac_func_list="$ac_func_list iswctype"
 ac_func_list="$ac_func_list mbsrtowcs"
@@ -2472,9 +2551,11 @@ gl_getopt_required=GNU
 ac_header_list="$ac_header_list getopt.h"
 ac_func_list="$ac_func_list gettimeofday"
 ac_func_list="$ac_func_list nanotime"
-ac_header_list="$ac_header_list stdint.h"
 ac_header_list="$ac_header_list wchar.h"
+ac_header_list="$ac_header_list stdint.h"
 ac_header_list="$ac_header_list inttypes.h"
+ac_func_list="$ac_func_list iswcntrl"
+ac_func_list="$ac_func_list iswblank"
 ac_header_list="$ac_header_list langinfo.h"
 ac_func_list="$ac_func_list lchmod"
 ac_func_list="$ac_func_list link"
@@ -2498,10 +2579,6 @@ ac_func_list="$ac_func_list wcscoll"
 ac_func_list="$ac_func_list renameat"
 ac_func_list="$ac_func_list setenv"
 ac_func_list="$ac_func_list sleep"
-ac_header_list="$ac_header_list stdarg.h"
-ac_header_list="$ac_header_list stddef.h"
-ac_header_list="$ac_header_list stdio.h"
-ac_header_list="$ac_header_list stdlib.h"
 ac_func_list="$ac_func_list strdup"
 ac_header_list="$ac_header_list sys/socket.h"
 ac_header_list="$ac_header_list strings.h"
@@ -2509,7 +2586,6 @@ ac_func_list="$ac_func_list strndup"
 ac_func_list="$ac_func_list symlinkat"
 ac_header_list="$ac_header_list sys/stat.h"
 ac_header_list="$ac_header_list sysexits.h"
-ac_header_list="$ac_header_list time.h"
 ac_func_list="$ac_func_list localtime_r"
 ac_func_list="$ac_func_list pipe"
 ac_header_list="$ac_header_list utime.h"
@@ -2519,8 +2595,6 @@ ac_func_list="$ac_func_list utimensat"
 ac_func_list="$ac_func_list lutimes"
 ac_func_list="$ac_func_list vasnprintf"
 ac_func_list="$ac_func_list wcrtomb"
-ac_func_list="$ac_func_list iswcntrl"
-ac_func_list="$ac_func_list iswblank"
 ac_func_list="$ac_func_list wcwidth"
 ac_header_list="$ac_header_list netdb.h"
 ac_header_list="$ac_header_list sys/wait.h"
@@ -3119,7 +3193,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tar'
- VERSION='1.25'
+ VERSION='1.26'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6113,6 +6187,7 @@ esac
   # Code from module dirfd:
   # Code from module dirname:
   # Code from module dirname-lgpl:
+  # Code from module dosname:
   # Code from module double-slash-root:
   # Code from module dup2:
   # Code from module environ:
@@ -6158,6 +6233,7 @@ esac
   # Code from module intprops:
   # Code from module inttostr:
   # Code from module inttypes:
+  # Code from module iswblank:
   # Code from module langinfo:
   # Code from module lchown:
   # Code from module link:
@@ -6174,6 +6250,7 @@ esac
   # Code from module mbscasecmp:
   # Code from module mbsinit:
   # Code from module mbsrtowcs:
+  # Code from module mbtowc:
   # Code from module mbuiter:
   # Code from module memchr:
   # Code from module mempcpy:
@@ -6273,7 +6350,7 @@ esac
   # Code from module warn-on-use:
   # Code from module wchar:
   # Code from module wcrtomb:
-  # Code from module wctype:
+  # Code from module wctype-h:
   # Code from module wcwidth:
   # Code from module write:
   # Code from module xalloc:
@@ -10632,9 +10709,14 @@ DIR *dp = opendir (".");
              if (! dp)
                return 1;
              e = readdir (dp);
-             return ! (e
-                       && stat (e->d_name, &st) == 0
-                       && e->d_ino == st.st_ino);
+             if (! e)
+               return 2;
+             if (stat (e->d_name, &st) != 0)
+               return 3;
+             if (e->d_ino != st.st_ino)
+               return 4;
+             return 0;
+
   ;
   return 0;
 }
@@ -10687,153 +10769,6 @@ _ACEOF
    fi
 
 
-
-    { $as_echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5
-$as_echo_n "checking whether system is Windows or MSDOS... " >&6; }
-if test "${ac_cv_win_or_dos+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
-neither MSDOS nor Windows
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_win_or_dos=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_win_or_dos=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
-$as_echo "$ac_cv_win_or_dos" >&6; }
-
-    if test x"$ac_cv_win_or_dos" = xyes; then
-      ac_fs_accepts_drive_letter_prefix=1
-      ac_fs_backslash_is_file_name_separator=1
-      { $as_echo "$as_me:$LINENO: checking whether drive letter can start relative path" >&5
-$as_echo_n "checking whether drive letter can start relative path... " >&6; }
-if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-          cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#if defined __CYGWIN__
-drive letters are always absolute
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_drive_letter_can_be_relative=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_drive_letter_can_be_relative=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_drive_letter_can_be_relative" >&5
-$as_echo "$ac_cv_drive_letter_can_be_relative" >&6; }
-      if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
-        ac_fs_drive_letter_can_be_relative=1
-      else
-        ac_fs_drive_letter_can_be_relative=0
-      fi
-    else
-      ac_fs_accepts_drive_letter_prefix=0
-      ac_fs_backslash_is_file_name_separator=0
-      ac_fs_drive_letter_can_be_relative=0
-    fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix
-_ACEOF
-
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator
-_ACEOF
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE $ac_fs_drive_letter_can_be_relative
-_ACEOF
-
-
 { $as_echo "$as_me:$LINENO: checking for long file names" >&5
 $as_echo_n "checking for long file names... " >&6; }
 if test "${ac_cv_sys_long_file_names+set}" = set; then
   GNULIB_WCSRTOMBS=0;
   GNULIB_WCSNRTOMBS=0;
   GNULIB_WCWIDTH=0;
+  GNULIB_WMEMCHR=0;
+  GNULIB_WMEMCMP=0;
+  GNULIB_WMEMCPY=0;
+  GNULIB_WMEMMOVE=0;
+  GNULIB_WMEMSET=0;
+  GNULIB_WCSLEN=0;
+  GNULIB_WCSNLEN=0;
+  GNULIB_WCSCPY=0;
+  GNULIB_WCPCPY=0;
+  GNULIB_WCSNCPY=0;
+  GNULIB_WCPNCPY=0;
+  GNULIB_WCSCAT=0;
+  GNULIB_WCSNCAT=0;
+  GNULIB_WCSCMP=0;
+  GNULIB_WCSNCMP=0;
+  GNULIB_WCSCASECMP=0;
+  GNULIB_WCSNCASECMP=0;
+  GNULIB_WCSCOLL=0;
+  GNULIB_WCSXFRM=0;
+  GNULIB_WCSDUP=0;
+  GNULIB_WCSCHR=0;
+  GNULIB_WCSRCHR=0;
+  GNULIB_WCSCSPN=0;
+  GNULIB_WCSSPN=0;
+  GNULIB_WCSPBRK=0;
+  GNULIB_WCSSTR=0;
+  GNULIB_WCSTOK=0;
+  GNULIB_WCSWIDTH=0;
     HAVE_BTOWC=1;
   HAVE_MBSINIT=1;
   HAVE_MBRTOWC=1;
   HAVE_WCRTOMB=1;
   HAVE_WCSRTOMBS=1;
   HAVE_WCSNRTOMBS=1;
+  HAVE_WMEMCHR=1;
+  HAVE_WMEMCMP=1;
+  HAVE_WMEMCPY=1;
+  HAVE_WMEMMOVE=1;
+  HAVE_WMEMSET=1;
+  HAVE_WCSLEN=1;
+  HAVE_WCSNLEN=1;
+  HAVE_WCSCPY=1;
+  HAVE_WCPCPY=1;
+  HAVE_WCSNCPY=1;
+  HAVE_WCPNCPY=1;
+  HAVE_WCSCAT=1;
+  HAVE_WCSNCAT=1;
+  HAVE_WCSCMP=1;
+  HAVE_WCSNCMP=1;
+  HAVE_WCSCASECMP=1;
+  HAVE_WCSNCASECMP=1;
+  HAVE_WCSCOLL=1;
+  HAVE_WCSXFRM=1;
+  HAVE_WCSDUP=1;
+  HAVE_WCSCHR=1;
+  HAVE_WCSRCHR=1;
+  HAVE_WCSCSPN=1;
+  HAVE_WCSSPN=1;
+  HAVE_WCSPBRK=1;
+  HAVE_WCSSTR=1;
+  HAVE_WCSTOK=1;
+  HAVE_WCSWIDTH=1;
   HAVE_DECL_WCTOB=1;
   HAVE_DECL_WCWIDTH=1;
   REPLACE_MBSTATE_T=0;
@@ -10913,6 +10904,7 @@ fi
   REPLACE_WCSRTOMBS=0;
   REPLACE_WCSNRTOMBS=0;
   REPLACE_WCWIDTH=0;
+  REPLACE_WCSWIDTH=0;
 
 
             { $as_echo "$as_me:$LINENO: checking whether <wchar.h> uses 'inline' correctly" >&5
@@ -10929,6 +10921,13 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 extern int zero (void);
 int main () { return zero(); }
@@ -10948,6 +10947,13 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int zero (void) { return 0; }
 
@@ -11086,7 +11092,17 @@ struct tm t;
 char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Win32, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -11127,37 +11143,56 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr=fr_FR.ISO-8859-1
-        else
-          # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
-          if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr=fr_FR.ISO8859-1
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the native Win32 locale name.
+          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr=French_France.1252
+          else
+            # None found.
+            gt_cv_locale_fr=none
+          fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the usual locale name.
+          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr=fr_FR
           else
-            # Test for the HP-UX locale name.
-            if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_fr=fr_FR.iso88591
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_fr=fr_FR.ISO-8859-1
             else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_fr=fr
+              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
+              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_fr=fr_FR.ISO8859-1
               else
-                # None found.
-                gt_cv_locale_fr=none
+                # Test for the HP-UX locale name.
+                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                  gt_cv_locale_fr=fr_FR.iso88591
+                else
+                  # Test for the Solaris 7 locale name.
+                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                    gt_cv_locale_fr=fr
+                  else
+                    # None found.
+                    gt_cv_locale_fr=none
+                  fi
+                fi
               fi
             fi
           fi
-        fi
-      fi
+          ;;
+      esac
     fi
     rm -fr conftest*
 
@@ -11247,10 +11282,23 @@ int
 main ()
 {
 
-        char *name1 = realpath ("conftest.a", NULL);
-        char *name2 = realpath ("conftest.b/../conftest.a", NULL);
-        char *name3 = realpath ("conftest.a/", NULL);
-        return !(name1 && *name1 == '/' && !name2 && !name3);
+        int result = 0;
+        {
+          char *name = realpath ("conftest.a", NULL);
+          if (!(name && *name == '/'))
+            result |= 1;
+        }
+        {
+          char *name = realpath ("conftest.b/../conftest.a", NULL);
+          if (name != NULL)
+            result |= 2;
+        }
+        {
+          char *name = realpath ("conftest.a/", NULL);
+          if (name != NULL)
+            result |= 4;
+        }
+        return result;
 
   ;
   return 0;
@@ -11335,6 +11383,7 @@ _ACEOF
   GNULIB_GETSUBOPT=0;
   GNULIB_GRANTPT=0;
   GNULIB_MALLOC_POSIX=0;
+  GNULIB_MBTOWC=0;
   GNULIB_MKDTEMP=0;
   GNULIB_MKOSTEMP=0;
   GNULIB_MKOSTEMPS=0;
@@ -11353,6 +11402,7 @@ _ACEOF
   GNULIB_SYSTEM_POSIX=0;
   GNULIB_UNLOCKPT=0;
   GNULIB_UNSETENV=0;
+  GNULIB_WCTOMB=0;
     HAVE__EXIT=1;
   HAVE_ATOLL=1;
   HAVE_CANONICALIZE_FILE_NAME=1;
@@ -11365,20 +11415,23 @@ _ACEOF
   HAVE_MKSTEMP=1;
   HAVE_MKSTEMPS=1;
   HAVE_PTSNAME=1;
+  HAVE_RANDOM_H=1;
   HAVE_RANDOM_R=1;
   HAVE_REALPATH=1;
   HAVE_RPMATCH=1;
   HAVE_SETENV=1;
+  HAVE_DECL_SETENV=1;
   HAVE_STRTOD=1;
   HAVE_STRTOLL=1;
   HAVE_STRTOULL=1;
   HAVE_STRUCT_RANDOM_DATA=1;
   HAVE_SYS_LOADAVG_H=0;
   HAVE_UNLOCKPT=1;
-  HAVE_UNSETENV=1;
+  HAVE_DECL_UNSETENV=1;
   REPLACE_CALLOC=0;
   REPLACE_CANONICALIZE_FILE_NAME=0;
   REPLACE_MALLOC=0;
+  REPLACE_MBTOWC=0;
   REPLACE_MKSTEMP=0;
   REPLACE_PUTENV=0;
   REPLACE_REALLOC=0;
@@ -11386,6 +11439,7 @@ _ACEOF
   REPLACE_SETENV=0;
   REPLACE_STRTOD=0;
   REPLACE_UNSETENV=0;
+  REPLACE_WCTOMB=0;
 
 
   GNULIB_CHOWN=0;
@@ -11412,6 +11466,7 @@ _ACEOF
   GNULIB_LINK=0;
   GNULIB_LINKAT=0;
   GNULIB_LSEEK=0;
+  GNULIB_PIPE=0;
   GNULIB_PIPE2=0;
   GNULIB_PREAD=0;
   GNULIB_PWRITE=0;
@@ -11437,7 +11492,6 @@ _ACEOF
   HAVE_FCHOWNAT=1;
   HAVE_FSYNC=1;
   HAVE_FTRUNCATE=1;
-  HAVE_GETDOMAINNAME=1;
   HAVE_GETDTABLESIZE=1;
   HAVE_GETGROUPS=1;
   HAVE_GETHOSTNAME=1;
@@ -11446,6 +11500,7 @@ _ACEOF
   HAVE_LCHOWN=1;
   HAVE_LINK=1;
   HAVE_LINKAT=1;
+  HAVE_PIPE=1;
   HAVE_PIPE2=1;
   HAVE_PREAD=1;
   HAVE_PWRITE=1;
@@ -11454,13 +11509,15 @@ _ACEOF
   HAVE_SLEEP=1;
   HAVE_SYMLINK=1;
   HAVE_SYMLINKAT=1;
-  HAVE_TTYNAME_R=1;
   HAVE_UNLINKAT=1;
   HAVE_USLEEP=1;
   HAVE_DECL_ENVIRON=1;
+  HAVE_DECL_FCHDIR=1;
+  HAVE_DECL_GETDOMAINNAME=1;
   HAVE_DECL_GETLOGIN_R=1;
   HAVE_DECL_GETPAGESIZE=1;
   HAVE_DECL_GETUSERSHELL=1;
+  HAVE_DECL_TTYNAME_R=1;
   HAVE_OS_H=0;
   HAVE_SYS_PARAM_H=0;
   REPLACE_CHOWN=0;
@@ -11469,6 +11526,8 @@ _ACEOF
   REPLACE_DUP2=0;
   REPLACE_FCHOWNAT=0;
   REPLACE_GETCWD=0;
+  REPLACE_GETDOMAINNAME=0;
+  REPLACE_GETLOGIN_R=0;
   REPLACE_GETGROUPS=0;
   REPLACE_GETPAGESIZE=0;
   REPLACE_LCHOWN=0;
@@ -11752,6 +11811,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         int
         main ()
         {
+          int result = 0;
           char const *dangling_symlink = "conftest.dangle";
 
           unlink (dangling_symlink);
@@ -11760,8 +11820,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 
           /* Exit successfully on a conforming system,
              i.e., where chown must fail with ENOENT.  */
-          exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0
-                    && errno == ENOENT));
+          if (chown (dangling_symlink, getuid (), getgid ()) == 0)
+            result |= 1;
+          if (errno != ENOENT)
+            result |= 2;
+          return result;
         }
 
 _ACEOF
@@ -12298,6 +12361,7 @@ $as_echo "$gl_cv_pragma_columns" >&6; }
 
 
 
+
   { $as_echo "$as_me:$LINENO: checking if environ is properly declared" >&5
 $as_echo_n "checking if environ is properly declared... " >&6; }
   if test "${gt_cv_var_environ_declaration+set}" = set; then
@@ -12366,8 +12430,6 @@ _ACEOF
 
 
 
-
-
   { $as_echo "$as_me:$LINENO: checking for complete errno.h" >&5
 $as_echo_n "checking for complete errno.h... " >&6; }
 if test "${gl_cv_header_errno_h_complete+set}" = set; then
@@ -12440,9 +12502,6 @@ $as_echo "$gl_cv_header_errno_h_complete" >&6; }
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_errno_h='<'errno.h'>'
      else
@@ -12452,8 +12511,7 @@ if test "${gl_cv_next_errno_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_errno_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12462,20 +12520,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <errno.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/errno.h#{
-                 s#.*"\(.*/errno.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_errno_h='<'errno.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/errno.h#{
+                    s#.*"\(.*/errno.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_errno_h" >&5
@@ -12494,6 +12550,7 @@ $as_echo "$gl_cv_next_errno_h" >&6; }
 
 
 
+
     ERRNO_H='errno.h'
   fi
 
   REPLACE_STAT=0;
   REPLACE_UTIMENSAT=0;
 
+{ $as_echo "$as_me:$LINENO: checking whether fchdir is declared" >&5
+$as_echo_n "checking whether fchdir is declared... " >&6; }
+if test "${ac_cv_have_decl_fchdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef fchdir
+  (void) fchdir;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_fchdir=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_fchdir=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fchdir" >&5
+$as_echo "$ac_cv_have_decl_fchdir" >&6; }
+if test "x$ac_cv_have_decl_fchdir" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FCHDIR 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FCHDIR 0
+_ACEOF
+
+
+fi
+
+
 
 
 
@@ -14213,6 +14339,8 @@ _ACEOF
   GNULIB_VSNPRINTF=0;
   GNULIB_VSPRINTF_POSIX=0;
     HAVE_DECL_FPURGE=1;
+  HAVE_DECL_FSEEKO=1;
+  HAVE_DECL_FTELLO=1;
   HAVE_DECL_GETDELIM=1;
   HAVE_DECL_GETLINE=1;
   HAVE_DECL_OBSTACK_PRINTF=1;
@@ -14257,8 +14385,6 @@ _ACEOF
 
 
 
-
-
   { $as_echo "$as_me:$LINENO: checking for working fcntl.h" >&5
 $as_echo_n "checking for working fcntl.h... " >&6; }
 if test "${gl_cv_header_working_fcntl_h+set}" = set; then
@@ -14293,29 +14419,56 @@ int
 main ()
 {
 
-            int status = !constants;
+            int result = !constants;
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0
-                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
-                status |= 32;
+              if (symlink (".", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
               unlink (sym);
             }
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);
-              char c;
-              struct stat st0, st1;
-              if (fd < 0
-                  || fstat (fd, &st0) != 0
-                  || sleep (1) != 0
-                  || read (fd, &c, 1) != 1
-                  || close (fd) != 0
-                  || stat (file, &st1) != 0
-                  || st0.st_atime != st1.st_atime)
-                status |= 64;
+              if (fd < 0)
+                result |= 8;
+              else
+                {
+                  struct stat st0;
+                  if (fstat (fd, &st0) != 0)
+                    result |= 16;
+                  else
+                    {
+                      char c;
+                      sleep (1);
+                      if (read (fd, &c, 1) != 1)
+                        result |= 24;
+                      else
+                        {
+                          if (close (fd) != 0)
+                            result |= 32;
+                          else
+                            {
+                              struct stat st1;
+                              if (stat (file, &st1) != 0)
+                                result |= 40;
+                              else
+                                if (st0.st_atime != st1.st_atime)
+                                  result |= 64;
+                            }
+                        }
+                    }
+                }
             }
-            return status;
+            return result;
   ;
   return 0;
 }
@@ -14350,9 +14503,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 case $? in #(
-        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
         64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
          *) gl_cv_header_working_fcntl_h='no';;
         esac
 fi
@@ -14389,8 +14542,6 @@ _ACEOF
 
 
 
-
-
    { $as_echo "$as_me:$LINENO: checking for mbstate_t" >&5
 $as_echo_n "checking for mbstate_t... " >&6; }
 if test "${ac_cv_type_mbstate_t+set}" = set; then
@@ -14403,7 +14554,14 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#           include <wchar.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
 int
 main ()
 {
 { $as_echo "$as_me:$LINENO: result: $gl_cv_var_stdin_large_offset" >&5
 $as_echo "$gl_cv_var_stdin_large_offset" >&6; }
 
+{ $as_echo "$as_me:$LINENO: checking whether fseeko is declared" >&5
+$as_echo_n "checking whether fseeko is declared... " >&6; }
+if test "${ac_cv_have_decl_fseeko+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef fseeko
+  (void) fseeko;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_fseeko=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_fseeko=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_fseeko" >&5
+$as_echo "$ac_cv_have_decl_fseeko" >&6; }
+if test "x$ac_cv_have_decl_fseeko" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FSEEKO 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FSEEKO 0
+_ACEOF
+
+
+fi
+
+
 
 
 
@@ -14649,7 +14876,13 @@ main ()
            else
              {
                char *f = getcwd (NULL, 0);
-               return ! (f && f[0] == '/' && !f[1]);
+               if (! f)
+                 return 2;
+               if (f[0] != '/')
+                 return 3;
+               if (f[1] != '\0')
+                 return 4;
+               return 0;
              }
 #endif
 
@@ -14923,6 +15156,9 @@ fi
 
 
 
+
+
+
 
 
      if test $gl_cv_have_include_next = yes; then
@@ -14934,8 +15170,10 @@ if test "${gl_cv_next_getopt_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_getopt_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_getopt_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -14944,20 +15182,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <getopt.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/getopt.h#{
-                 s#.*"\(.*/getopt.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/getopt.h#{
+                    s#.*"\(.*/getopt.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_getopt_h='<'getopt.h'>'
-          fi
+               gl_cv_next_getopt_h='<'getopt.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_getopt_h" >&5
@@ -14977,11 +15216,6 @@ $as_echo "$gl_cv_next_getopt_h" >&6; }
 
 
 
-
-
-
-
-
   if test $ac_cv_header_getopt_h = yes; then
     HAVE_GETOPT_H=1
   else
@@ -15253,27 +15487,24 @@ done
 
   fi
 
-              if test -z "$gl_replace_getopt"; then
-    { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5
-$as_echo_n "checking whether optreset is declared... " >&6; }
-if test "${ac_cv_have_decl_optreset+set}" = set; then
+                    if test -z "$gl_replace_getopt"; then
+    { $as_echo "$as_me:$LINENO: checking whether getopt is POSIX compatible" >&5
+$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
+if test "${gl_cv_func_getopt_posix+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+                                                                        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <getopt.h>
-
+#include <unistd.h>
 int
 main ()
 {
-#ifndef optreset
-  (void) optreset;
-#endif
-
+int *p = &optreset; return optreset;
   ;
   return 0;
 }
@@ -15296,50 +15527,22 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_optreset=yes
+  gl_optind_min=1
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_optreset=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
-$as_echo "$ac_cv_have_decl_optreset" >&6; }
-if test "x$ac_cv_have_decl_optreset" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTRESET 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTRESET 0
-_ACEOF
-
-{ $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5
-$as_echo_n "checking whether getopt_clip is declared... " >&6; }
-if test "${ac_cv_have_decl_getopt_clip+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <getopt.h>
-
 int
 main ()
 {
-#ifndef getopt_clip
-  (void) getopt_clip;
-#endif
-
+return !getopt_clip;
   ;
   return 0;
 }
@@ -15362,48 +15565,22 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_getopt_clip=yes
+  gl_optind_min=1
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_have_decl_getopt_clip=no
+       gl_optind_min=0
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
-$as_echo "$ac_cv_have_decl_getopt_clip" >&6; }
-if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETOPT_CLIP 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETOPT_CLIP 0
-_ACEOF
-
-
-fi
-
-
-
-fi
-
-
-  fi
 
-                    if test -z "$gl_replace_getopt"; then
-    { $as_echo "$as_me:$LINENO: checking whether getopt is POSIX compatible" >&5
-$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
-if test "${gl_cv_func_getopt_posix+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-                if test "$cross_compiling" = yes; then
+                gl_save_CPPFLAGS=$CPPFLAGS
+        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
+        if test "$cross_compiling" = yes; then
   case "$host_os" in
              mingw*)         gl_cv_func_getopt_posix="guessing no";;
              darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
@@ -15422,12 +15599,6 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdlib.h>
 #include <string.h>
 
-#if !HAVE_DECL_OPTRESET && !HAVE_DECL_GETOPT_CLIP
-# define OPTIND_MIN 0
-#else
-# define OPTIND_MIN 1
-#endif
-
 int
 main ()
 {
@@ -15545,6 +15716,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 
 
+        CPPFLAGS=$gl_save_CPPFLAGS
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_getopt_posix" >&5
@@ -15596,6 +15768,7 @@ int
 main ()
 {
 
+             int result = 0;
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
                 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
@@ -15606,7 +15779,7 @@ main ()
                myargv[2] = 0;
                opterr = 0;
                if (getopt (2, myargv, "+a") != '?')
-                 return 1;
+                 result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
                 and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
@@ -15616,33 +15789,33 @@ main ()
 
                optind = 1;
                if (getopt (4, argv, "p::") != 'p')
-                 return 2;
-               if (optarg != NULL)
-                 return 3;
-               if (getopt (4, argv, "p::") != -1)
-                 return 4;
-               if (optind != 2)
-                 return 5;
+                 result |= 2;
+               else if (optarg != NULL)
+                 result |= 4;
+               else if (getopt (4, argv, "p::") != -1)
+                 result |= 6;
+               else if (optind != 2)
+                 result |= 8;
              }
              /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
              {
                char *argv[] = { "program", "foo", "-p", NULL };
                optind = 0;
                if (getopt (3, argv, "-p") != 1)
-                 return 6;
-               if (getopt (3, argv, "-p") != 'p')
-                 return 7;
+                 result |= 16;
+               else if (getopt (3, argv, "-p") != 'p')
+                 result |= 32;
              }
              /* This code fails on glibc 2.11.  */
              {
                char *argv[] = { "program", "-b", "-a", NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 return 8;
-               if (getopt (3, argv, "+:a:b") != ':')
-                 return 9;
+                 result |= 64;
+               else if (getopt (3, argv, "+:a:b") != ':')
+                 result |= 64;
              }
-             return 0;
+             return result;
 
   ;
   return 0;
@@ -15778,6 +15951,9 @@ fi
 
 
 
+
+
+
 
 
 
@@ -15791,8 +15967,10 @@ if test "${gl_cv_next_sys_time_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_sys_time_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_sys_time_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -15801,20 +15979,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/time.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/sys/time.h#{
-                 s#.*"\(.*/sys/time.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/sys/time.h#{
+                    s#.*"\(.*/sys/time.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_sys_time_h='<'sys/time.h'>'
-          fi
+               gl_cv_next_sys_time_h='<'sys/time.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5
@@ -15834,6 +16013,7 @@ $as_echo "$gl_cv_next_sys_time_h" >&6; }
 
 
 
+
   if test $ac_cv_header_sys_time_h != yes; then
     HAVE_SYS_TIME_H=0
   fi
@@ -16178,13 +16358,7 @@ _ACEOF
 
 fi
 
-   if test $ac_cv_header_stdbool_h = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STDBOOL_H 1
-_ACEOF
-
-   fi
 
 
 
@@ -16205,12 +16379,14 @@ _ACEOF
 
 
 
-  { $as_echo "$as_me:$LINENO: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if test "${ac_cv_type_long_long_int+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_unsigned_long_long_int=yes
+     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+       cat >conftest.$ac_ext <<_ACEOF
 
   /* confdefs.h.  */
 _ACEOF
@@ -16267,8 +16443,42 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-                          if test "$cross_compiling" = yes; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_unsigned_long_long_int=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+_ACEOF
+
+  fi
+
+
+
+  { $as_echo "$as_me:$LINENO: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if test "${ac_cv_type_long_long_int+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
   ac_cv_type_long_long_int=yes
+      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+        if test $ac_cv_type_long_long_int = yes; then
+                                        if test "$cross_compiling" = yes; then
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -16277,25 +16487,25 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <limits.h>
-               #ifndef LLONG_MAX
-               # define HALF \
-                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-               # define LLONG_MAX (HALF - 1 + HALF)
-               #endif
+                 #ifndef LLONG_MAX
+                 # define HALF \
+                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+                 # define LLONG_MAX (HALF - 1 + HALF)
+                 #endif
 int
 main ()
 {
 long long int n = 1;
-               int i;
-               for (i = 0; ; i++)
-                 {
-                   long long int m = n << i;
-                   if (m >> i != n)
-                     return 1;
-                   if (LLONG_MAX / 2 < m)
-                     break;
-                 }
-               return 0;
+                 int i;
+                 for (i = 0; ; i++)
+                   {
+                     long long int m = n << i;
+                     if (m >> i != n)
+                       return 1;
+                     if (LLONG_MAX / 2 < m)
+                       break;
+                   }
+                 return 0;
   ;
   return 0;
 }
@@ -16322,7 +16532,7 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_long_long_int=yes
+  :
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
@@ -16336,16 +16546,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_type_long_long_int=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+        fi
+      fi
 fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
 $as_echo "$ac_cv_type_long_long_int" >&6; }
@@ -16358,91 +16560,6 @@ _ACEOF
   fi
 
 
-  { $as_echo "$as_me:$LINENO: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-
-  /* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
-      int i = 63;
-int
-main ()
-{
-/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));
-  ;
-  return 0;
-}
-
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_type_unsigned_long_long_int=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_type_unsigned_long_long_int=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UNSIGNED_LONG_LONG_INT 1
-_ACEOF
-
-  fi
-
-
 
 
 
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   if test $gl_cv_c_multiarch = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define AA_APPLE_UNIVERSAL_BUILD 1
-_ACEOF
-
     APPLE_UNIVERSAL_BUILD=1
   else
     APPLE_UNIVERSAL_BUILD=0
@@ -16538,6 +16650,19 @@ _ACEOF
   fi
 
 
+
+
+
+
+
+
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+
+
       if test $ac_cv_header_inttypes_h = yes; then
     HAVE_INTTYPES_H=1
   else
@@ -16563,6 +16688,9 @@ _ACEOF
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdint_h='<'stdint.h'>'
      else
@@ -16572,8 +16700,10 @@ if test "${gl_cv_next_stdint_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdint_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_stdint_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -16582,20 +16712,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdint.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdint.h#{
-                 s#.*"\(.*/stdint.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/stdint.h#{
+                    s#.*"\(.*/stdint.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_stdint_h='<'stdint.h'>'
-          fi
+               gl_cv_next_stdint_h='<'stdint.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5
@@ -16614,6 +16745,7 @@ $as_echo "$gl_cv_next_stdint_h" >&6; }
 
 
 
+
   if test $ac_cv_header_stdint_h = yes; then
     HAVE_STDINT_H=1
   else
@@ -16731,9 +16863,11 @@ uintmax_t j = UINTMAX_MAX;
 
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
 #define TYPE_MAXIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+  ((t) ((t) 0 < (t) -1 \
+        ? (t) -1 \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
 struct s {
   int check_PTRDIFF:
       PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
@@ -16890,7 +17024,7 @@ main ()
           || strncmp (value, "((int)"/*)*/, 6) == 0
           || strncmp (value, "((signed short)"/*)*/, 15) == 0
           || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return 1;
+        return mv - macro_values + 1;
     }
   return 0;
 
@@ -17116,13 +17250,6 @@ done
 
 
 
-
-
-
-
-
-
-
   if test $APPLE_UNIVERSAL_BUILD = 0; then
 
 
   HAVE_DECL_STRTOUMAX=1;
 
 
-  GNULIB_NL_LANGINFO=0;
-    HAVE_NL_LANGINFO=1;
-  REPLACE_NL_LANGINFO=0;
-
-
+  GNULIB_ISWBLANK=0;
+  GNULIB_WCTYPE=0;
+  GNULIB_ISWCTYPE=0;
+  GNULIB_WCTRANS=0;
+  GNULIB_TOWCTRANS=0;
+    HAVE_ISWBLANK=1;
+  HAVE_WCTYPE_T=1;
+  HAVE_WCTRANS_T=1;
+  REPLACE_ISWBLANK=0;
 
 
 
 
-
-
-  { $as_echo "$as_me:$LINENO: checking whether lstat correctly handles trailing slash" >&5
-$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for wint_t" >&5
+$as_echo_n "checking for wint_t... " >&6; }
+if test "${gt_cv_c_wint_t+set}" = set; then
   $as_echo_n "(cached) " >&6
-else
-  rm -f conftest.sym conftest.file
-     echo >conftest.file
-     if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
-       if test "$cross_compiling" = yes; then
-  # When cross-compiling, be pessimistic so we will end up using the
-          # replacement version of lstat that checks for trailing slashes and
-          # calls lstat a second time when necessary.
-          ac_cv_func_lstat_dereferences_slashed_symlink=no
-
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -18797,73 +18916,64 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+   before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+            wint_t foo = (wchar_t)'\0';
 int
 main ()
 {
-struct stat sbuf;
-              /* Linux will dereference the symlink and fail, as required by
-                 POSIX.  That is better in the sense that it means we will not
-                 have to compile and use the lstat wrapper.  */
-              return lstat ("conftest.sym/", &sbuf) == 0;
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_lstat_dereferences_slashed_symlink=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_c_wint_t=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_func_lstat_dereferences_slashed_symlink=no
+       gt_cv_c_wint_t=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5
+$as_echo "$gt_cv_c_wint_t" >&6; }
+  if test $gt_cv_c_wint_t = yes; then
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WINT_T 1
+_ACEOF
 
-     else
-       # If the 'ln -s' command failed, then we probably don't even
-       # have an lstat function.
-       ac_cv_func_lstat_dereferences_slashed_symlink=no
-     fi
-     rm -f conftest.sym conftest.file
+  fi
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-  test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
 
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
 
-  if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
 
 
 
@@ -18872,43 +18982,665 @@ _ACEOF
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
+  if test $ac_cv_func_iswcntrl = yes; then
+    HAVE_ISWCNTRL=1
+  else
+    HAVE_ISWCNTRL=0
+  fi
+
 
+
+
+
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
   fi
 
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking whether unlink honors trailing slashes" >&5
-$as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
-if test "${gl_cv_func_unlink_honors_slashes+set}" = set; then
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_wctype_h='<'wctype.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <wctype.h>" >&5
+$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
+if test "${gl_cv_next_wctype_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  touch conftest.file
-     # Assume that if we have lstat, we can also check symlinks.
-     if test $ac_cv_func_lstat = yes; then
-       ln -s conftest.file conftest.lnk
+
+             if test $ac_cv_header_wctype_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <wctype.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/wctype.h#{
+                    s#.*"\(.*/wctype.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+          else
+               gl_cv_next_wctype_h='<'wctype.h'>'
+             fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_wctype_h" >&5
+$as_echo "$gl_cv_next_wctype_h" >&6; }
      fi
-     if test "$cross_compiling" = yes; then
-  gl_cv_func_unlink_honors_slashes="guessing no"
+     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'wctype.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_wctype_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+
+
+
+
+  if test $ac_cv_header_wctype_h = yes; then
+    if test $ac_cv_func_iswcntrl = yes; then
+                  { $as_echo "$as_me:$LINENO: checking whether iswcntrl works" >&5
+$as_echo_n "checking whether iswcntrl works... " >&6; }
+if test "${gl_cv_func_iswcntrl_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
+
+          if test "$cross_compiling" = yes; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <unistd.h>
-           #include <errno.h>
-
+#include <stdlib.h>
+                          #if __GNU_LIBRARY__ == 1
+                          Linux libc5 i18n is broken.
+                          #endif
 int
 main ()
 {
-if (!unlink ("conftest.file/") || errno != ENOTDIR) return 1;
-#if HAVE_LSTAT
-      if (!unlink ("conftest.lnk/") || errno != ENOTDIR) return 2;
-#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_iswcntrl_works=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_iswcntrl_works=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+               /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+                  included before <wchar.h>.
+                  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+                  must be included before <wchar.h>.  */
+               #include <stddef.h>
+               #include <stdio.h>
+               #include <time.h>
+               #include <wchar.h>
+               #include <wctype.h>
+               int main () { return iswprint ('x') == 0; }
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_iswcntrl_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_iswcntrl_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_iswcntrl_works" >&5
+$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
+    fi
+    HAVE_WCTYPE_H=1
+  else
+    HAVE_WCTYPE_H=0
+  fi
+
+
+  if test "$gl_cv_func_iswcntrl_works" = no; then
+    REPLACE_ISWCNTRL=1
+  else
+    REPLACE_ISWCNTRL=0
+  fi
+
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        :
+  fi
+
+          { $as_echo "$as_me:$LINENO: checking for wctype_t" >&5
+$as_echo_n "checking for wctype_t... " >&6; }
+if test "${gl_cv_type_wctype_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #if HAVE_WCTYPE_H
+            # include <wctype.h>
+            #endif
+            wctype_t a;
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_type_wctype_t=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_type_wctype_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_type_wctype_t" >&5
+$as_echo "$gl_cv_type_wctype_t" >&6; }
+  if test $gl_cv_type_wctype_t = no; then
+    HAVE_WCTYPE_T=0
+  fi
+
+      { $as_echo "$as_me:$LINENO: checking for wctrans_t" >&5
+$as_echo_n "checking for wctrans_t... " >&6; }
+if test "${gl_cv_type_wctrans_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #include <wctype.h>
+            wctrans_t a;
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_type_wctrans_t=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_type_wctrans_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_type_wctrans_t" >&5
+$as_echo "$gl_cv_type_wctrans_t" >&6; }
+  if test $gl_cv_type_wctrans_t = no; then
+    HAVE_WCTRANS_T=0
+  fi
+
+
+
+
+
+
+  for gl_func in wctype iswctype wctrans towctrans     ; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether iswblank is declared" >&5
+$as_echo_n "checking whether iswblank is declared... " >&6; }
+if test "${ac_cv_have_decl_iswblank+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef iswblank
+  (void) iswblank;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_iswblank=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_iswblank=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_iswblank" >&5
+$as_echo "$ac_cv_have_decl_iswblank" >&6; }
+if test "x$ac_cv_have_decl_iswblank" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISWBLANK 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISWBLANK 0
+_ACEOF
+
+
+fi
+
+
+
+  GNULIB_NL_LANGINFO=0;
+    HAVE_NL_LANGINFO=1;
+  REPLACE_NL_LANGINFO=0;
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
+if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  rm -f conftest.sym conftest.file
+     echo >conftest.file
+     if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+       if test "$cross_compiling" = yes; then
+  # When cross-compiling, be pessimistic so we will end up using the
+          # replacement version of lstat that checks for trailing slashes and
+          # calls lstat a second time when necessary.
+          ac_cv_func_lstat_dereferences_slashed_symlink=no
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+              /* Linux will dereference the symlink and fail, as required by
+                 POSIX.  That is better in the sense that it means we will not
+                 have to compile and use the lstat wrapper.  */
+              return lstat ("conftest.sym/", &sbuf) == 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_lstat_dereferences_slashed_symlink=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+     else
+       # If the 'ln -s' command failed, then we probably don't even
+       # have an lstat function.
+       ac_cv_func_lstat_dereferences_slashed_symlink=no
+     fi
+     rm -f conftest.sym conftest.file
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+  test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+  if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
+
+  fi
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking whether unlink honors trailing slashes" >&5
+$as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
+if test "${gl_cv_func_unlink_honors_slashes+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  touch conftest.file
+     # Assume that if we have lstat, we can also check symlinks.
+     if test $ac_cv_func_lstat = yes; then
+       ln -s conftest.file conftest.lnk
+     fi
+     if test "$cross_compiling" = yes; then
+  gl_cv_func_unlink_honors_slashes="guessing no"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+           #include <errno.h>
+
+int
+main ()
+{
+int result = 0;
+           if (!unlink ("conftest.file/"))
+             result |= 1;
+           else if (errno != ENOTDIR)
+             result |= 2;
+#if HAVE_LSTAT
+           if (!unlink ("conftest.lnk/"))
+             result |= 4;
+           else if (errno != ENOTDIR)
+             result |= 8;
+#endif
+           return result;
 
   ;
   return 0;
@@ -18954,8 +19686,8 @@ fi
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_unlink_honors_slashes" >&5
 $as_echo "$gl_cv_func_unlink_honors_slashes" >&6; }
-      { $as_echo "$as_me:$LINENO: checking whether unlink of a parent directory fails is it should" >&5
-$as_echo_n "checking whether unlink of a parent directory fails is it should... " >&6; }
+      { $as_echo "$as_me:$LINENO: checking whether unlink of a parent directory fails as it should" >&5
+$as_echo_n "checking whether unlink of a parent directory fails as it should... " >&6; }
 if test "${gl_cv_func_unlink_parent_fails+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
@@ -18993,9 +19725,12 @@ cat >>conftest.$ac_ext <<_ACEOF
                 #include <unistd.h>
                 int main ()
                 {
+                  int result = 0;
                   if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0)
-                    return 1;
-                  return unlink ("..") == 0;
+                    result |= 1;
+                  else if (unlink ("..") == 0)
+                    result |= 2;
+                  return result;
                 }
 
 _ACEOF
@@ -19326,6 +20061,7 @@ done
   fi
 
 
+
   { $as_echo "$as_me:$LINENO: checking for fchownat" >&5
 $as_echo_n "checking for fchownat... " >&6; }
 if test "${ac_cv_func_fchownat+set}" = set; then
@@ -19413,6 +20149,8 @@ fi
 $as_echo "$ac_cv_func_fchownat" >&6; }
 if test "x$ac_cv_func_fchownat" = x""yes; then
 
+
+
   { $as_echo "$as_me:$LINENO: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5
 $as_echo_n "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... " >&6; }
 if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then
@@ -19497,6 +20235,96 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
+fi
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether fchownat works with an empty file name" >&5
+$as_echo_n "checking whether fchownat works with an empty file name... " >&6; }
+if test "${gl_cv_func_fchownat_empty_filename_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  gl_cv_func_fchownat_empty_filename_works="guessing no"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+            #include <fcntl.h>
+
+int
+main ()
+{
+int fd;
+            int ret;
+            if (mkdir ("conftestdir", 0700) < 0)
+              return 2;
+            fd = open ("conftestdir", O_RDONLY);
+            if (fd < 0)
+              return 3;
+            ret = fchownat (fd, "", -1, -1, 0);
+            close (fd);
+            rmdir ("conftestdir");
+            return ret == 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_fchownat_empty_filename_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_fchownat_empty_filename_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fchownat_empty_filename_works" >&5
+$as_echo "$gl_cv_func_fchownat_empty_filename_works" >&6; }
+  if test "$gl_cv_func_fchownat_empty_filename_works" != yes; then
+  REPLACE_FCHOWNAT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define FCHOWNAT_EMPTY_FILENAME_BUG 1
+_ACEOF
+
+
 fi
 
 
@@ -19526,8 +20354,8 @@ fi
 
 
 
-    { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5
-$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; }
+    { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5
+$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; }
 if test "${ac_cv_gnu_library_2_1+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
@@ -19544,10 +20372,13 @@ cat >>conftest.$ac_ext <<_ACEOF
   Lucky GNU user
  #endif
 #endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky GNU user" >/dev/null 2>&1; then
+  $EGREP "Lucky" >/dev/null 2>&1; then
   ac_cv_gnu_library_2_1=yes
 else
   ac_cv_gnu_library_2_1=no
@@ -19887,7 +20718,17 @@ int main ()
 {
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Win32, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -19930,42 +20771,57 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the AIX locale name.
-      if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_ja=ja_JP
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_ja=ja_JP.EUC-JP
-        else
-          # Test for the HP-UX, OSF/1, NetBSD locale name.
-          if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_ja=ja_JP.eucJP
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
+          # and CP932 is very different from EUC-JP, so we cannot use it here.
+          gt_cv_locale_ja=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the AIX locale name.
+          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_ja=ja_JP
           else
-            # Test for the IRIX, FreeBSD locale name.
-            if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_ja=ja_JP.EUC
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_ja=ja_JP.EUC-JP
             else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_ja=ja
+              # Test for the HP-UX, OSF/1, NetBSD locale name.
+              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_ja=ja_JP.eucJP
               else
-                # Special test for NetBSD 1.6.
-                if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
-                  gt_cv_locale_ja=ja_JP.eucJP
+                # Test for the IRIX, FreeBSD locale name.
+                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                  gt_cv_locale_ja=ja_JP.EUC
                 else
-                  # None found.
-                  gt_cv_locale_ja=none
+                  # Test for the Solaris 7 locale name.
+                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                    gt_cv_locale_ja=ja
+                  else
+                    # Special test for NetBSD 1.6.
+                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
+                      gt_cv_locale_ja=ja_JP.eucJP
+                    else
+                      # None found.
+                      gt_cv_locale_ja=none
+                    fi
+                  fi
                 fi
               fi
             fi
           fi
-        fi
-      fi
+          ;;
+      esac
     fi
     rm -fr conftest*
 
@@ -20005,7 +20861,17 @@ int main ()
 {
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Win32, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -20048,22 +20914,41 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the locale name without encoding suffix.
-      if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_zh_CN=zh_CN
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_zh_CN=zh_CN.GB18030
-        else
-          # None found.
-          gt_cv_locale_zh_CN=none
-        fi
-      fi
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the hypothetical native Win32 locale name.
+          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_zh_CN=Chinese_China.54936
+          else
+            # None found.
+            gt_cv_locale_zh_CN=none
+          fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the locale name without encoding suffix.
+          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_zh_CN=zh_CN
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_zh_CN=zh_CN.GB18030
+            else
+              # None found.
+              gt_cv_locale_zh_CN=none
+            fi
+          fi
+          ;;
+      esac
     else
       # If there was a link error, due to mblen(), the system is so old that
       # it certainly doesn't have a chinese locale.
@@ -20107,7 +20992,17 @@ int main () {
      variables, and all locales use the UTF-8 encoding.  */
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Win32, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is speficied, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -20148,27 +21043,46 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr_utf8=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr_utf8=fr_FR.UTF-8
-        else
-          # Test for the Solaris 7 locale name.
-          if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr_utf8=fr.UTF-8
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the hypothetical native Win32 locale name.
+          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=French_France.65001
           else
             # None found.
             gt_cv_locale_fr_utf8=none
           fi
-        fi
-      fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the usual locale name.
+          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=fr_FR
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_fr_utf8=fr_FR.UTF-8
+            else
+              # Test for the Solaris 7 locale name.
+              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_fr_utf8=fr.UTF-8
+              else
+                # None found.
+                gt_cv_locale_fr_utf8=none
+              fi
+            fi
+          fi
+          ;;
+      esac
     fi
     rm -fr conftest*
 
@@ -20211,6 +21125,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   GNULIB_MBSSEP=0;
   GNULIB_MBSTOK_R=0;
   GNULIB_STRERROR=0;
+  GNULIB_STRERROR_R=0;
   GNULIB_STRSIGNAL=0;
   GNULIB_STRVERSCMP=0;
   HAVE_MBSLEN=0;
@@ -20229,6 +21144,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   HAVE_STRSEP=1;
   HAVE_STRCASESTR=1;
   HAVE_DECL_STRTOK_R=1;
+  HAVE_DECL_STRERROR_R=1;
   HAVE_DECL_STRSIGNAL=1;
   HAVE_STRVERSCMP=1;
   REPLACE_MEMCHR=0;
@@ -20238,6 +21154,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   REPLACE_STRSTR=0;
   REPLACE_STRCASESTR=0;
   REPLACE_STRERROR=0;
+  REPLACE_STRERROR_R=0;
   REPLACE_STRNCAT=0;
   REPLACE_STRNDUP=0;
   REPLACE_STRNLEN=0;
@@ -20246,77 +21163,6 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   UNDEFINE_STRTOK_R=0;
 
 
-  { $as_echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5
-$as_echo_n "checking whether mbrtowc and mbstate_t are properly declared... " >&6; }
-if test "${ac_cv_func_mbrtowc+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <wchar.h>
-int
-main ()
-{
-wchar_t wc;
-             char const s[] = "";
-             size_t n = 1;
-             mbstate_t state;
-             return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_mbrtowc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_func_mbrtowc=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mbrtowc" >&5
-$as_echo "$ac_cv_func_mbrtowc" >&6; }
-  if test $ac_cv_func_mbrtowc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MBRTOWC 1
-_ACEOF
-
-  fi
-
-
-
-
-
 
 
 
@@ -20540,6 +21386,7 @@ int
 main ()
 {
 
+  int result = 0;
   char *fence = NULL;
 #if HAVE_SYS_MMAN_H && HAVE_MPROTECT
 # if HAVE_MAP_ANONYMOUS
@@ -20563,14 +21410,14 @@ main ()
   if (fence)
     {
       if (memchr (fence, 0, 0))
-        return 1;
+        result |= 1;
       strcpy (fence - 9, "12345678");
       if (memchr (fence - 9, 0, 79) != fence - 1)
-        return 2;
+        result |= 2;
       if (memchr (fence - 1, 0, 3) != fence - 1)
-        return 3;
+        result |= 4;
     }
-  return 0;
+  return result;
 
   ;
   return 0;
@@ -20870,7 +21717,7 @@ fi
   GNULIB_STRPTIME=0;
   GNULIB_TIMEGM=0;
   GNULIB_TIME_R=0;
-    HAVE_LOCALTIME_R=1;
+    HAVE_DECL_LOCALTIME_R=1;
   HAVE_NANOSLEEP=1;
   HAVE_STRPTIME=1;
   HAVE_TIMEGM=1;
 
 
 
+{ $as_echo "$as_me:$LINENO: checking whether setenv is declared" >&5
+$as_echo_n "checking whether setenv is declared... " >&6; }
+if test "${ac_cv_have_decl_setenv+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef setenv
+  (void) setenv;
+#endif
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_setenv=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_setenv=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_setenv" >&5
+$as_echo "$ac_cv_have_decl_setenv" >&6; }
+if test "x$ac_cv_have_decl_setenv" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SETENV 1
+_ACEOF
 
 
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SETENV 0
+_ACEOF
+
+
+fi
 
 
 
 
 
 
+
+
+
+  if test $ac_cv_have_decl_setenv = no; then
+    HAVE_DECL_SETENV=0
+  fi
+
+
+
+
+
+
   if test $ac_cv_func_setenv = no; then
     HAVE_SETENV=0
   else
@@ -21160,10 +22083,20 @@ int
 main ()
 {
 
-       if (setenv ("", "", 0) != -1) return 1;
-       if (errno != EINVAL) return 2;
-       if (setenv ("a", "=", 1) != 0) return 3;
-       if (strcmp (getenv ("a"), "=") != 0) return 4;
+       int result = 0;
+       {
+         if (setenv ("", "", 0) != -1)
+           result |= 1;
+         else if (errno != EINVAL)
+           result |= 2;
+       }
+       {
+         if (setenv ("a", "=", 1) != 0)
+           result |= 4;
+         else if (strcmp (getenv ("a"), "=") != 0)
+           result |= 8;
+       }
+       return result;
 
   ;
   return 0;
@@ -21487,6 +22420,109 @@ done
 
 
 
+
+
+     { $as_echo "$as_me:$LINENO: checking whether snprintf returns a byte count as in C99" >&5
+$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; }
+if test "${gl_cv_func_snprintf_retval_c99+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+      if test "$cross_compiling" = yes; then
+
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
+         esac
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+  strcpy (buf, "ABCDEF");
+  if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+    return 1;
+  if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+    return 2;
+  if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+    return 3;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_snprintf_retval_c99=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_snprintf_retval_c99=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_snprintf_retval_c99" >&5
+$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
+
 { $as_echo "$as_me:$LINENO: checking whether snprintf is declared" >&5
 $as_echo_n "checking whether snprintf is declared... " >&6; }
 if test "${ac_cv_have_decl_snprintf+set}" = set; then
@@ -21557,8 +22593,6 @@ fi
 
 
 
-
-
     REPLACE_NULL=0;
   HAVE_WCHAR_T=1;
   STDDEF_H='';
@@ -21624,54 +22658,6 @@ _ACEOF
   fi
 
 
-
-
-        { $as_echo "$as_me:$LINENO: checking whether C symbols are prefixed with underscore at the linker level" >&5
-$as_echo_n "checking whether C symbols are prefixed with underscore at the linker level... " >&6; }
-if test "${gl_cv_prog_as_underscore+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<EOF
-#ifdef __cplusplus
-extern "C" int foo (void);
-#endif
-int foo(void) { return 0; }
-EOF
-     # Look for the assembly language name in the .s file.
-     { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } >/dev/null 2>&1
-     if grep _foo conftest.s >/dev/null ; then
-       gl_cv_prog_as_underscore=yes
-     else
-       gl_cv_prog_as_underscore=no
-     fi
-     rm -f conftest*
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_prog_as_underscore" >&5
-$as_echo "$gl_cv_prog_as_underscore" >&6; }
-  if test $gl_cv_prog_as_underscore = yes; then
-    USER_LABEL_PREFIX=_
-  else
-    USER_LABEL_PREFIX=
-  fi
-
-cat >>confdefs.h <<_ACEOF
-#define USER_LABEL_PREFIX $USER_LABEL_PREFIX
-_ACEOF
-
-  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
-
-
-
-
-
-
-
     HAVE_STRCASECMP=1;
   HAVE_DECL_STRNCASECMP=1;
 
@@ -22109,9 +23095,6 @@ done
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_string_h='<'string.h'>'
      else
@@ -22121,8 +23104,7 @@ if test "${gl_cv_next_string_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_string_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22131,20 +23113,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <string.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/string.h#{
-                 s#.*"\(.*/string.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_string_h='<'string.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/string.h#{
+                    s#.*"\(.*/string.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5
@@ -22182,7 +23162,9 @@ $as_echo "$gl_cv_next_string_h" >&6; }
 
 
 
-  for gl_func in memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup      strncat strndup strnlen strpbrk strsep strcasestr strtok_r strsignal      strverscmp; do
+
+
+  for gl_func in memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup      strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r      strsignal strverscmp; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -22266,6 +23248,9 @@ fi
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_strings_h='<'strings.h'>'
      else
@@ -22275,8 +23260,10 @@ if test "${gl_cv_next_strings_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_strings_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_strings_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22285,20 +23272,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <strings.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_strings_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/strings.h#{
-                 s#.*"\(.*/strings.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_strings_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/strings.h#{
+                    s#.*"\(.*/strings.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_strings_h='<'strings.h'>'
-          fi
+               gl_cv_next_strings_h='<'strings.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_strings_h" >&5
@@ -22321,6 +23309,7 @@ $as_echo "$gl_cv_next_strings_h" >&6; }
 
 
 
+
   for gl_func in strcasecmp strncasecmp; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
@@ -22543,8 +23532,6 @@ fi
 
 
 
-
-
   { $as_echo "$as_me:$LINENO: checking for struct timespec in <time.h>" >&5
 $as_echo_n "checking for struct timespec in <time.h>... " >&6; }
 if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then
@@ -22728,9 +23715,6 @@ $as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_time_h='<'time.h'>'
      else
@@ -22740,8 +23724,7 @@ if test "${gl_cv_next_time_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_time_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22750,20 +23733,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <time.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/time.h#{
-                 s#.*"\(.*/time.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_time_h='<'time.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/time.h#{
+                    s#.*"\(.*/time.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_time_h" >&5
@@ -22785,6 +23766,76 @@ $as_echo "$gl_cv_next_time_h" >&6; }
 
 
 
+{ $as_echo "$as_me:$LINENO: checking whether localtime_r is declared" >&5
+$as_echo_n "checking whether localtime_r is declared... " >&6; }
+if test "${ac_cv_have_decl_localtime_r+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef localtime_r
+  (void) localtime_r;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_localtime_r=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_localtime_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_localtime_r" >&5
+$as_echo "$ac_cv_have_decl_localtime_r" >&6; }
+if test "x$ac_cv_have_decl_localtime_r" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_LOCALTIME_R 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_LOCALTIME_R 0
+_ACEOF
+
+
+fi
+
+
+
 
 
 
     LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"`
   fi
 
+{ $as_echo "$as_me:$LINENO: checking whether unsetenv is declared" >&5
+$as_echo_n "checking whether unsetenv is declared... " >&6; }
+if test "${ac_cv_have_decl_unsetenv+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef unsetenv
+  (void) unsetenv;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_unsetenv=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_unsetenv=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_unsetenv" >&5
+$as_echo "$ac_cv_have_decl_unsetenv" >&6; }
+if test "x$ac_cv_have_decl_unsetenv" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UNSETENV 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UNSETENV 0
+_ACEOF
+
+
+fi
+
+
 
   { $as_echo "$as_me:$LINENO: checking whether the utimes function works" >&5
 $as_echo_n "checking whether the utimes function works... " >&6; }
@@ -22844,44 +23964,96 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdio.h>
 #include <utime.h>
 
+static int
+inorder (time_t a, time_t b, time_t c)
+{
+  return a <= b && b <= c;
+}
+
 int
 main ()
 {
-  static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
-  struct stat sbuf;
+  int result = 0;
   char const *file = "conftest.utimes";
-  FILE *f;
-  time_t now;
-  int fd;
-
-  int ok = ((f = fopen (file, "w"))
-            && fclose (f) == 0
-            && utimes (file, timeval) == 0
-            && lstat (file, &sbuf) == 0
-            && sbuf.st_atime == timeval[0].tv_sec
-            && sbuf.st_mtime == timeval[1].tv_sec);
-  unlink (file);
-  if (!ok)
-    exit (1);
-
-  ok =
-    ((f = fopen (file, "w"))
-     && fclose (f) == 0
-     && time (&now) != (time_t)-1
-     && utimes (file, NULL) == 0
-     && lstat (file, &sbuf) == 0
-     && now - sbuf.st_atime <= 2
-     && now - sbuf.st_mtime <= 2);
-  unlink (file);
-  if (!ok)
-    exit (1);
-
-  ok = (0 <= (fd = open (file, O_WRONLY|O_CREAT, 0444))
-              && close (fd) == 0
-              && utimes (file, NULL) == 0);
-  unlink (file);
-
-  exit (!ok);
+  static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
+
+  /* Test whether utimes() essentially works.  */
+  {
+    struct stat sbuf;
+    FILE *f = fopen (file, "w");
+    if (f == NULL)
+      result |= 1;
+    else if (fclose (f) != 0)
+      result |= 1;
+    else if (utimes (file, timeval) != 0)
+      result |= 2;
+    else if (lstat (file, &sbuf) != 0)
+      result |= 1;
+    else if (!(sbuf.st_atime == timeval[0].tv_sec
+               && sbuf.st_mtime == timeval[1].tv_sec))
+      result |= 4;
+    if (unlink (file) != 0)
+      result |= 1;
+  }
+
+  /* Test whether utimes() with a NULL argument sets the file's timestamp
+     to the current time.  Use 'fstat' as well as 'time' to
+     determine the "current" time, to accommodate NFS file systems
+     if there is a time skew between the host and the NFS server.  */
+  {
+    int fd = open (file, O_WRONLY|O_CREAT, 0644);
+    if (fd < 0)
+      result |= 1;
+    else
+      {
+        time_t t0, t2;
+        struct stat st0, st1, st2;
+        if (time (&t0) == (time_t) -1)
+          result |= 1;
+        else if (fstat (fd, &st0) != 0)
+          result |= 1;
+        else if (utimes (file, timeval) != 0)
+          result |= 2;
+        else if (utimes (file, NULL) != 0)
+          result |= 8;
+        else if (fstat (fd, &st1) != 0)
+          result |= 1;
+        else if (write (fd, "\n", 1) != 1)
+          result |= 1;
+        else if (fstat (fd, &st2) != 0)
+          result |= 1;
+        else if (time (&t2) == (time_t) -1)
+          result |= 1;
+        else
+          {
+            int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
+            int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
+            if (! (st1.st_atime == st1.st_mtime))
+              result |= 16;
+            if (! (m_ok_POSIX || m_ok_NFS))
+              result |= 32;
+          }
+        if (close (fd) != 0)
+          result |= 1;
+      }
+    if (unlink (file) != 0)
+      result |= 1;
+  }
+
+  /* Test whether utimes() with a NULL argument works on read-only files.  */
+  {
+    int fd = open (file, O_WRONLY|O_CREAT, 0444);
+    if (fd < 0)
+      result |= 1;
+    else if (close (fd) != 0)
+      result |= 1;
+    else if (utimes (file, NULL) != 0)
+      result |= 64;
+    if (unlink (file) != 0)
+      result |= 1;
+  }
+
+  return result;
 }
 
 _ACEOF
@@ -23021,74 +24193,20 @@ _ACEOF
 
 
 
-  { $as_echo "$as_me:$LINENO: checking for wint_t" >&5
-$as_echo_n "checking for wint_t... " >&6; }
-if test "${gt_cv_c_wint_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
-   <wchar.h>.
-   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
-   before <wchar.h>.  */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>
-            wint_t foo = (wchar_t)'\0';
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gt_cv_c_wint_t=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       gt_cv_c_wint_t=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5
-$as_echo "$gt_cv_c_wint_t" >&6; }
-  if test $gt_cv_c_wint_t = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WINT_T 1
-_ACEOF
 
+  if test $ac_cv_header_features_h = yes; then
+    HAVE_FEATURES_H=1
+  else
+    HAVE_FEATURES_H=0
   fi
 
 
+
   { $as_echo "$as_me:$LINENO: checking for inttypes.h" >&5
 $as_echo_n "checking for inttypes.h... " >&6; }
 if test "${gl_cv_header_inttypes_h+set}" = set; then
@@ -23292,106 +24410,6 @@ _ACEOF
 
 
 
-     { $as_echo "$as_me:$LINENO: checking whether snprintf returns a byte count as in C99" >&5
-$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; }
-if test "${gl_cv_func_snprintf_retval_c99+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then
-
-         case "$host_os" in
-                                 # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on FreeBSD >= 5.
-           freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on MacOS X >= 10.3.
-           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on OpenBSD >= 3.9.
-           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                                 gl_cv_func_snprintf_retval_c99="guessing no";;
-           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on Solaris >= 2.6.
-           solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
-           solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on AIX >= 4.
-           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
-           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on NetBSD >= 3.
-           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                 gl_cv_func_snprintf_retval_c99="guessing no";;
-           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # Guess yes on BeOS.
-           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
-         esac
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
-{
-  strcpy (buf, "ABCDEF");
-  if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
-    return 1;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_func_snprintf_retval_c99=yes
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-gl_cv_func_snprintf_retval_c99=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_snprintf_retval_c99" >&5
-$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
-
-
-
-
 
 
 
 
 
 
-
-{ $as_echo "$as_me:$LINENO: checking whether iswblank is declared" >&5
-$as_echo_n "checking whether iswblank is declared... " >&6; }
-if test "${ac_cv_have_decl_iswblank+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-#ifndef iswblank
-  (void) iswblank;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_iswblank=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_have_decl_iswblank=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_iswblank" >&5
-$as_echo "$ac_cv_have_decl_iswblank" >&6; }
-if test "x$ac_cv_have_decl_iswblank" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISWBLANK 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISWBLANK 0
-_ACEOF
-
-
-fi
-
-
-
-
-
    if false; then
   GL_COND_LIBTOOL_TRUE=
   GL_COND_LIBTOOL_FALSE='#'
@@ -23756,9 +24701,6 @@ fi
   # Code from module alloca-opt:
 
 
-
-
-
   if test $ac_cv_func_alloca_works = no; then
     :
   fi
@@ -24232,7 +25174,6 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 
 
 
-
   # Code from module bitrotate:
 
   # Code from module btowc:
@@ -24277,8 +25218,14 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <stdio.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -24352,8 +25299,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <locale.h>
-#include <stdio.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -24862,6 +25815,43 @@ _ACEOF
     :
 
   # Code from module configmake:
+
+          if test "x$datarootdir" = x; then
+    datarootdir='${datadir}'
+
+  fi
+    if test "x$docdir" = x; then
+    docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+
+  fi
+    if test "x$htmldir" = x; then
+    htmldir='${docdir}'
+
+  fi
+  if test "x$dvidir" = x; then
+    dvidir='${docdir}'
+
+  fi
+  if test "x$pdfdir" = x; then
+    pdfdir='${docdir}'
+
+  fi
+  if test "x$psdir" = x; then
+    psdir='${docdir}'
+
+  fi
+  if test "x$lispdir" = x; then
+    lispdir='${datarootdir}/emacs/site-lisp'
+
+  fi
+  if test "x$localedir" = x; then
+    localedir='${datarootdir}/locale'
+
+  fi
+
+      pkglibexecdir='${libexecdir}/${PACKAGE}'
+
+
   # Code from module d-ino:
   { $as_echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5
 $as_echo_n "checking for d_ino member in directory struct... " >&6; }
@@ -24890,9 +25880,14 @@ DIR *dp = opendir (".");
              if (! dp)
                return 1;
              e = readdir (dp);
-             return ! (e
-                       && stat (e->d_name, &st) == 0
-                       && e->d_ino == st.st_ino);
+             if (! e)
+               return 2;
+             if (stat (e->d_name, &st) != 0)
+               return 3;
+             if (e->d_ino != st.st_ino)
+               return 4;
+             return 0;
+
   ;
   return 0;
 }
@@ -24960,6 +25955,9 @@ _ACEOF
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_dirent_h='<'dirent.h'>'
      else
@@ -24969,8 +25967,10 @@ if test "${gl_cv_next_dirent_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_dirent_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_dirent_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -24979,20 +25979,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <dirent.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_dirent_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/dirent.h#{
-                 s#.*"\(.*/dirent.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_dirent_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/dirent.h#{
+                    s#.*"\(.*/dirent.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_dirent_h='<'dirent.h'>'
-          fi
+               gl_cv_next_dirent_h='<'dirent.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_dirent_h" >&5
@@ -25017,6 +26018,7 @@ $as_echo "$gl_cv_next_dirent_h" >&6; }
 
 
 
+
   for gl_func in alphasort dirfd fdopendir scandir; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
@@ -25122,9 +26124,6 @@ _ACEOF
 
 
 
-
-
-
 for ac_func in dirfd
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -25503,7 +26502,7 @@ _ACEOF
 
 
 
-
+  # Code from module dosname:
   # Code from module double-slash-root:
 
 
@@ -25556,6 +26555,8 @@ _ACEOF
 
 
 
+
+
   if test $ac_cv_func_dup2 = no; then
     HAVE_DUP2=0
 
@@ -25585,6 +26586,8 @@ else
              gl_cv_func_dup2_works=no;;
            freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
              gl_cv_func_dup2_works=no;;
+           haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+             gl_cv_func_dup2_works=no;;
            *) gl_cv_func_dup2_works=yes;;
          esac
 else
@@ -25596,19 +26599,29 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <unistd.h>
+#include <fcntl.h>
 #include <errno.h>
 int
 main ()
 {
-if (dup2 (1, 1) == 0)
-              return 1;
+int result = 0;
+#if HAVE_FCNTL
+            if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+              result |= 1;
+#endif HAVE_FCNTL
+            if (dup2 (1, 1) == 0)
+              result |= 2;
+#if HAVE_FCNTL
+            if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+              result |= 4;
+#endif
             close (0);
             if (dup2 (0, 0) != -1)
-              return 2;
+              result |= 8;
             /* Many gnulib modules require POSIX conformance of EBADF.  */
-            if (dup2 (1, 1000000) == -1 && errno != EBADF)
-              return 3;
-            return 0;
+            if (dup2 (2, 1000000) == -1 && errno != EBADF)
+              result |= 16;
+            return result;
 
   ;
   return 0;
@@ -25827,6 +26840,15 @@ $as_echo "$ac_cv_lib_error_at_line" >&6; }
 
 
 
+  if test $ac_cv_have_decl_fchdir = no; then
+    HAVE_DECL_FCHDIR=0
+  fi
+
+
+
+
+
+
 
   if test $ac_cv_func_fchdir = no; then
     HAVE_FCHDIR=0
@@ -26078,7 +27100,7 @@ _ACEOF
 
 
   else
-        { $as_echo "$as_me:$LINENO: checking whether fcntl handles F_DUPFD correctly" >&5
+            { $as_echo "$as_me:$LINENO: checking whether fcntl handles F_DUPFD correctly" >&5
 $as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
 if test "${gl_cv_func_fcntl_f_dupfd_works+set}" = set; then
   $as_echo_n "(cached) " >&6
@@ -26098,11 +27120,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <fcntl.h>
+#include <errno.h>
 
 int
 main ()
 {
-return fcntl (0, F_DUPFD, -1) != -1;
+int result = 0;
+      if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+      if (errno != EINVAL) result |= 2;
+      return result;
 
   ;
   return 0;
@@ -26335,9 +27361,6 @@ _ACEOF
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_fcntl_h='<'fcntl.h'>'
      else
@@ -26347,8 +27370,7 @@ if test "${gl_cv_next_fcntl_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_fcntl_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -26357,20 +27379,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <fcntl.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/fcntl.h#{
-                 s#.*"\(.*/fcntl.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_fcntl_h='<'fcntl.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/fcntl.h#{
+                    s#.*"\(.*/fcntl.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_fcntl_h" >&5
@@ -26393,6 +27413,7 @@ $as_echo "$gl_cv_next_fcntl_h" >&6; }
 
 
 
+
   for gl_func in fcntl openat; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
@@ -26586,6 +27607,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <dirent.h>
 #include <fcntl.h>
+#include <unistd.h>
 #if !HAVE_DECL_FDOPENDIR
 extern DIR *fdopendir (int);
 #endif
@@ -26593,9 +27615,12 @@ extern DIR *fdopendir (int);
 int
 main ()
 {
-int fd = open ("conftest.c", O_RDONLY);
-     if (fd < 0) return 2;
-     return !!fdopendir (fd);
+int result = 0;
+     int fd = open ("conftest.c", O_RDONLY);
+     if (fd < 0) result |= 1;
+     if (fdopendir (fd)) result |= 2;
+     if (close (fd)) result |= 4;
+     return result;
   ;
   return 0;
 }
@@ -26855,9 +27880,6 @@ fi
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_float_h='<'float.h'>'
      else
@@ -26867,8 +27889,7 @@ if test "${gl_cv_next_float_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_float_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -26877,20 +27898,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <float.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/float.h#{
-                 s#.*"\(.*/float.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_float_h='<'float.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/float.h#{
+                    s#.*"\(.*/float.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5
@@ -26909,6 +27928,7 @@ $as_echo "$gl_cv_next_float_h" >&6; }
 
 
 
+
       ;;
   esac
 
@@ -26968,33 +27988,60 @@ char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]";
             static char const a01[] = { 'a' + 1, 0 };
             static char const bs_1[] = { '\\\\' - 1, 0 };
             static char const bs01[] = { '\\\\' + 1, 0 };
-            return
-             !(n ("a*", "", 0)
-               && y ("a*", "abc", 0)
-               && n ("d*/*1", "d/s/1", FNM_PATHNAME)
-               && y ("a\\\\bc", "abc", 0)
-               && n ("a\\\\bc", "abc", FNM_NOESCAPE)
-               && y ("*x", ".x", 0)
-               && n ("*x", ".x", FNM_PERIOD)
-               && y (Apat, "\\\\", 0) && y (Apat, "A", 0)
-               && y (apat, "\\\\", 0) && y (apat, "a", 0)
-               && n (Apat, A_1, 0) == ('A' < '\\\\')
-               && n (apat, a_1, 0) == ('a' < '\\\\')
-               && y (Apat, A01, 0) == ('A' < '\\\\')
-               && y (apat, a01, 0) == ('a' < '\\\\')
-               && y (Apat, bs_1, 0) == ('A' < '\\\\')
-               && y (apat, bs_1, 0) == ('a' < '\\\\')
-               && n (Apat, bs01, 0) == ('A' < '\\\\')
-               && n (apat, bs01, 0) == ('a' < '\\\\')
-               $gl_fnmatch_gnu_start
-               && y ("xxXX", "xXxX", FNM_CASEFOLD)
-               && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
-               && n ("d*/*1", "d/s/1", FNM_FILE_NAME)
-               && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
-               && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
-               && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)
-               $gl_fnmatch_gnu_end
-              );
+            int result = 0;
+            if (!n ("a*", "", 0))
+              return 1;
+            if (!y ("a*", "abc", 0))
+              return 1;
+            if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
+              return 2;
+            if (!y ("a\\\\bc", "abc", 0))
+              return 3;
+            if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
+              return 3;
+            if (!y ("*x", ".x", 0))
+              return 4;
+            if (!n ("*x", ".x", FNM_PERIOD))
+              return 4;
+            if (!y (Apat, "\\\\", 0))
+              return 5;
+            if (!y (Apat, "A", 0))
+              return 5;
+            if (!y (apat, "\\\\", 0))
+              return 5;
+            if (!y (apat, "a", 0))
+              return 5;
+            if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
+              return 5;
+            if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
+              return 5;
+            if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
+              return 5;
+            if (!(y (apat, a01, 0) == ('a' < '\\\\')))
+              return 5;
+            if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
+              return 5;
+            if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
+              return 5;
+            if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
+              return 5;
+            if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
+              return 5;
+            $gl_fnmatch_gnu_start
+            if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
+              result |= 8;
+            if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
+              result |= 16;
+            if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
+              result |= 32;
+            if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
+              result |= 64;
+            if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
+              result |= 64;
+            if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
+              result |= 64;
+            $gl_fnmatch_gnu_end
+            return result;
 
   ;
   return 0;
@@ -27376,6 +28423,14 @@ _ACEOF
 
 
 
+
+
+
+
+  if test $ac_cv_have_decl_fseeko = no; then
+    HAVE_DECL_FSEEKO=0
+  fi
+
   if test $gl_cv_func_fseeko = no; then
     HAVE_FSEEKO=0
 
@@ -27708,7 +28763,7 @@ main ()
   size_t n_chdirs = 0;
 
   if (cwd == NULL)
-    exit (1);
+    exit (10);
 
   cwd_len = initial_cwd_len = strlen (cwd);
 
@@ -27726,7 +28781,7 @@ main ()
       if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
         {
           if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
-            fail = 2;
+            fail = 20;
           break;
         }
 
@@ -27735,12 +28790,12 @@ main ()
           c = getcwd (buf, PATH_MAX);
           if (!c && errno == ENOENT)
             {
-              fail = 1;
+              fail = 11;
               break;
             }
           if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno)))
             {
-              fail = 2;
+              fail = 21;
               break;
             }
         }
@@ -27755,12 +28810,12 @@ main ()
               if (! (errno == ERANGE || errno == ENOENT
                      || is_ENAMETOOLONG (errno)))
                 {
-                  fail = 2;
+                  fail = 22;
                   break;
                 }
               if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
                 {
-                  fail = 1;
+                  fail = 12;
                   break;
                 }
             }
@@ -27768,7 +28823,7 @@ main ()
 
       if (c && strlen (c) != cwd_len)
         {
-          fail = 2;
+          fail = 23;
           break;
         }
       ++n_chdirs;
@@ -27826,7 +28881,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 case $? in
-     1) gl_cv_func_getcwd_path_max='no, but it is partly working';;
+     10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
      *) gl_cv_func_getcwd_path_max=no;;
      esac
 fi
@@ -28163,7 +29218,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
@@ -28201,7 +29256,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         size_t siz = 0;
         int len = getdelim (&line, &siz, '\n', in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -28209,7 +29264,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getdelim (&line, &siz, '\n', in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -28620,7 +29675,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
@@ -28658,7 +29713,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         size_t siz = 0;
         int len = getline (&line, &siz, in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -28666,7 +29721,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getline (&line, &siz, in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -28764,7 +29819,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <features.h>
 #ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
   Lucky GNU user
  #endif
 #endif
@@ -28802,7 +29857,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         size_t siz = 0;
         int len = getdelim (&line, &siz, '\n', in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
-          return 1;
+          return 2;
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -28810,7 +29865,7 @@ cat >>conftest.$ac_ext <<_ACEOF
         char *line = NULL;
         size_t siz = (size_t)(~0) / 4;
         if (getdelim (&line, &siz, '\n', in) == -1)
-          return 1;
+          return 3;
       }
       return 0;
     }
@@ -31014,6 +32069,9 @@ $as_echo "$gl_cv_header_working_inttypes_h" >&6; }
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_inttypes_h='<'inttypes.h'>'
      else
@@ -31023,8 +32081,10 @@ if test "${gl_cv_next_inttypes_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_inttypes_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_inttypes_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -31033,20 +32093,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <inttypes.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/inttypes.h#{
-                 s#.*"\(.*/inttypes.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_inttypes_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/inttypes.h#{
+                    s#.*"\(.*/inttypes.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_inttypes_h='<'inttypes.h'>'
-          fi
+               gl_cv_next_inttypes_h='<'inttypes.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_inttypes_h" >&5
@@ -31069,6 +32130,7 @@ $as_echo "$gl_cv_next_inttypes_h" >&6; }
 
 
 
+
 cat >>confdefs.h <<\_ACEOF
 #define GL_TRIGGER_STDC_LIMIT_MACROS 1
 _ACEOF
       done
 
 
+  # Code from module iswblank:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_func_iswblank = no; then
+    HAVE_ISWBLANK=0
+    if test $ac_cv_have_decl_iswblank = yes; then
+      REPLACE_ISWBLANK=1
+    fi
+  fi
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        :
+  else
+    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS iswblank.$ac_objext"
+
+    fi
+  fi
+
+
+
+
+
+  GNULIB_ISWBLANK=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_ISWBLANK 1
+_ACEOF
+
+
+
   # Code from module langinfo:
 
 
@@ -31564,6 +32678,9 @@ fi
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_langinfo_h='<'langinfo.h'>'
      else
@@ -31573,8 +32690,10 @@ if test "${gl_cv_next_langinfo_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_langinfo_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_langinfo_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -31583,20 +32702,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <langinfo.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_langinfo_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/langinfo.h#{
-                 s#.*"\(.*/langinfo.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_langinfo_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/langinfo.h#{
+                    s#.*"\(.*/langinfo.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_langinfo_h='<'langinfo.h'>'
-          fi
+               gl_cv_next_langinfo_h='<'langinfo.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_langinfo_h" >&5
@@ -31616,6 +32736,7 @@ $as_echo "$gl_cv_next_langinfo_h" >&6; }
 
 
 
+
     HAVE_LANGINFO_CODESET=0
   HAVE_LANGINFO_T_FMT_AMPM=0
   HAVE_LANGINFO_ERA=0
@@ -32132,10 +33253,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-if (!link ("conftest.a", "conftest.b/")) return 1;
+int result = 0;
+             if (!link ("conftest.a", "conftest.b/"))
+               result |= 1;
 #if HAVE_LSTAT
-      if (!link ("conftest.lnk/", "conftest.b")) return 2;
+             if (!link ("conftest.lnk/", "conftest.b"))
+               result |= 2;
 #endif
+             return result;
 
   ;
   return 0;
@@ -32218,16 +33343,75 @@ _ACEOF
 
           gl_link_follows_symlinks=0 # assume GNU behavior
   if test $ac_cv_func_readlink = yes; then
-    { $as_echo "$as_me:$LINENO: checking whether link(2) dereferences a symlink" >&5
+                { $as_echo "$as_me:$LINENO: checking for __xpg4" >&5
+$as_echo_n "checking for __xpg4... " >&6; }
+if test "${gl_cv_have___xpg4+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+extern int __xpg4;
+int
+main ()
+{
+return __xpg4;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  gl_cv_have___xpg4=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_have___xpg4=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_have___xpg4" >&5
+$as_echo "$gl_cv_have___xpg4" >&6; }
+    if test $gl_cv_have___xpg4 = yes; then
+      gl_link_follows_symlinks=-1
+    else
+      { $as_echo "$as_me:$LINENO: checking whether link(2) dereferences a symlink" >&5
 $as_echo_n "checking whether link(2) dereferences a symlink... " >&6; }
 if test "${gl_cv_func_link_follows_symlink+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-      # Create a regular file.
-      echo > conftest.file
-      if test "$cross_compiling" = yes; then
-          gl_cv_func_link_follows_symlink=unknown
+         # Create a regular file.
+         echo > conftest.file
+         if test "$cross_compiling" = yes; then
+             gl_cv_func_link_follows_symlink=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -32301,23 +33485,24 @@ $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-        gl_cv_func_link_follows_symlink=yes
+           gl_cv_func_link_follows_symlink=yes
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
-      rm -f conftest.file conftest.sym conftest.hard
+         rm -f conftest.file conftest.sym conftest.hard
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_link_follows_symlink" >&5
 $as_echo "$gl_cv_func_link_follows_symlink" >&6; }
-    case $gl_cv_func_link_follows_symlink in
-      yes) gl_link_follows_symlinks=1 ;;
-      no) ;; # already defaulted to 0
-      *) gl_link_follows_symlinks=-1 ;;
-    esac
+      case $gl_cv_func_link_follows_symlink in
+        yes) gl_link_follows_symlinks=1 ;;
+        no) ;; # already defaulted to 0
+        *) gl_link_follows_symlinks=-2 ;;
+      esac
+    fi
   fi
 
 cat >>confdefs.h <<_ACEOF
@@ -32459,9 +33644,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int fd;
-              int err;
-              int ret;
+int result;
+              int fd;
               /* Create a regular file.  */
               fd = open ("conftest.a", O_CREAT | O_EXCL | O_WRONLY, 0600);
               if (fd < 0)
@@ -32475,14 +33659,15 @@ int fd;
               if (linkat (AT_FDCWD, "conftest.a", AT_FDCWD, "conftest.b",
                           AT_SYMLINK_FOLLOW) < 0)
                 return 0;
+              result = 0;
               /* Test whether a trailing "/" is treated like "/.".  */
               if (linkat (AT_FDCWD, "conftest.a/", AT_FDCWD, "conftest.c",
                           AT_SYMLINK_FOLLOW) == 0)
-                return 4;
+                result |= 4;
               if (linkat (AT_FDCWD, "conftest.a", AT_FDCWD, "conftest.d/",
                           AT_SYMLINK_FOLLOW) == 0)
-                return 5;
-              return 0;
+                result |= 8;
+              return result;
 
   ;
   return 0;
@@ -33118,6 +34303,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -33206,6 +34398,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -33302,17 +34501,125 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
 
 
+     { $as_echo "$as_me:$LINENO: checking whether mbrtowc handles a NULL pwc argument" >&5
+$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
+if test "${gl_cv_func_mbrtowc_null_arg1+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+                  case "$host_os" in
+                  # Guess no on Solaris.
+        solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
+                  # Guess yes otherwise.
+        *)        gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
+      esac
+      if test $LOCALE_FR_UTF8 != none; then
+        if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+  int result = 0;
+
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      char input[] = "\303\237er";
+      mbstate_t state;
+      wchar_t wc;
+      size_t ret;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      wc = (wchar_t) 0xBADFACE;
+      ret = mbrtowc (&wc, input, 5, &state);
+      if (ret != 2)
+        result |= 1;
+      if (!mbsinit (&state))
+        result |= 2;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      ret = mbrtowc (NULL, input, 5, &state);
+      if (ret != 2) /* Solaris 7 fails here: ret is -1.  */
+        result |= 4;
+      if (!mbsinit (&state))
+        result |= 8;
+    }
+  return result;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_mbrtowc_null_arg1=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_mbrtowc_null_arg1=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+      fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_null_arg1" >&5
+$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
+
+
+
+
      { $as_echo "$as_me:$LINENO: checking whether mbrtowc handles a NULL string argument" >&5
 $as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
-if test "${gl_cv_func_mbrtowc_null_arg+set}" = set; then
+if test "${gl_cv_func_mbrtowc_null_arg2+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
                   case "$host_os" in
               # Guess no on OSF/1.
-        osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;;
+        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
               # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_null_arg="guessing yes" ;;
+        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
       esac
       if test $LOCALE_FR_UTF8 != none; then
         if test "$cross_compiling" = yes; then
@@ -33327,6 +34634,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -33368,14 +34682,14 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  gl_cv_func_mbrtowc_null_arg=yes
+  gl_cv_func_mbrtowc_null_arg2=yes
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-gl_cv_func_mbrtowc_null_arg=no
+gl_cv_func_mbrtowc_null_arg2=no
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
       fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_null_arg" >&5
-$as_echo "$gl_cv_func_mbrtowc_null_arg" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_null_arg2" >&5
+$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
 
 
 
 
 
-     { $as_echo "$as_me:$LINENO: checking whether mbrtowc has a correct return value" >&5
+
+  { $as_echo "$as_me:$LINENO: checking whether mbrtowc has a correct return value" >&5
 $as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
 if test "${gl_cv_func_mbrtowc_retval+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
                   case "$host_os" in
-                          # Guess no on HP-UX and Solaris.
-        hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;;
-                          # Guess yes otherwise.
-        *)                gl_cv_func_mbrtowc_retval="guessing yes" ;;
+                                   # Guess no on HP-UX, Solaris, native Windows.
+        hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
+                                   # Guess yes otherwise.
+        *)                         gl_cv_func_mbrtowc_retval="guessing yes" ;;
       esac
-      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
+      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
         if test "$cross_compiling" = yes; then
   :
 else
@@ -33417,9 +34733,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
+  int result = 0;
+  int found_some_locale = 0;
   /* This fails on Solaris.  */
   if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
     {
@@ -33432,8 +34757,9 @@ int main ()
         {
           input[1] = '\0';
           if (mbrtowc (&wc, input + 2, 5, &state) != 1)
-            return 1;
+            result |= 1;
         }
+      found_some_locale = 1;
     }
   /* This fails on HP-UX 11.11.  */
   if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
@@ -33447,10 +34773,57 @@ int main ()
         {
           input[1] = '\0';
           if (mbrtowc (&wc, input + 2, 5, &state) != 2)
-            return 1;
+            result |= 2;
         }
+      found_some_locale = 1;
     }
-  return 0;
+  /* This fails on native Windows.  */
+  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+    {
+      char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 4;
+        }
+      found_some_locale = 1;
+    }
+  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+    {
+      char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 8;
+        }
+      found_some_locale = 1;
+    }
+  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+    {
+      char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 16;
+        }
+      found_some_locale = 1;
+    }
+  return (found_some_locale ? result : 77);
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -33482,7 +34855,10 @@ $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-gl_cv_func_mbrtowc_retval=no
+if test $? != 77; then
+             gl_cv_func_mbrtowc_retval=no
+           fi
+
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
@@ -33523,6 +34899,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc_nul_retval" >&5
 $as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
 
-      case "$gl_cv_func_mbrtowc_null_arg" in
+      case "$gl_cv_func_mbrtowc_null_arg1" in
+        *yes) ;;
+        *)
+cat >>confdefs.h <<\_ACEOF
+#define MBRTOWC_NULL_ARG1_BUG 1
+_ACEOF
+
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_null_arg2" in
         *yes) ;;
         *)
 cat >>confdefs.h <<\_ACEOF
-#define MBRTOWC_NULL_ARG_BUG 1
+#define MBRTOWC_NULL_ARG2_BUG 1
 _ACEOF
 
            REPLACE_MBRTOWC=1
@@ -33679,6 +35072,7 @@ _ACEOF
 
 
 
+
 
   if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
 
@@ -33709,6 +35103,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -33797,6 +35198,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -33889,6 +35297,10 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   else
     if test $REPLACE_MBSTATE_T = 1; then
       REPLACE_MBSINIT=1
+    else
+                        case "$host_os" in
+        mingw*) REPLACE_MBSINIT=1 ;;
+      esac
     fi
   fi
   if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
@@ -33973,6 +35385,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -34061,6 +35480,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -34159,6 +35585,7 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
 
 
+
      { $as_echo "$as_me:$LINENO: checking whether mbsrtowcs works" >&5
 $as_echo_n "checking whether mbsrtowcs works... " >&6; }
 if test "${gl_cv_func_mbsrtowcs_works+set}" = set; then
@@ -34166,12 +35593,12 @@ if test "${gl_cv_func_mbsrtowcs_works+set}" = set; then
 else
 
                   case "$host_os" in
-                          # Guess no on HP-UX and Solaris.
-        hpux* | solaris*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
-                          # Guess yes otherwise.
-        *)                gl_cv_func_mbsrtowcs_works="guessing yes" ;;
+                                   # Guess no on HP-UX, Solaris, mingw.
+        hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;;
+                                   # Guess yes otherwise.
+        *)                         gl_cv_func_mbsrtowcs_works="guessing yes" ;;
       esac
-      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+      if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
         if test "$cross_compiling" = yes; then
   :
 else
@@ -34184,9 +35611,30 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
+  int result = 0;
+  /* Test whether the function supports a NULL destination argument.
+     This fails on native Windows.  */
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      const char input[] = "\337er";
+      const char *src = input;
+      mbstate_t state;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbsrtowcs (NULL, &src, 1, &state) != 3
+          || src != input)
+        result |= 1;
+    }
   /* Test whether the function works when started with a conversion state
      in non-initial state.  This fails on HP-UX 11.11 and Solaris 10.  */
   if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
@@ -34200,7 +35648,7 @@ int main ()
           {
             const char *src = input + 2;
             if (mbsrtowcs (NULL, &src, 10, &state) != 4)
-              return 1;
+              result |= 2;
           }
     }
   if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
@@ -34214,7 +35662,7 @@ int main ()
           {
             const char *src = input + 4;
             if (mbsrtowcs (NULL, &src, 10, &state) != 3)
-              return 1;
+              result |= 4;
           }
     }
   if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
@@ -34228,10 +35676,10 @@ int main ()
           {
             const char *src = input + 2;
             if (mbsrtowcs (NULL, &src, 10, &state) != 4)
-              return 1;
+              result |= 8;
           }
     }
-  return 0;
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -34324,8 +35772,43 @@ _ACEOF
 
 
 
-  # Code from module mbuiter:
+  # Code from module mbtowc:
+
+
+
+  if false; then
+    REPLACE_MBTOWC=1
+  fi
+  if test $REPLACE_MBTOWC = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS mbtowc.$ac_objext"
+
 
+  :
+
+  fi
+
+
+
+
+  GNULIB_MBTOWC=1
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GNULIB_TEST_MBTOWC 1
+_ACEOF
+
+
+
+  # Code from module mbuiter:
 
 
 
@@ -34997,10 +36480,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-if (!mkfifo ("conftest.tmp/", 0600)) return 1;
+int result = 0;
+             if (!mkfifo ("conftest.tmp/", 0600))
+               result |= 1;
 #if HAVE_LSTAT
-      if (!mkfifo ("conftest.lnk/", 0600)) return 2;
+             if (!mkfifo ("conftest.lnk/", 0600))
+               result |= 2;
 #endif
+             return result;
 
   ;
   return 0;
@@ -35225,7 +36712,7 @@ $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test $? == 99 && test x"$FORCE_UNSAFE_CONFIGURE" = x; then
+if test $? = 99 && test x"$FORCE_UNSAFE_CONFIGURE" = x; then
             { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { $as_echo "$as_me:$LINENO: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
@@ -35456,22 +36943,26 @@ year_2050_test ()
 int
 main ()
 {
+  int result = 0;
   time_t t, delta;
   int i, j;
+  int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
+  int time_t_signed = ! ((time_t) 0 < (time_t) -1);
 
   /* This test makes some buggy mktime implementations loop.
      Give up after 60 seconds; a mktime slower than that
      isn't worth using anyway.  */
   alarm (60);
 
-  for (;;)
-    {
-      t = (time_t_max << 1) + 1;
-      if (t <= time_t_max)
-        break;
-      time_t_max = t;
-    }
-  time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
+  time_t_max = (! time_t_signed
+                ? (time_t) -1
+                : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
+                   * 2 + 1));
+  time_t_min = (! time_t_signed
+                ? (time_t) 0
+                : time_t_signed_magnitude
+                ? ~ (time_t) 0
+                : ~ time_t_max);
 
   delta = time_t_max / 997; /* a suitable prime number */
   for (i = 0; i < N_STRINGS; i++)
@@ -35481,21 +36972,27 @@ main ()
 
       for (t = 0; t <= time_t_max - delta; t += delta)
         if (! mktime_test (t))
-          return 1;
+          result |= 1;
       if (! (mktime_test ((time_t) 1)
              && mktime_test ((time_t) (60 * 60))
              && mktime_test ((time_t) (60 * 60 * 24))))
-        return 1;
+        result |= 2;
 
       for (j = 1; ; j <<= 1)
         if (! bigtime_test (j))
-          return 1;
+          result |= 4;
         else if (INT_MAX / 2 < j)
           break;
       if (! bigtime_test (INT_MAX))
-        return 1;
+        result |= 8;
     }
-  return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+  if (! irix_6_4_bug ())
+    result |= 16;
+  if (! spring_forward_gap ())
+    result |= 32;
+  if (! year_2050_test ())
+    result |= 64;
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -35597,8 +37094,91 @@ _ACEOF
 
 
 
-  if test $ac_cv_func_nl_langinfo = yes; then
-    if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
+     if test $ac_cv_func_nl_langinfo = yes; then
+    # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
+    { $as_echo "$as_me:$LINENO: checking whether YESEXPR works" >&5
+$as_echo_n "checking whether YESEXPR works... " >&6; }
+if test "${gl_cv_func_nl_langinfo_yesexpr_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+
+         case "$host_os" in
+                   # Guess no on irix systems.
+           irix*)  gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
+                   # Guess yes elsewhere.
+           *)      gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
+         esac
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <langinfo.h>
+
+int
+main ()
+{
+return !*nl_langinfo(YESEXPR);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_nl_langinfo_yesexpr_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_nl_langinfo_yesexpr_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5
+$as_echo "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; }
+    case $gl_cv_func_nl_langinfo_yesexpr_works in
+      *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
+      *)    FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
+    esac
+
+cat >>confdefs.h <<_ACEOF
+#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS
+_ACEOF
+
+    if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
+        && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
       :
     else
       REPLACE_NL_LANGINFO=1
@@ -35782,7 +37362,7 @@ else
           if test "$cross_compiling" = yes; then
 
              case "$host_os" in
-               freebsd* | aix* | hpux* | solaris2.[0-9]*)
+               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
                  gl_cv_func_open_slash="guessing no" ;;
                *)
                  gl_cv_func_open_slash="guessing yes" ;;
@@ -35802,10 +37382,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 int main ()
 {
+  int result = 0;
 #if HAVE_LSTAT
-  if (open ("conftest.lnk/", O_RDONLY) != -1) return 2;
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
 #endif
-  return open ("conftest.sl/", O_CREAT, 0600) >= 0;
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -36143,6 +37727,7 @@ done
   fi
 
 
+
   { $as_echo "$as_me:$LINENO: checking for fchownat" >&5
 $as_echo_n "checking for fchownat... " >&6; }
 if test "${ac_cv_func_fchownat+set}" = set; then
@@ -36230,6 +37815,8 @@ fi
 $as_echo "$ac_cv_func_fchownat" >&6; }
 if test "x$ac_cv_func_fchownat" = x""yes; then
 
+
+
   { $as_echo "$as_me:$LINENO: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5
 $as_echo_n "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... " >&6; }
 if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then
@@ -36314,6 +37901,96 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
+fi
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether fchownat works with an empty file name" >&5
+$as_echo_n "checking whether fchownat works with an empty file name... " >&6; }
+if test "${gl_cv_func_fchownat_empty_filename_works+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  gl_cv_func_fchownat_empty_filename_works="guessing no"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+            #include <fcntl.h>
+
+int
+main ()
+{
+int fd;
+            int ret;
+            if (mkdir ("conftestdir", 0700) < 0)
+              return 2;
+            fd = open ("conftestdir", O_RDONLY);
+            if (fd < 0)
+              return 3;
+            ret = fchownat (fd, "", -1, -1, 0);
+            close (fd);
+            rmdir ("conftestdir");
+            return ret == 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_func_fchownat_empty_filename_works=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gl_cv_func_fchownat_empty_filename_works=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_fchownat_empty_filename_works" >&5
+$as_echo "$gl_cv_func_fchownat_empty_filename_works" >&6; }
+  if test "$gl_cv_func_fchownat_empty_filename_works" != yes; then
+  REPLACE_FCHOWNAT=1
+
+cat >>confdefs.h <<\_ACEOF
+#define FCHOWNAT_EMPTY_FILENAME_BUG 1
+_ACEOF
+
+
 fi
 
 
@@ -36613,9 +38290,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <time.h> /* for time_t */
 #include <limits.h> /* for CHAR_BIT, LONG_MIN, LONG_MAX */
 #define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
 #define TYPE_MAXIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+  ((t) ((t) 0 < (t) -1 \
+        ? (t) -1 \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
 typedef int verify_min[2 * (LONG_MIN <= TYPE_MINIMUM (time_t)) - 1];
 typedef int verify_max[2 * (TYPE_MAXIMUM (time_t) <= LONG_MAX) - 1];
 
@@ -37355,13 +39034,6 @@ _ACEOF
   # Code from module regex:
 
 
-
-
-
-
-
-
-
 # Check whether --with-included-regex was given.
 if test "${with_included_regex+set}" = set; then
   withval=$with_included_regex;
@@ -37391,57 +39063,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-           #if HAVE_LOCALE_H
-            #include <locale.h>
-           #endif
+           #include <locale.h>
            #include <limits.h>
            #include <regex.h>
 
 int
 main ()
 {
-static struct re_pattern_buffer regex;
+int result = 0;
+            static struct re_pattern_buffer regex;
             unsigned char folded_chars[UCHAR_MAX + 1];
             int i;
             const char *s;
             struct re_registers regs;
 
-            #if HAVE_LOCALE_H
-              /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
-                 This test needs valgrind to catch the bug on Debian
-                 GNU/Linux 3.1 x86, but it might catch the bug better
-                 on other platforms and it shouldn't hurt to try the
-                 test here.  */
-              if (setlocale (LC_ALL, "en_US.UTF-8"))
-                {
-                  static char const pat[] = "insert into";
-                  static char const data[] =
-                    "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
-                  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
-                                 | RE_ICASE);
-                  memset (&regex, 0, sizeof regex);
-                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
-                  if (s)
-                    return 1;
-                  if (re_search (&regex, data, sizeof data - 1,
-                                 0, sizeof data - 1, &regs)
-                      != -1)
-                    return 1;
-                  if (! setlocale (LC_ALL, "C"))
-                    return 1;
-                }
-            #endif
+            /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+               This test needs valgrind to catch the bug on Debian
+               GNU/Linux 3.1 x86, but it might catch the bug better
+               on other platforms and it shouldn't hurt to try the
+               test here.  */
+            if (setlocale (LC_ALL, "en_US.UTF-8"))
+              {
+                static char const pat[] = "insert into";
+                static char const data[] =
+                  "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+                re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+                               | RE_ICASE);
+                memset (&regex, 0, sizeof regex);
+                s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+                if (s)
+                  result |= 1;
+                else if (re_search (&regex, data, sizeof data - 1,
+                                    0, sizeof data - 1, &regs)
+                         != -1)
+                  result |= 1;
+                if (! setlocale (LC_ALL, "C"))
+                  return 1;
+              }
 
             /* This test is from glibc bug 3957, reported by Andrew Mackey.  */
             re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("a[^x]b", 6, &regex);
             if (s)
-              return 1;
-
+              result |= 2;
             /* This should fail, but succeeds for glibc-2.5.  */
-            if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
-              return 1;
+            else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+              result |= 2;
 
             /* This regular expression is from Spencer ere test number 75
                in grep-2.3.  */
@@ -37453,7 +39121,7 @@ static struct re_pattern_buffer regex;
             s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
             /* This should fail with _Invalid character class name_ error.  */
             if (!s)
-              return 1;
+              result |= 4;
 
             /* Ensure that [b-a] is diagnosed as invalid, when
                using RE_NO_EMPTY_RANGES. */
@@ -37461,34 +39129,31 @@ static struct re_pattern_buffer regex;
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("a[b-a]", 6, &regex);
             if (s == 0)
-              return 1;
+              result |= 8;
 
             /* This should succeed, but does not for glibc-2.1.3.  */
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("{1", 2, &regex);
-
             if (s)
-              return 1;
+              result |= 8;
 
             /* The following example is derived from a problem report
                against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("[an\371]*n", 7, &regex);
             if (s)
-              return 1;
-
+              result |= 8;
             /* This should match, but does not for glibc-2.2.1.  */
-            if (re_match (&regex, "an", 2, 0, &regs) != 2)
-              return 1;
+            else if (re_match (&regex, "an", 2, 0, &regs) != 2)
+              result |= 8;
 
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("x", 1, &regex);
             if (s)
-              return 1;
-
+              result |= 8;
             /* glibc-2.2.93 does not work with a negative RANGE argument.  */
-            if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
-              return 1;
+            else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+              result |= 8;
 
             /* The version of regex.c in older versions of gnulib
                ignored RE_ICASE.  Detect that problem too.  */
@@ -37496,10 +39161,9 @@ static struct re_pattern_buffer regex;
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("x", 1, &regex);
             if (s)
-              return 1;
-
-            if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
-              return 1;
+              result |= 16;
+            else if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+              result |= 16;
 
             /* Catch a bug reported by Vin Shelton in
                http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
@@ -37510,12 +39174,12 @@ static struct re_pattern_buffer regex;
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
             if (s)
-              return 1;
+              result |= 32;
 
             /* REG_STARTEND was added to glibc on 2004-01-15.
                Reject older versions.  */
             if (! REG_STARTEND)
-              return 1;
+              result |= 64;
 
 #if 0
             /* It would be nice to reject hosts whose regoff_t values are too
@@ -37526,10 +39190,11 @@ static struct re_pattern_buffer regex;
                when compiling --without-included-regex.   */
             if (sizeof (regoff_t) < sizeof (ptrdiff_t)
                 || sizeof (regoff_t) < sizeof (ssize_t))
-              return 1;
+              result |= 64;
 #endif
 
-            return 0;
+            return result;
+
   ;
   return 0;
 }
@@ -37930,8 +39595,8 @@ $as_echo_n "checking whether rename honors trailing slash on destination... " >&
 if test "${gl_cv_func_rename_slash_dst_works+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.lnk
-    touch conftest.f && mkdir conftest.d1 ||
+  rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
+    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
       { { $as_echo "$as_me:$LINENO: error: cannot create temporary files" >&5
 $as_echo "$as_me: error: cannot create temporary files" >&2;}
    { (exit 1); exit 1; }; }
@@ -37949,17 +39614,22 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#       include <stdio.h>
-#       include <stdlib.h>
+#        include <stdio.h>
+#        include <stdlib.h>
 
 int
 main ()
 {
-if (rename ("conftest.f", "conftest.f1/") == 0) return 1;
-     if (rename ("conftest.d1", "conftest.d2/") != 0) return 2;
+int result = 0;
+           if (rename ("conftest.f1", "conftest.f2/") == 0)
+             result |= 1;
+           if (rename ("conftest.d1", "conftest.d2/") != 0)
+             result |= 2;
 #if HAVE_LSTAT
-     if (rename ("conftest.f", "conftest.lnk/") == 0) return 3;
+           if (rename ("conftest.f", "conftest.lnk/") == 0)
+             result |= 4;
 #endif
+           return result;
 
   ;
   return 0;
@@ -38001,7 +39671,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 
 
-    rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.lnk
+    rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_rename_slash_dst_works" >&5
@@ -38030,8 +39700,8 @@ $as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
 if test "${gl_cv_func_rename_slash_src_works+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  rm -rf conftest.f conftest.d1 conftest.d2 conftest.lnk
-    touch conftest.f && mkdir conftest.d1 ||
+  rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
+    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
       { { $as_echo "$as_me:$LINENO: error: cannot create temporary files" >&5
 $as_echo "$as_me: error: cannot create temporary files" >&2;}
    { (exit 1); exit 1; }; }
@@ -38049,17 +39719,22 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#       include <stdio.h>
-#       include <stdlib.h>
+#        include <stdio.h>
+#        include <stdlib.h>
 
 int
 main ()
 {
-if (rename ("conftest.f/", "conftest.d2") == 0) return 1;
-     if (rename ("conftest.d1/", "conftest.d2") != 0) return 2;
+int result = 0;
+           if (rename ("conftest.f1/", "conftest.d3") == 0)
+             result |= 1;
+           if (rename ("conftest.d1/", "conftest.d2") != 0)
+             result |= 2;
 #if HAVE_LSTAT
-     if (rename ("conftest.lnk/", "conftest.f") == 0) return 3;
+           if (rename ("conftest.lnk/", "conftest.f") == 0)
+             result |= 4;
 #endif
+           return result;
 
   ;
   return 0;
@@ -38101,7 +39776,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 
 
-    rm -rf conftest.f conftest.d1 conftest.d2 conftest.lnk
+    rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_rename_slash_src_works" >&5
@@ -38143,17 +39818,24 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#       include <stdio.h>
-#       include <stdlib.h>
-#       include <unistd.h>
+#          include <stdio.h>
+#          include <stdlib.h>
+#          include <unistd.h>
 
 int
 main ()
 {
-if (rename ("conftest.f", "conftest.f1")) return 1;
-     if (unlink ("conftest.f1")) return 2;
-     if (rename ("conftest.f", "conftest.f")) return 3;
-     if (rename ("conftest.f1", "conftest.f1") == 0) return 4;
+int result = 0;
+             if (rename ("conftest.f", "conftest.f1"))
+               result |= 1;
+             if (unlink ("conftest.f1"))
+               result |= 2;
+             if (rename ("conftest.f", "conftest.f"))
+               result |= 4;
+             if (rename ("conftest.f1", "conftest.f1") == 0)
+               result |= 8;
+             return result;
+
   ;
   return 0;
 }
@@ -38241,14 +39923,19 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#       include <stdio.h>
-#       include <stdlib.h>
+#        include <stdio.h>
+#        include <stdlib.h>
 
 int
 main ()
 {
-if (rename ("conftest.d1", "conftest.d2") != 0) return 1;
-     if (rename ("conftest.d2", "conftest.f") == 0) return 2;
+int result = 0;
+           if (rename ("conftest.d1", "conftest.d2") != 0)
+             result |= 1;
+           if (rename ("conftest.d2", "conftest.f") == 0)
+             result |= 2;
+           return result;
+
   ;
   return 0;
 }
@@ -38400,7 +40087,6 @@ _ACEOF
   # Code from module rmdir:
 
 
-
     { $as_echo "$as_me:$LINENO: checking whether rmdir works" >&5
 $as_echo_n "checking whether rmdir works... " >&6; }
 if test "${gl_cv_func_rmdir_works+set}" = set; then
@@ -38424,8 +40110,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return !rmdir ("conftest.file/") || errno != ENOTDIR
-       || !rmdir ("conftest.dir/./");
+int result = 0;
+      if (!rmdir ("conftest.file/"))
+        result |= 1;
+      else if (errno != ENOTDIR)
+        result |= 2;
+      if (!rmdir ("conftest.dir/./"))
+        result |= 4;
+      return result;
+
   ;
   return 0;
 }
@@ -39822,7 +41515,12 @@ main ()
     signal (SIGALRM, handle_alarm);
     alarm (1);
     remaining = sleep (pentecost);
-    return !(pentecost - 10 < remaining && remaining <= pentecost);
+    if (remaining > pentecost)
+      return 3;
+    if (remaining <= pentecost - 10)
+      return 4;
+    return 0;
+
   ;
   return 0;
 }
@@ -40069,7 +41767,12 @@ $as_echo "$gl_cv_func_snprintf_size1" >&6; }
 
     case "$gl_cv_func_snprintf_size1" in
       *yes)
-        gl_cv_func_snprintf_usable=yes
+
+        case "$gl_cv_func_snprintf_retval_c99" in
+          *yes)
+            gl_cv_func_snprintf_usable=yes
+            ;;
+        esac
         ;;
     esac
   fi
@@ -40113,6 +41816,13 @@ _ACEOF
 
 
 
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_SNPRINTF 1
+_ACEOF
+
+
   # Code from module ssize_t:
 
   { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5
@@ -40183,7 +41893,6 @@ _ACEOF
 
 
 
-
     { $as_echo "$as_me:$LINENO: checking whether stat handles trailing slashes on directories" >&5
 $as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
 if test "${gl_cv_func_stat_dir_slash+set}" = set; then
@@ -40274,11 +41983,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-struct stat st;
-      if (!stat ("conftest.tmp/", &st)) return 1;
+int result = 0;
+      struct stat st;
+      if (!stat ("conftest.tmp/", &st))
+        result |= 1;
 #if HAVE_LSTAT
-      if (!stat ("conftest.lnk/", &st)) return 2;
+      if (!stat ("conftest.lnk/", &st))
+        result |= 2;
 #endif
+      return result;
 
   ;
   return 0;
@@ -41308,9 +43021,6 @@ rm -f conftest*
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdarg_h='<'stdarg.h'>'
      else
@@ -41320,8 +43030,7 @@ if test "${gl_cv_next_stdarg_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdarg_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -41330,20 +43039,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdarg.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdarg_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdarg.h#{
-                 s#.*"\(.*/stdarg.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stdarg_h='<'stdarg.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_stdarg_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/stdarg.h#{
+                    s#.*"\(.*/stdarg.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdarg_h" >&5
@@ -41362,6 +43069,7 @@ $as_echo "$gl_cv_next_stdarg_h" >&6; }
 
 
 
+
             if test "$gl_cv_next_stdarg_h" = '""'; then
         gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
         NEXT_STDARG_H="$gl_cv_next_stdarg_h"
@@ -41535,9 +43243,6 @@ $as_echo "$gl_cv_decl_null_works" >&6; }
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stddef_h='<'stddef.h'>'
      else
@@ -41547,8 +43252,7 @@ if test "${gl_cv_next_stddef_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stddef_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -41557,20 +43261,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stddef.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stddef.h#{
-                 s#.*"\(.*/stddef.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stddef_h='<'stddef.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/stddef.h#{
+                    s#.*"\(.*/stddef.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stddef_h" >&5
@@ -41589,6 +43291,7 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
 
 
 
+
   fi
 
   # Code from module stdint:
@@ -41609,6 +43312,19 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
   fi
 
 
+
+
+
+
+
+
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+
+
       if test $ac_cv_header_inttypes_h = yes; then
     HAVE_INTTYPES_H=1
   else
@@ -41634,6 +43350,9 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdint_h='<'stdint.h'>'
      else
@@ -41643,8 +43362,10 @@ if test "${gl_cv_next_stdint_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdint_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_stdint_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -41653,20 +43374,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdint.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdint.h#{
-                 s#.*"\(.*/stdint.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/stdint.h#{
+                    s#.*"\(.*/stdint.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_stdint_h='<'stdint.h'>'
-          fi
+               gl_cv_next_stdint_h='<'stdint.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5
@@ -41685,6 +43407,7 @@ $as_echo "$gl_cv_next_stdint_h" >&6; }
 
 
 
+
   if test $ac_cv_header_stdint_h = yes; then
     HAVE_STDINT_H=1
   else
@@ -41802,9 +43525,11 @@ uintmax_t j = UINTMAX_MAX;
 
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
 #define TYPE_MAXIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+  ((t) ((t) 0 < (t) -1 \
+        ? (t) -1 \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
 struct s {
   int check_PTRDIFF:
       PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
@@ -41961,7 +43686,7 @@ main ()
           || strncmp (value, "((int)"/*)*/, 6) == 0
           || strncmp (value, "((signed short)"/*)*/, 15) == 0
           || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return 1;
+        return mv - macro_values + 1;
     }
   return 0;
 
@@ -42187,13 +43912,6 @@ done
 
 
 
-
-
-
-
-
-
-
   if test $APPLE_UNIVERSAL_BUILD = 0; then
 
 
@@ -43336,10 +45054,6 @@ _ACEOF
 
 
 
-
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdio_h='<'stdio.h'>'
      else
@@ -43349,8 +45063,7 @@ if test "${gl_cv_next_stdio_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdio_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -43359,20 +45072,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdio.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdio.h#{
-                 s#.*"\(.*/stdio.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stdio_h='<'stdio.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/stdio.h#{
+                    s#.*"\(.*/stdio.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5
@@ -43391,6 +45102,7 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
 
 
 
+
       GNULIB_FPRINTF=1
   GNULIB_PRINTF=1
   GNULIB_VFPRINTF=1
@@ -43496,9 +45208,6 @@ fi
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdlib_h='<'stdlib.h'>'
      else
@@ -43508,8 +45217,7 @@ if test "${gl_cv_next_stdlib_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdlib_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -43518,20 +45226,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdlib.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdlib.h#{
-                 s#.*"\(.*/stdlib.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stdlib_h='<'stdlib.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/stdlib.h#{
+                    s#.*"\(.*/stdlib.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5
@@ -43551,188 +45257,6 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; }
 
 
 
-for ac_header in random.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-  if test $ac_cv_header_random_h = yes; then
-    HAVE_RANDOM_H=1
-  else
-    HAVE_RANDOM_H=0
-  fi
-
-  { $as_echo "$as_me:$LINENO: checking for struct random_data" >&5
-$as_echo_n "checking for struct random_data... " >&6; }
-if test "${ac_cv_type_struct_random_data+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type_struct_random_data=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-      #if HAVE_RANDOM_H
-      # include <random.h>
-      #endif
-
-
-int
-main ()
-{
-if (sizeof (struct random_data))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-      #if HAVE_RANDOM_H
-      # include <random.h>
-      #endif
-
-
-int
-main ()
-{
-if (sizeof ((struct random_data)))
-         return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_type_struct_random_data=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_random_data" >&5
-$as_echo "$ac_cv_type_struct_random_data" >&6; }
-if test "x$ac_cv_type_struct_random_data" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_RANDOM_DATA 1
-_ACEOF
-
-
-else
-  HAVE_STRUCT_RANDOM_DATA=0
-fi
-
 
 
 
@@ -44808,9 +46332,6 @@ _ACEOF
   # Code from module strnlen1:
   # Code from module strtoimax:
 
-
-
-
   { $as_echo "$as_me:$LINENO: checking whether <inttypes.h> defines strtoimax as a macro" >&5
 $as_echo_n "checking whether <inttypes.h> defines strtoimax as a macro... " >&6; }
 if test "${gl_cv_func_strtoimax_macro+set}" = set; then
@@ -45552,9 +47073,6 @@ _ACEOF
 
   # Code from module strtoumax:
 
-
-
-
   { $as_echo "$as_me:$LINENO: checking whether <inttypes.h> defines strtoumax as a macro" >&5
 $as_echo_n "checking whether <inttypes.h> defines strtoumax as a macro... " >&6; }
 if test "${gl_cv_func_strtoumax_macro+set}" = set; then
@@ -45821,9 +47339,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-if (!symlink ("a", "conftest.link/")) return 1;
-      if (symlink ("conftest.f", "conftest.lnk2")) return 2;
-      if (!symlink ("a", "conftest.lnk2/")) return 3;
+int result = 0;
+             if (!symlink ("a", "conftest.link/"))
+               result |= 1;
+             if (symlink ("conftest.f", "conftest.lnk2"))
+               result |= 2;
+             else if (!symlink ("a", "conftest.lnk2/"))
+               result |= 4;
+             return result;
+
   ;
   return 0;
 }
@@ -45952,6 +47476,9 @@ _ACEOF
 
 
 
+
+
+
 
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_sys_stat_h='<'sys/stat.h'>'
@@ -45962,8 +47489,10 @@ if test "${gl_cv_next_sys_stat_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_sys_stat_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_sys_stat_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -45972,20 +47501,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/stat.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/sys/stat.h#{
-                 s#.*"\(.*/sys/stat.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/sys/stat.h#{
+                    s#.*"\(.*/sys/stat.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_sys_stat_h='<'sys/stat.h'>'
-          fi
+               gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5
@@ -46005,6 +47535,7 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; }
 
 
 
+
       { $as_echo "$as_me:$LINENO: checking for nlink_t" >&5
 $as_echo_n "checking for nlink_t... " >&6; }
 if test "${ac_cv_type_nlink_t+set}" = set; then
@@ -46307,6 +47838,9 @@ $as_echo "$MKDIR_P" >&6; }
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_sysexits_h='<'sysexits.h'>'
      else
@@ -46316,8 +47850,10 @@ if test "${gl_cv_next_sysexits_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_sysexits_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_sysexits_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -46326,20 +47862,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sysexits.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_sysexits_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/sysexits.h#{
-                 s#.*"\(.*/sysexits.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_sysexits_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/sysexits.h#{
+                    s#.*"\(.*/sysexits.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_sysexits_h='<'sysexits.h'>'
-          fi
+               gl_cv_next_sysexits_h='<'sysexits.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_sysexits_h" >&5
@@ -46358,6 +47895,7 @@ $as_echo "$gl_cv_next_sysexits_h" >&6; }
 
 
 
+
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -46460,9 +47998,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 
+  if test $ac_cv_have_decl_localtime_r = no; then
+    HAVE_DECL_LOCALTIME_R=0
+  fi
+
+
+
+
+
 
 
   if test $ac_cv_func_localtime_r = yes; then
+    HAVE_LOCALTIME_R=1
     { $as_echo "$as_me:$LINENO: checking whether localtime_r is compatible with its POSIX signature" >&5
 $as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
 if test "${gl_cv_time_r_posix+set}" = set; then
@@ -46579,6 +48126,9 @@ _ACEOF
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_unistd_h='<'unistd.h'>'
      else
@@ -46588,8 +48138,10 @@ if test "${gl_cv_next_unistd_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_unistd_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_unistd_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -46598,20 +48150,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <unistd.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/unistd.h#{
-                 s#.*"\(.*/unistd.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/unistd.h#{
+                    s#.*"\(.*/unistd.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_unistd_h='<'unistd.h'>'
-          fi
+               gl_cv_next_unistd_h='<'unistd.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5
@@ -46631,12 +48184,6 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-
-
-
-
-
-
   if test $ac_cv_header_unistd_h = yes; then
     HAVE_UNISTD_H=1
   else
@@ -46683,7 +48230,8 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
-  for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat     fsync ftruncate getcwd getdomainname getdtablesize getgroups     gethostname getlogin getlogin_r getpagesize getusershell setusershell     endusershell lchown link linkat lseek pipe2 pread pwrite readlink     readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat     usleep; do
+
+  for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat     fsync ftruncate getcwd getdomainname getdtablesize getgroups     gethostname getlogin getlogin_r getpagesize getusershell setusershell     endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink     readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat     usleep; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -46698,7 +48246,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <unistd.h>
 /* Some systems declare various items in the wrong headers.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <fcntl.h>
 # include <stdio.h>
 # include <stdlib.h>
@@ -46868,7 +48416,7 @@ fi
             || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
                  && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
                       || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
-                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 4
                          }
                     }
                }
@@ -46890,7 +48438,6 @@ fi
 
 
 
-
     { $as_echo "$as_me:$LINENO: checking whether unlink honors trailing slashes" >&5
 $as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
 if test "${gl_cv_func_unlink_honors_slashes+set}" = set; then
@@ -46916,10 +48463,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-if (!unlink ("conftest.file/") || errno != ENOTDIR) return 1;
+int result = 0;
+           if (!unlink ("conftest.file/"))
+             result |= 1;
+           else if (errno != ENOTDIR)
+             result |= 2;
 #if HAVE_LSTAT
-      if (!unlink ("conftest.lnk/") || errno != ENOTDIR) return 2;
+           if (!unlink ("conftest.lnk/"))
+             result |= 4;
+           else if (errno != ENOTDIR)
+             result |= 8;
 #endif
+           return result;
 
   ;
   return 0;
@@ -46965,8 +48520,8 @@ fi
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_unlink_honors_slashes" >&5
 $as_echo "$gl_cv_func_unlink_honors_slashes" >&6; }
-      { $as_echo "$as_me:$LINENO: checking whether unlink of a parent directory fails is it should" >&5
-$as_echo_n "checking whether unlink of a parent directory fails is it should... " >&6; }
+      { $as_echo "$as_me:$LINENO: checking whether unlink of a parent directory fails as it should" >&5
+$as_echo_n "checking whether unlink of a parent directory fails as it should... " >&6; }
 if test "${gl_cv_func_unlink_parent_fails+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
@@ -47004,9 +48559,12 @@ cat >>conftest.$ac_ext <<_ACEOF
                 #include <unistd.h>
                 int main ()
                 {
+                  int result = 0;
                   if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0)
-                    return 1;
-                  return unlink ("..") == 0;
+                    result |= 1;
+                  else if (unlink ("..") == 0)
+                    result |= 2;
+                  return result;
                 }
 
 _ACEOF
@@ -47209,6 +48767,13 @@ _ACEOF
 
 
 
+
+
+
+  if test $ac_cv_have_decl_unsetenv = no; then
+    HAVE_DECL_UNSETENV=0
+  fi
+
 for ac_func in unsetenv
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -47310,7 +48875,6 @@ fi
 done
 
   if test $ac_cv_func_unsetenv = no; then
-    HAVE_UNSETENV=0
 
 
 
@@ -47343,6 +48907,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
 #include <stdlib.h>
 extern
 #ifdef __cplusplus
@@ -47411,7 +48977,7 @@ _ACEOF
 
     fi
 
-            { $as_echo "$as_me:$LINENO: checking whether unsetenv obeys POSIX" >&5
+                { $as_echo "$as_me:$LINENO: checking whether unsetenv obeys POSIX" >&5
 $as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
 if test "${gl_cv_func_unsetenv_works+set}" = set; then
   $as_echo_n "(cached) " >&6
@@ -47428,18 +48994,27 @@ cat >>conftest.$ac_ext <<_ACEOF
 
        #include <stdlib.h>
        #include <errno.h>
+       extern char **environ;
 
 int
 main ()
 {
 
-       char entry[] = "b=2";
+       char entry1[] = "a=1";
+       char entry2[] = "b=2";
+       char *env[] = { entry1, entry2, NULL };
        if (putenv ((char *) "a=1")) return 1;
-       if (putenv (entry)) return 2;
-       entry[0] = 'a';
+       if (putenv (entry2)) return 2;
+       entry2[0] = 'a';
        unsetenv ("a");
        if (getenv ("a")) return 3;
        if (!unsetenv ("") || errno != EINVAL) return 4;
+       entry2[0] = 'b';
+       environ = env;
+       if (!getenv ("a")) return 5;
+       entry2[0] = 'a';
+       unsetenv ("a");
+       if (getenv ("a")) return 6;
 
   ;
   return 0;
@@ -47562,6 +49137,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <stddef.h>
 #include <sys/times.h>
+#include <fcntl.h>
 
 int
 main ()
@@ -47668,18 +49244,34 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-struct timespec ts[2] = { { 1, UTIME_OMIT }, { 1, UTIME_NOW } };
-      struct stat st;
-      const char *f = "conftest.file";
-      if (close (creat (f, 0600))) return 1;
-      if (utimensat (AT_FDCWD, f, NULL, AT_SYMLINK_NOFOLLOW)) return 2;
-      if (utimensat (AT_FDCWD, f, ts, 0)) return 3;
-      sleep (1);
-      ts[0].tv_nsec = UTIME_NOW;
-      ts[1].tv_nsec = UTIME_OMIT;
-      if (utimensat (AT_FDCWD, f, ts, 0)) return 4;
-      if (stat (f, &st)) return 5;
-      if (st.st_ctime < st.st_atime) return 6;
+int result = 0;
+              const char *f = "conftest.file";
+              if (close (creat (f, 0600)))
+                return 1;
+              /* Test whether the AT_SYMLINK_NOFOLLOW flag is supported.  */
+              {
+                if (utimensat (AT_FDCWD, f, NULL, AT_SYMLINK_NOFOLLOW))
+                  result |= 2;
+              }
+              /* Test whether UTIME_NOW and UTIME_OMIT work.  */
+              {
+                struct timespec ts[2] = { { 1, UTIME_OMIT }, { 1, UTIME_NOW } };
+                if (utimensat (AT_FDCWD, f, ts, 0))
+                  result |= 4;
+              }
+              sleep (1);
+              {
+                struct timespec ts[2] = { { 1, UTIME_NOW }, { 1, UTIME_OMIT } };
+                struct stat st;
+                if (utimensat (AT_FDCWD, f, ts, 0))
+                  result |= 8;
+                if (stat (f, &st))
+                  result |= 16;
+                else if (st.st_ctime < st.st_atime)
+                  result |= 32;
+              }
+              return result;
+
   ;
   return 0;
 }
@@ -47872,6 +49464,7 @@ _ACEOF
 
 
 
+
   { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
 $as_echo_n "checking for ptrdiff_t... " >&6; }
 if test "${ac_cv_type_ptrdiff_t+set}" = set; then
@@ -48378,7 +49971,12 @@ $as_echo "$gl_cv_func_snprintf_size1" >&6; }
 
     case "$gl_cv_func_snprintf_size1" in
       *yes)
-        gl_cv_func_vsnprintf_usable=yes
+
+        case "$gl_cv_func_snprintf_retval_c99" in
+          *yes)
+            gl_cv_func_vsnprintf_usable=yes
+            ;;
+        esac
         ;;
     esac
   fi
@@ -48441,9 +50039,6 @@ _ACEOF
 
 
 
-
-
-
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_wchar_h='<'wchar.h'>'
      else
@@ -48453,8 +50048,10 @@ if test "${gl_cv_next_wchar_h+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_wchar_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+             if test $ac_cv_header_wchar_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -48463,20 +50060,21 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <wchar.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/wchar.h#{
-                 s#.*"\(.*/wchar.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/wchar.h#{
+                    s#.*"\(.*/wchar.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
           else
-            gl_cv_next_wchar_h='<'wchar.h'>'
-          fi
+               gl_cv_next_wchar_h='<'wchar.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5
@@ -48495,6 +50093,7 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
+
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
   else
@@ -48503,6 +50102,8 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
+
+
   if test $gt_cv_c_wint_t = yes; then
     HAVE_WINT_T=1
   else
@@ -48522,7 +50123,35 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
-  for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb     wcsrtombs wcsnrtombs wcwidth; do
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb      wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset      wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp      wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr      wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth     ; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -48536,8 +50165,11 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Some systems require additional headers.  */
-#ifndef __GLIBC__
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 # include <stdio.h>
 # include <time.h>
@@ -48648,6 +50280,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -48736,6 +50375,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -48858,32 +50504,39 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <locale.h>
-#include <stdio.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
+  int result = 0;
   if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
     {
       if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
+        result |= 1;
     }
   if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
     {
       if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
+        result |= 2;
     }
   if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
     {
       if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
+        result |= 4;
     }
   if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
     {
       if (wcrtomb (NULL, 0, NULL) != 1)
-        return 1;
+        result |= 8;
     }
-  return 0;
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -48965,7 +50618,8 @@ _ACEOF
 
 
 
-  # Code from module wctype:
+  # Code from module wctype-h:
+
 
 
 
@@ -48985,23 +50639,17 @@ _ACEOF
 
 
 
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
 
 
 
 
 
 
-  if test $ac_cv_func_iswblank = yes; then
-    HAVE_ISWBLANK=1
-    REPLACE_ISWBLANK=0
-  else
-    HAVE_ISWBLANK=0
-    if test $ac_cv_have_decl_iswblank = yes; then
-      REPLACE_ISWBLANK=1
-    else
-      REPLACE_ISWBLANK=0
-    fi
-  fi
 
 
 
@@ -49012,13 +50660,59 @@ _ACEOF
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_wctype_h='<'wctype.h'>'
+     else
+       { $as_echo "$as_me:$LINENO: checking absolute name of <wctype.h>" >&5
+$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
+if test "${gl_cv_next_wctype_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+             if test $ac_cv_header_wctype_h = yes; then
+
+
+               cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <wctype.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+                                                            gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                  sed -n '\#/wctype.h#{
+                    s#.*"\(.*/wctype.h\)".*#\1#
+                    s#^/[^/]#//&#
+                    p
+                    q
+                  }'`'"'
+          else
+               gl_cv_next_wctype_h='<'wctype.h'>'
+             fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_wctype_h" >&5
+$as_echo "$gl_cv_next_wctype_h" >&6; }
+     fi
+     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'wctype.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_wctype_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
 
 
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
 
 
   if test $ac_cv_header_wctype_h = yes; then
@@ -49084,12 +50778,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-                            #include <stddef.h>
-                            #include <stdio.h>
-                            #include <time.h>
-                            #include <wchar.h>
-                            #include <wctype.h>
-                            int main () { return iswprint ('x') == 0; }
+               /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+                  included before <wchar.h>.
+                  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+                  must be included before <wchar.h>.  */
+               #include <stddef.h>
+               #include <stdio.h>
+               #include <time.h>
+               #include <wchar.h>
+               #include <wctype.h>
+               int main () { return iswprint ('x') == 0; }
+
 _ACEOF
 rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 { $as_echo "$as_me:$LINENO: result: $gl_cv_func_iswcntrl_works" >&5
 $as_echo "$gl_cv_func_iswcntrl_works" >&6; }
     fi
+    HAVE_WCTYPE_H=1
+  else
+    HAVE_WCTYPE_H=0
+  fi
 
 
+  if test "$gl_cv_func_iswcntrl_works" = no; then
+    REPLACE_ISWCNTRL=1
+  else
+    REPLACE_ISWCNTRL=0
+  fi
 
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        :
+  fi
 
+          { $as_echo "$as_me:$LINENO: checking for wctype_t" >&5
+$as_echo_n "checking for wctype_t... " >&6; }
+if test "${gl_cv_type_wctype_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #if HAVE_WCTYPE_H
+            # include <wctype.h>
+            #endif
+            wctype_t a;
 
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_type_wctype_t=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       gl_cv_type_wctype_t=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_type_wctype_t" >&5
+$as_echo "$gl_cv_type_wctype_t" >&6; }
+  if test $gl_cv_type_wctype_t = no; then
+    HAVE_WCTYPE_T=0
+  fi
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_wctype_h='<'wctype.h'>'
-     else
-       { $as_echo "$as_me:$LINENO: checking absolute name of <wctype.h>" >&5
-$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
-if test "${gl_cv_next_wctype_h+set}" = set; then
+      { $as_echo "$as_me:$LINENO: checking for wctrans_t" >&5
+$as_echo_n "checking for wctrans_t... " >&6; }
+if test "${gl_cv_type_wctrans_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-          if test $ac_cv_header_wctype_h = yes; then
-            cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <wctype.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #include <wctype.h>
+            wctrans_t a;
+
+int
+main ()
+{
 
+  ;
+  return 0;
+}
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/wctype.h#{
-                 s#.*"\(.*/wctype.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_wctype_h='<'wctype.h'>'
-          fi
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_type_wctrans_t=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       gl_cv_type_wctrans_t=no
 fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_wctype_h" >&5
-$as_echo "$gl_cv_next_wctype_h" >&6; }
-     fi
-     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
 
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'wctype.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_wctype_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $gl_cv_type_wctrans_t" >&5
+$as_echo "$gl_cv_type_wctrans_t" >&6; }
+  if test $gl_cv_type_wctrans_t = no; then
+    HAVE_WCTRANS_T=0
+  fi
 
 
-    HAVE_WCTYPE_H=1
-  else
-    HAVE_WCTYPE_H=0
-  fi
 
 
-  if test "$gl_cv_func_iswcntrl_works" = no; then
-    REPLACE_ISWCNTRL=1
-  else
-    REPLACE_ISWCNTRL=0
-  fi
+
+
+  for gl_func in wctype iswctype wctrans towctrans     ; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:$LINENO: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_gl_Symbol=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_gl_Symbol=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+     as_val=`eval 'as_val=${'$as_gl_Symbol'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+
+      done
 
 
   # Code from module wcwidth:
@@ -49357,10 +51215,15 @@ int wcwidth (int);
 #endif
 int main ()
 {
+  int result = 0;
   if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL)
-    if (wcwidth (0x0301) > 0 || wcwidth (0x200B) > 0)
-      return 1;
-  return 0;
+    {
+      if (wcwidth (0x0301) > 0)
+        result |= 1;
+      if (wcwidth (0x200B) > 0)
+        result |= 2;
+    }
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -52427,6 +54290,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <string.h>
 int main ()
 {
+  int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
@@ -52443,7 +54307,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
       }
   }
   /* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -52462,7 +54327,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
       }
   }
   /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
@@ -52480,7 +54346,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
-          return 1;
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -52499,7 +54366,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
@@ -52513,8 +54381,8 @@ int main ()
       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
       /* Try HP-UX names.  */
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
-  return 0;
+    result |= 16;
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -52659,6 +54527,7 @@ cat >>confdefs.h <<_ACEOF
 #define ICONV_CONST $am_cv_proto_iconv_arg1
 _ACEOF
 
+
   fi
 
 
@@ -53671,6 +55540,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <string.h>
 int main ()
 {
+  int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
@@ -53687,7 +55557,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
       }
   }
   /* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -53706,7 +55577,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
       }
   }
   /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
@@ -53724,7 +55596,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
-          return 1;
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -53743,7 +55616,8 @@ int main ()
                             (char **) &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
@@ -53757,8 +55631,8 @@ int main ()
       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
       /* Try HP-UX names.  */
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
-  return 0;
+    result |= 16;
+  return result;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -55063,7 +56937,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by GNU tar $as_me 1.25, which was
+This file was extended by GNU tar $as_me 1.26, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -55126,7 +57000,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-GNU tar config.status 1.25
+GNU tar config.status 1.26
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"